Close_Input
See Also: File I/O Commands, Close_Output, Direct_Input, Channel Command Component, Sequential File I/O
Purpose
To close a sequential input file.
Syntax
Close_Input [Channel {channel-no}]
If {channel-no} is not specified, channel 0 will be assumed.
What It Does
Close_Input closes files opened for input by the Direct_Input command.
Example
Here is a small procedure that reads a sequential file (hello.txt) to the end of the file. It uses Close_Input to close the text file.
Procedure OnClick
String sBuffer
Direct_Input "hello.txt"
Showln "Contents of Hello.Txt"
While (Not (Seqeof))
// Read from the text file.
Readln sBuffer
Showln sBuffer
Loop
Close_Input
// Close the sequential input file, hello.txt
End_Procedure
Notes
-
Sequential input files are closed when a new sequential file is opened on the same channel. Sequential files are also closed when a program issues the
Abortcommand. Sequential files may also be closed during program chaining if theSeq_Exportoption is not set. -
The Runprogram (without the Wait) option also closes sequential input files.