See Also: File I/O Commands, Close_Output, Direct_Input, Channel command component, Sequential File I/O
To close a sequential input file.
Close_Input [Channel {channel-no}]
If {channel-no} is not specified, channel 0 will be assumed.
Close_Input closes files opened for input by the Direct_Input command.
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
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 Abort command. Sequential files may also be closed during program chaining, if the Seq_Export option is not set.
Runprogram (without the Wait) option also closes sequential input files.