

                22-Aug-1978 02:32:43	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 1   

					FLDCHK.FTN.2        



        C

        C

        C	FLDCHK  --  ROUTINE TO CHECK NAME FIELDS

        C

        C

        C

        C	COPYRIGHT (C) 1976

        C	DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

        C

        C	THIS SOFTWARE IS FURNISHED UNDER  A LICENSE FOR USE ONLY  ON  A

        C	SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

        C	SION OF  THE  ABOVE  COPYRIGHT NOTICE.  THIS SOFTWARE,  OR  ANY

        C	OTHER COPIES THEREOF, MAY NOT BE  PROVIDED  OR  OTHERWISE  MADE

        C	AVAILABLE TO ANY OTHER PERSON EXCEPT  FOR  USE  ON  SUCH SYSTEM

        C	AND TO  ONE WHO AGREES  TO  THESE LICENSE  TERMS.  TITLE TO AND

        C	OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

        C

        C	THE INFORMATION IN THIS SOFTWARE  IS  SUBJECT TO CHANGE WITHOUT

        C	NOTICE AND SHOULD NOT BE CONSTRUED  AS  A COMMITMENT BY DIGITAL

        C	EQUIPMENT CORPORATION.

        C

        C	DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS

        C	SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

        C

        C

        C	T.J. PORTER AND K.D. MORSE  07-NOV-76

        C

        C

        C	THIS SUBROUTINE VALIDATES NAME FIELDS.

        C

        C

        C

0001    	SUBROUTINE	FLDCHK(ICOUNT,IELMNT,ARRAY,I)

        C

        C		SUBROUTINE TO CHECK VALIDITY OF A NAME

        C	STRING.	INPUT:

        C			ICOUNT =	CHARACTER COUNT

        C			IELMNT =	STARTING ELEMENT OF ARRAY

        C			ARRAY =		CHARACTER STRING.

        C

        C		OUTPUT:

        C			I =		NEGATIVE IF ICOUNT < = 0

        C					OR > NAMMAX

        C

        C			I = ARRAY ELEMENT IF CHARACTER IS

        C				NOT IN SET _$0-9,A-Z

        C					AND BLANK

        C

        C			I = 0		WHEN ALL CHARACTERS ARE

        C						CHECKED.

        C

        C

0002    	BYTE	USCORE,DOLLAR,BLANK,ZERO,NINE,AYE,ZEE,DOT

0003    	BYTE	ARRAY(15+IELMNT)

        C

0004    	DATA	USCORE,DOLLAR,BLANK,DOT/'_','$',' ','.'/



FLDCHK          22-Aug-1978 02:32:43	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 2   

					FLDCHK.FTN.2        



0005    	DATA	ZERO,NINE,AYE,ZEE/'0','9','A','Z'/

0006    	DATA	NAMMAX/15/

        C

0007    	IF(ICOUNT .LE. 0 .OR. (ICOUNT .GT. NAMMAX))GO TO 200

0008    	DO 100 I = IELMNT,IELMNT+ICOUNT-1

0009    	IF(ARRAY(I) .EQ. DOT .OR. (ARRAY(I) .EQ. BLANK))  GO TO 100

0010    	IF(ARRAY(I) .EQ. USCORE .OR. (ARRAY(I) .EQ. DOLLAR))GO TO 100

0011    	IF(ARRAY(I) .GE. ZERO .AND. (ARRAY(I) .LE. NINE))GO TO 100

0012    	IF(ARRAY(I) .GE. AYE .AND. (ARRAY(I) .LE. ZEE))GO TO 100

0013    	GO TO 300

0014    100	CONTINUE

0015    	I = 0

0016    	GO TO 300

0017    200	I = -1

0018    300	RETURN

0019    	END



FLDCHK          22-Aug-1978 02:32:43	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 3   

					FLDCHK.FTN.2        



PROGRAM SECTIONS



    Name                 Bytes   Attributes



  0 $CODE                  148   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG

  2 $LOCAL                  54   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG





ENTRY POINTS



    Address  Type Name           



  0-00000000      FLDCHK         





VARIABLES



    Address  Type Name               Address  Type Name               Address  Type Name               Address  Type Name           



  2-00000005  L*1 AYE              2-00000002  L*1 BLANK            2-00000001  L*1 DOLLAR           2-00000007  L*1 DOT            

 AP-00000010@ I*2 I               AP-00000004@ I*2 ICOUNT          AP-00000008@ I*2 IELMNT           2-00000008  I*2 NAMMAX         

  2-00000004  L*1 NINE             2-00000000  L*1 USCORE           2-00000006  L*1 ZEE              2-00000003  L*1 ZERO           





ARRAYS



    Address  Type Name		       Bytes  Dimensions



 AP-0000000C@ L*1 ARRAY                   **  (*)





LABELS



    Address   Label       Address   Label       Address   Label   



  0-00000082  100       0-0000008F  200       0-00000093  300     





Total Space Allocated = 202 Bytes





COMPILER OPTIONS



/CHECK=(NOBOUNDS,OVERFLOW)

/DEBUG=(NOSYMBOLS,TRACEBACK)

/OPTIMIZE  /WARNINGS  /NOI4  /NOD_LINES  

