Rexx - charin
This function is used to read one character at a time from a file. Sometimes programs require to read files character wise and hence this function can be used for this purpose.
Syntax
charin(filename)
Parameters
filename − This is the name of the file from which the character needs to be read from.
Return Value
A character read from the file.
Example
/* Main program */ chr = charin(Example.txt) say chr chr = charin(Example.txt) say chr chr = charin(Example.txt) say chr
When we run the above program, we will get the following result.
Output
E x a
rexx_functions_for_files.htm
Advertisements