2025-12-09 06:55 PM
Read a lines with Text IO
Input will never be -1 -> infinite loop , no End of file
Part of the script below
aii = OPEN ("TEXT",i_pathnew,"SEPARATOR = '\n',MODE = RO,NEWLINE = LF,FULLPATH")
REPEAT
IF y # -1 THEN ! BUG will never be -1 , no EOF
y = INPUT (aii,i,1,a_impb[j][1]) : i=i+1
y = INPUT (aii,i,1,a_impb[j][2]) : i=i+1
y = INPUT (aii,i,1,a_impb[j][3]) : i=i+1
ENDIF
j = j+1
IF i > 40000 THEN
PRINT "error no EOF"
END
ENDIF
UNTIL y = -1 ! ( OR i > 20000) quickfix to limit
4 weeks ago - last edited 4 weeks ago
Well there seems to be more that doesn't work with the text I/O
and it might be related:
IT finds and reads the file once it seems.
But still throws an error "can't find file" for every view I guess: sections / elevations...
My guess is closing the channel doesn't work?
Maybe i should not have everything in master or try to prevent executing/opening the chanel that often somehow.
But still there is something wrong.
This is on AC 27
a week ago
Hi rudl,
One issue might be, that you could read past the EOF since you read 3 times before checking if y = -1.
But that's just a quick observation. Haven't tested it.
Best regards,
Bernd
a week ago
Try to use the WHILE .. DO.. ENDWHILE instead of REPEAT, because WHILE checks the condition before it runs through the loop, REPEAT checks it after.
I always used the examples in the GDL Cookbook 3 as a template for my own routines and never had the issues you described.