S
Stefan Marquardt
Guest
Laura, very seriously: If you would try it on your own then you will notice that there isn't any error except EOF. I created a special test file with one line with LF/CR (because win) at the end and used this code: define variable LocRetText as character no-undo. input from value("C:\temp\OneLine.txt"). repeat on error undo, retry: if retry then do: message "oops" view-as alert-box. leave. end. message "read line" view-as alert-box. import unformatted LocRetText no-error. message LocRetText error-status:error error-status:num-messages view-as alert-box. end. input close. message "done" error-status:error error-status:num-messages view-as alert-box. Result: read Line A line for Laura 0 no read line done yes 0 In summary: import unformatted LocRetText no-error seems to set error-status where isn't any because there is no "oops" message without no-error. When I remove no-error, it works as expected: read line A line for Laura no 0 read line done no 0 Please don't tell me that I could simple remove no-error, that isn't the point. In general in the whole 15 years with OE 4GL I missing a "REPEAT UNTIL EOF INPUT" This would be a smoother option instead ENDKEY emulation for EOF that seems not to work in a correct way. A perfect workaround could be that: file-info:file-name = "C:\temp\OneLine.txt". define variable LocRetText as character no-undo. input from value(file-info:file-name). repeat on error undo, retry: if retry then do: message "oops" view-as alert-box. leave. end. if seek(input) = file-info:file-size then leave. import unformatted LocRetText no-error. end. input close. message "done" error-status:error error-status:num-messages view-as alert-box. Result: done no 0 I am going to open a ticket because it's a bug and it looks like I am not alone with my opinion. Thank you all for your remarks. Stefan
Continue reading...
Continue reading...