
                               					20-May-1983 10:28:43	VAX-11 FORTRAN V3.2-37              Page   1
								10-May-1983 09:58:04	CAD$VOLSET:[GARY.STATS.SOURCE]MKLENGTH.FOR;4

0001    !
0002    !			  COPYRIGHT (c) 1982 BY
0003    !	      MOSTEK CORPORATION, CARROLLTON TX
0004    !
0005    ! This software is furnished under a license and may be used and  copied
0006    ! only  in  accordance  with  the  terms  of  such  license and with the
0007    ! inclusion of the above copyright notice.  This software or  any  other
0008    ! copies  thereof may not be provided or otherwise made available to any
0009    ! other person.  No title to and ownership of  the  software  is  hereby
0010    ! transferred.
0011    !
0012    ! The information in this software is subject to change  without  notice
0013    ! and  should  not  be  construed  as  a commitment by MOSTEK
0014    ! CORPORATION.
0015    !
0016    ! MOSTEK assumes no responsibility for the use or  reliability  of  its
0017    ! software on equipment which is not supplied by MOSTEK.
0018    !
0019     
0020    !++
0021    ! FACILITY:
0022    !   MOSTEK CORPORATION
0023    !
0024    ! ABSTRACT: MK$LENGTH returns the true length of a character string.
0025    !           The true length is the length without trailing blanks or
0026    !           nulls.
0027    !   
0028    !
0029    ! ENVIRONMENT: VAX VMS unpriv
0030    !   
0031    !
0032    ! AUTHOR: Gary Smith, CREATION DATE: 8/19/1982
0033    !
0034    ! MODIFIED BY:
0035    !
0036    !--
0037    !
0038    ! TABLE OF CONTENTS:
0039    !
0040    !
0041    ! INCLUDE FILES: none
0042    !
0043    !
0044    ! MACROS: none
0045    !
0046    !
0047    ! EQUATED SYMBOLS: none
0048    !
0049    !
0050    ! EXTERNAL REFERENCES: none
0051    !
0052     
0053    !++
0054    ! FUNCTIONAL DESCRIPTION: Take the string and count backwards until
0055    !                         some character other than a blank or null is found.
0056    !                         This is the strings real length.
0057    !

                               					20-May-1983 10:28:43	VAX-11 FORTRAN V3.2-37              Page   2
								10-May-1983 09:58:04	CAD$VOLSET:[GARY.STATS.SOURCE]MKLENGTH.FOR;4

0058    !
0059    !
0060    ! FORMAL PARAMETERS: The string in question
0061    !
0062    !
0063    !
0064    ! IMPLICIT INPUTS: none
0065    !
0066    !
0067    !
0068    ! IMPLICIT OUTPUTS: the length of the string without blanks or nulls
0069    !
0070    !
0071    !
0072    ! ROUTINE VALUE and
0073    ! COMPLETION CODES: The string's real length
0074    !
0075    !
0076    !
0077    ! SIDE EFFECTS: none to date
0078    !
0079    !
0080    !
0081    !--
0082          FUNCTION MK$LENGTH (STRING)
0083     
0084          character*(*) string
0085     
0086          MK$LENGTH = len(string)
0087     
0088    !++
0089    ! count backwards from the end
0090    !--
0091     
0092          do i = MK$LENGTH,1,-1
0093            if (ichar(string(i:i)) .ne.  '0'x  .and.
0094         +      ichar(string(i:i)) .ne. '20'x)  then
0095               MK$LENGTH = i
0096               return
0097            end if
0098          end do
0099     
0100          return
0101          end

MK$LENGTH                      					20-May-1983 10:28:43	VAX-11 FORTRAN V3.2-37              Page   3
								10-May-1983 09:58:04	CAD$VOLSET:[GARY.STATS.SOURCE]MKLENGTH.FOR;4

PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                  116   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  2 $LOCAL                                  20   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG

    Total Space Allocated                  136


ENTRY POINTS

    Address  Type  Name                      References

  0-00000000  I*4  MK$LENGTH                    82        86=       92        95=    


VARIABLES

    Address  Type  Name          Attributes  References

  2-00000004  I*4  I                            92=       93(4)     95     
 AP-00000004@ CHAR STRING                       82        84        86        93(2)  


  +----------------------------------------------+
  |           KEY TO REFERENCE FLAGS             |
  |   =   - Value Modified                       |
  |   #   - Defining Reference                   |
  |   A   - Actual Argument, possibly modified   |
  |   D   - Data Initialization                  |
  |  (n)  - Number of occurrences on line        |
  +----------------------------------------------+



COMMAND QUALIFIERS

  FORTRAN /DEBUG/OBJECT=OBJ:MKLENGTH/LIST=LIS:MKLENGTH/CONT=99/CROSS/NOOPT SRC:MKLENGTH

  /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW)
  /DEBUG=(SYMBOLS,TRACEBACK)
  /STANDARD=(NOSYNTAX,NOSOURCE_FORM)
  /SHOW=(NOPREPROCESSOR,NOINCLUDE,MAP)
  /F77  /NOG_FLOATING  /I4  /NOOPTIMIZE  /WARNINGS  /NOD_LINES  /CROSS_REFERENCE  /NOMACHINE_CODE  /CONTINUATIONS=99


COMPILATION STATISTICS

  Run Time:           0.94 seconds
  Elapsed Time:       1.96 seconds
  Page Faults:        375
  Dynamic Memory:     794 pages
