Release 10.1A: OpenEdge Development:
Progress 4GL Reference

> ## INPUT CLOSE statement

> Closes the default input source or the stream you name.

> #### Syntax

>     INPUT [ STREAM stream ] CLOSE

> `STREAM `stream``

> Specifies the name of a stream. If you do not name a stream, Progress uses the unnamed stream. See the DEFINE STREAM statement reference entry and OpenEdge Development: Programming Interfaces for more information on streams.

> Example

> 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.

> r-in.p
>     INPUT FROM VALUE(SEARCH("r-in.dat")).

>     REPEAT:
>         PROMPT-FOR cust.cust-num credit-limit.
>         FIND customer USING INPUT cust-num.
>         ASSIGN credit-limit.
>     END.

>     INPUT CLOSE.

> Here is what the contents of the `r-in.dat` file looks like:

>     1 55800
>     2 41300
>     5 88000

> The PROMPT-FOR statement uses the first data item (1) as the cust-num and the second data item (55800) as the credit-limit. The FIND statement finds the customer whose cust-num 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 cust-num, the value of 41300 as the credit-limit, 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.

> #### Notes

> - The default input source is the terminal unless the procedure was called by another procedure. In that case, the default input source is the one that was active in the calling procedure when the second procedure was called.

> - When a procedure ends, Progress closes all input sources established in that procedure.

> - For more information on input sources, see OpenEdge Development: Programming Interfaces .

> #### See also

> DEFINE STREAM statement, INPUT FROM statement

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095