home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
ADV350.ZIP
/
a5toa1.for
next >
Wrap
Text File
|
1990-11-18
|
1KB
|
48 lines
SUBROUTINE A5TOA1(A,B,C,CHARS,LENG)
C
C IN ORDER TO WORK ON A PDP-11, THIS HAS BEEN CHANGED TO BE
C AN A4 TO A1 CONVERSION ROUTINE.
C A AND B CONTAIN A 1- TO 8-CHARACTER WORD IN A4 FORMAT, C CONTAINS ANOTHER
C WORD AND/OR PUNCTUATION. THEY ARE UNPACKED TO ONE CHARACTER PER WORD IN THE
C ARRAY "CHARS", WITH EXACTLY ONE BLANK BETWEEN B AND C (OR NONE, IF C'S 100
C BIT IS OFF).
C THE INDEX OF THE LAST NON-BLANK CHAR IN CHARS IS RETURNED IN LENG.
C
C HERE WE HAVE ABANDONED THE FORTRAN 66 VERSION AND WRITTEN A NEW VERSION
C USING THE STRING OPERATORS OF FORTRAN 77.
IMPLICIT INTEGER*4 (A-Z)
CHARACTER*4 WORDS(3)
LOGICAL PUN
CHARACTER CHARS * (*)
C
C PUN IS TRUE IF AND ONLY IF WE DO HAVE A PUNCTUATION CHARACTER IN C.
C
PUN=(C.AND.8#100).NE.8#100
WORDS(1)=A
WORDS(2)=B
WORDS(3)=C
CHARS=' '
K=1
LENG=1
INDX=0
DO 1 I=1,3
IF(I.EQ.3.AND..NOT.PUN) THEN
CHARS(K:K)=' '
K=K+1
LENG=LENG+1
INDX=INDX+1
ENDIF
IF(WORDS(I).NE.' ') THEN
CALL SHIFTC('LEFT',WORDS(I))
INDX=LCHAR(WORDS(I))+INDX
CHARS(K:INDX)=WORDS(I)
LENG=INDX
K=INDX+1
ENDIF
1 CONTINUE
RETURN
END