Try OpenEdge Now
skip to main content
ABL Reference
ABL Syntax Reference : INPUT-OUTPUT CLOSE statement
 

INPUT-OUTPUT CLOSE statement

Closes a specified or default stream opened by an INPUT-OUTPUT THROUGH statement.

Syntax

INPUT-OUTPUT [ STREAM stream | STREAM-HANDLE handle ] CLOSE
STREAM stream
The name of the stream you want to close. If you do not name a stream, the AVM closes the default stream used by an INPUT-OUTPUT THROUGH statement.
STREAM-HANDLE handle
The handle to the stream you want to close. If you do not specify the handle, the AVM closes the default stream used by an INPUT-OUTPUT THROUGH statement.

Example

This procedure uses a C program to recalculate the price of each item in inventory. Specifically, the C program increases the price of each item by 3% or by 50 cents, whichever is greater. The INPUT-OUTPUT THROUGH statement tells the procedure to get its input from, and send its output to, the r-iothru.p procedure. The INPUT-OUTPUT CLOSE statement resets the input source to the terminal and the output destination to the terminal.
r-iothru.p
FOR EACH Item NO-LOCK WHERE Item.ItemNum < 10:
  DISPLAY Item.ItemNum Item.Price LABEL "Price before recalculation".
END.

INPUT-OUTPUT THROUGH r-iothru UNBUFFERED.

FOR EACH Item WHERE Item.ItemNum < 10:
  EXPORT Item.Price.
  SET Item.Price.
END.

INPUT-OUTPUT CLOSE.

FOR EACH Item WHERE Item.ItemNum < 10 WITH COLUMN 40:
  DISPLAY Item.ItemNum Item.Price LABEL "Price after recalculation".
END.

Note

For more information, see OpenEdge Development: Programming Interfaces.

See also

DEFINE STREAM statement, INPUT-OUTPUT THROUGH statement, Stream object handle