Rexx - charout



This function is used to write one character at a time to a file. The filename is entered as a parameter to the function.

Syntax

charout(filename) 

Parameters

  • filename − This is the name to which the character needs to be written to.

Return Value

This function returns 0 if all characters were successfully written to the file. If the function fails, then it returns the number of characters that failed to write to the file.

Example

/* Main program */ 
status = charout(Example.txt,E) 
status = charout(Example.txt,x) 
status = charout(Example.txt,a) 

When we run the above program, the characters ‘E’, ‘X’ and ‘a’ will be added to the file Example.txt.

rexx_functions_for_files.htm
Advertisements