previous next top contents index framed top this page unframed
Figure 32–111. cWrite (GENERIC)
| PROCEDURE cWrite (MODIFIES STRING s; REPEATABLE INTEGER char); PROCEDURE cWrite (POINTER(textFile) f; REPEATABLE INTEGER char); $BUILTIN PROCEDURE cWrite (MODIFIES CHARADR c; REPEATABLE INTEGER char); PROCEDURE cWrite (MODIFIES STRING s; POINTER($area) area; REPEATABLE INTEGER char); PROCEDURE cWrite (POINTER(dataFile) f; REPEATABLE INTEGER char); |
cWrite writes a character to a file, a STRING, or a CHARADR.
The file forms put a character into the current character position in an output file f and update the current position to be the next position in the file. In the case of a data file, characters are stored one per character unit, as in a text file. If the file is opened for PDF I/O, the character may be translated to the PDF character set.
The STRING forms append the character to the end of s. In the area form, area specifies the destination area for the resulting STRING if new STRING text is generated; see Section 29.4.
Example 32–112. Use of the File and STRING Forms of cWrite
cWrite(f,'a',' ',98) has the same effect as write(f,"a b") if the character set is ASCII, since 98 is ASCII for b. Note that portable programs cannot assume the ASCII character set.
cWrite(s,'a',' ',98) has the same effect as s .& "a b" if the character set is ASCII. |
The CHARADR form puts the character with code char into the character location given by its CHARADR argument. The CHARADR is then positioned to the next character location. The effect is undefined if the CHARADR is NULLCHARADR. Example 32–113 writes the character b to the character location c.
MAINSAIL Language Manual, Section 32.97