previous next top complete contents complete index framed top this page unframed
Figure 35–12. fldWrite (GENERIC)
| PROCEDURE fldWrite (POINTER(textFile) dst; STRING s; INTEGER w,fillChar); PROCEDURE fldWrite (POINTER(dataFile) dst; STRING s; INTEGER w,fillChar); PROCEDURE fldWrite (MODIFIES STRING dst; STRING s; INTEGER w,fillChar; OPTIONAL POINTER($area) area); |
fldWrite writes a STRING of the specified width w to a file or STRING destination dst. The STRING written is composed of s and enough fill characters to make the length of the STRING written equal to w. The character code of the fill character is given by fillChar.
Normally, fill characters are put before s, so that when fldWrite is used to produce columns, the right margin of the column is aligned. For example, a fillChar of ' ' results in s right-justified in a field of blanks.
Use the negative of the desired fill character to have fill characters written after s.
If s exceeds the field width w, a STRING consisting of w asterisks (the * character) is written.
In the STRING form, area specifies the destination area for the resulting STRING if new STRING text is generated; see Section 29.4. In the file forms, if the file is opened for PDF I/O, the characters may be translated from the host to the PDF character set.
Characters in a data file are stored as described in Sections 32.66 and 32.97.
$dup may be used to create a STRING by concatenating a given STRING several times; see Section 33.41.
Example 35–13. Use of fldWrite
| If s = "ABCDEF", then:
fldWrite(f,s,10,' ') writes “ ABCDEF” to f.
fldWrite(f,s,12,- '.') writes “ABCDEF......” to f. |
MAINSAIL Language Manual, Section 35.12