INPUT STREAM stream STREAM-HANDLE handle CLOSESTREAM streamSpecifies the name of a stream. If you do not name a stream, the AVM uses the unnamed stream. See the DEFINE STREAM statement reference entry and OpenEdge Development: Programming Interfaces for more information on streams.STREAM-HANDLE handleSpecifies the handle to a stream. If handle it is not a valid handle to a stream, the AVM generates a run-time error. Note that stream handles are not valid for the unnamed streams. See the chapter on alternate I/O sources in OpenEdge Development: Programming Interfaces for more information on streams and stream handles.Instead of getting input from the terminal, the following procedure gets input from a file named r-in.dat. The SEARCH function determines the full pathname of this file.
INPUT FROM VALUE(SEARCH("r-in.dat")).REPEAT:PROMPT-FOR Customer.CustNum Customer.CreditLimit.FIND Customer USING INPUT Customer.CustNum.ASSIGN Customer.CreditLimit.END.INPUT CLOSE.
Here is what the contents of the r-in.dat file looks like:
1 558002 413005 88000The PROMPT-FOR statement uses the first data item (1) as the CustNum and the second data item (55800) as the CreditLimit. The FIND statement finds the Customer whose CustNum is 1 and assigns the value of 55800 as that Customer’s credit limit. On the next iteration of the REPEAT block, the PROMPT-FOR statement uses the value of 2 as the CustNum the value of 41300 as the CreditLimit, etc.The INPUT CLOSE statement closes the input source, resetting it to the terminal. When you run this procedure, the data in the window is simply an echo of the data as the procedure is reading it in from the taxno.dat file. If you do not want to display the data, add the word NO-ECHO to the end of the INPUT FROM statement.
For more information on input sources, see OpenEdge Development: Programming Interfaces.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |