
- Rexx Tutorial
- Rexx - Home
- Rexx - Overview
- Rexx - Environment
- Rexx - Installation
- Rexx - Installation of Plugin-Ins
- Rexx - Basic Syntax
- Rexx - Datatypes
- Rexx - Variables
- Rexx - Operators
- Rexx - Arrays
- Rexx - Loops
- Rexx - Decision Making
- Rexx - Numbers
- Rexx - Strings
- Rexx - Functions
- Rexx - Stacks
- Rexx - File I/O
- Rexx - Functions For Files
- Rexx - Subroutines
- Rexx - Built-In Functions
- Rexx - System Commands
- Rexx - XML
- Rexx - Regina
- Rexx - Parsing
- Rexx - Signals
- Rexx - Debugging
- Rexx - Error Handling
- Rexx - Object Oriented
- Rexx - Portability
- Rexx - Extended Functions
- Rexx - Instructions
- Rexx - Implementations
- Rexx - Netrexx
- Rexx - Brexx
- Rexx - Databases
- Handheld & Embedded
- Rexx - Performance
- Rexx - Best Programming Practices
- Rexx - Graphical User Interface
- Rexx - Reginald
- Rexx - Web Programming
- Rexx Useful Resources
- Rexx - Quick Guide
- Rexx - Useful Resources
- Rexx - Discussion
Rexx - chars
This function returns either 1 or the number of characters left to read in the file itself. The filename is mentioned as a parameter to the function.
Syntax
chars(filename)
Parameters
filename − This is the name of the file for which the end of file needs to be determined.
Return Value
This function returns either 1 or the number of characters left to read in the file itself.
Example
/* Main program */ str = '' do j = 1 while chars(Example.txt) > 0 str = ' ' (charin(Example.txt)) call charout ,str end
The following things need to be noted about the above program −
First a string variable is assigned to a null value.
Then the ‘do loop’ is used to read each character at a time.
Each character is read and then sent to the console.
When we run above program we will get the following result.
Output
E x a m p l e 1 E x a m p l e 2 E x a m p l e 3
rexx_functions_for_files.htm
Advertisements