Question How To Do Nested Input From Statement

Ferry Huang

New Member
hi friends ...
how can i use nested INPUT FROM statement without effecting first INPUT FROM statement.
for example see code below:

Code:
INPUT FROM VALUE("one.txt").

DO WHILE TRUE ON ENDKEY UNDO, LEAVE ON ERROR UNDO, LEAVE:

     IMPORT UNFORMATTED vRecord.

     MESSAGE vRecord.

     PAUSE.

     INPUT FROM VALUE ("two.txt").

     IMPORT UNFORMATTED vRecord.

     MESSAGE vRecord.

     PAUSE.

     INPUT CLOSE.

END.

INPUT CLOSE.

let say one.txt file contents as below:
1
2
3

and two.txt contents as below:
one
two
three

how to produce output like below:
1
one
2
one
3
one
 
Last edited:
You have two options:
1) use named streams.
define stream input1.
input stream input1 from... etc
2) If the files aren't too big then define a longchar
copy-lob file xyz to object mylongchar.
then just go through it like you would any char variable.
 
Back
Top