Libraries |
|
Lower case filter | Source Code |
|
|
lowerFile
const type: lowerFile
-
File implementation type which turns characters to lower case. All data that is written to a lowerFile is converted to lower case and forwarded to the destFile. All functions that read from lowerFile read from destFile instead and deliver the data after converting it to lower case.
Function Summary | |||||
file |
| ||||
void |
| ||||
void |
| ||||
void |
| ||||
string |
|
Function Detail |
openLower
const func file: openLower (in file: destFile)
-
Open a filter file which turns characters to lower case. All data that is written to a lowerFile is converted to lower case and forwarded to the destFile. E.g.:
lowerOutput := openLower(OUT); repeat write("Enter sentence: "); flush(OUT); readln(sentence); writeln(lowerOutput, sentence); until sentence = "";
All functions that read from lowerFile read from destFile instead and deliver the data after converting it to lower case. This can be used to allow upper and lower case commands:
KEYBOARD := openLower(KEYBOARD); repeat write("command: "); flush(OUT); command := getc(KEYBOARD); writeln; ... until command = 'q';
- Parameters:
- destFile - File to which data is written or from which data is read.
- Returns:
- the lowerFile opened.
write
const proc: write (inout lowerFile: outFile, in string: stri)
-
Write the string stri to outFile. The characters are converted to lower case, before they are written.
writeln
const proc: writeln (inout lowerFile: outFile, in string: stri)
-
Write a string followed by end-of-line to outFile. The characters are converted to lower case, before they are written.
gets
const func string: gets (inout lowerFile: inFile, in integer: maxLength)
-
Read a string with a maximum length from a file. The characters read are converted to lower case.
- Returns:
- the string read and converted to lower case.
- Raises:
- RANGE_ERROR - The parameter maxLength is negative.
|
|