- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Need Help with "Read" statement
I can't seem to read buffer into IVAL
Trying to read buffer into array as follows:
The buffer(100) array contains the following, followed by 'crlf' '0,,,-12075,-85,0,102,-10272,1235'
IN_LEN = 8
---code:---
DO I = 1,100
IF(BUFFER(I:I).EQ.',') THEN
BUFFER(I:I) = ' '
IF(BUFFER(I+1:I+1) .EQ. ',') THEN
BUFFER(I+1:I+1) = '0' ! add 0
ENDIF
ENDIF
IF(BUFFER(I:I).EQ.';') BUFFER(I:I) = ' '
IF(BUFFER(I:I).EQ.CHAR(10)) BUFFER(I:I) = ' '
IF(BUFFER(I:I).EQ.CHAR(13)) THEN
BUFFER(I:I) = ' '
ICNT = I
ENDIF
ENDDO
DO I = ICNT, 100
BUFFER(I:I) = ' ' ! space to end of buffer
ENDDO
CONTINUE
READ(BUFFER,'(I1,I6)'),CODE,(IVAL(I), I=1,IN_LEN)
DO I = 1, IN_LEN
VAL(I) = FLOAT(IVAL(I))/1000.0
ENDDO
---end code:---
Any help will be helpful
james.montgomery2@lmco.com
Jim Monty
I can't seem to read buffer into IVAL
Trying to read buffer into array as follows:
The buffer(100) array contains the following, followed by 'crlf' '0,,,-12075,-85,0,102,-10272,1235'
IN_LEN = 8
---code:---
DO I = 1,100
IF(BUFFER(I:I).EQ.',') THEN
BUFFER(I:I) = ' '
IF(BUFFER(I+1:I+1) .EQ. ',') THEN
BUFFER(I+1:I+1) = '0' ! add 0
ENDIF
ENDIF
IF(BUFFER(I:I).EQ.';') BUFFER(I:I) = ' '
IF(BUFFER(I:I).EQ.CHAR(10)) BUFFER(I:I) = ' '
IF(BUFFER(I:I).EQ.CHAR(13)) THEN
BUFFER(I:I) = ' '
ICNT = I
ENDIF
ENDDO
DO I = ICNT, 100
BUFFER(I:I) = ' ' ! space to end of buffer
ENDDO
CONTINUE
READ(BUFFER,'(I1,
DO I = 1, IN_LEN
VAL(I) = FLOAT(IVAL(I))/1000.0
ENDDO
---end code:---
Any help will be helpful
james.montgomery2@lmco.com
Jim Monty
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page