SUBROUTINE ICONV(NUMBER,STRING,LENGTH) C C 5-Nov-82 DVJensen C Subroutine to convert an integer to an ASCII character string C and return the string and the length of the string. A negative C sign ( - ) will prefix the string if the number is negative. C No blanks are added to the string. C INTEGER*2 NUMBER,LENGTH LOGICAL*1 STRING(LENGTH),LOCSTR(6),MINUS,ZERO DATA MINUS /'-'/, ZERO /'0'/ C LENGTH = 0 IWORK = NUMBER IF (NUMBER) 10,100,200 C Minus value number 10 IWORK = -NUMBER STRING(1) = MINUS LENGTH = 1 GOTO 200 100 CONTINUE C Zero value in number. STRING(1) = ZERO LENGTH = 1 RETURN C 200 I = 6 210 NEXT = IWORK/10 NDIGIT = IWORK - NEXT*10 LOCSTR(I) = NDIGIT + 48 IF (NEXT .EQ. 0) GOTO 300 IWORK = NEXT I = I-1 GOTO 210 C C Now move local work string into STRING. 300 DO 310 J=I,6 LENGTH = LENGTH + 1 310 STRING(LENGTH) = LOCSTR(J) RETURN END