Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 34
Handling Padding Characters
CALL OPEN^FILE(COMMON^FCB,
DFILE,
!block^buffer!,
!block^bufferlen!,
WRITE^PAD,
WRITE^PAD);
.
.
WRITE^BUFFER ':=' "This is a record" -> @S^PTR;
CALL WRITE^FILE(DFILE,
WRITE^BUFFER,
@S^PTR '-' @SWRITE^BUFFER);
Trimming Trailing Blanks on Reading
By default, trailing blanks are trimmed from records after reading. You can turn this
feature on or off using the READ^TRIM flag with the OPEN^FILE procedure or the
SET^FILE SET^READ^TRIM operation. When read-trailing-blank-trimming is turned
on and the READ^FILE procedure reads a record with trailing blanks, the entire record
is read into the read buffer, including the blanks. However, the count of bytes read
returned by the READ^FILE procedure counts only those characters that precede the
first of the trailing blanks.
If read-trailing-blank-trimming is turned off, the count of bytes read indicates the length
of the entire record.
The following statement uses the OPEN^FILE procedure to turn off read-trailing-blank-
trimming:
CALL OPEN^FILE(COMMON^FCB,
DFILE,
!block^buffer!,
!block^bufferlen!,
!flags parameter!,
READ^TRIM);
VST072.VSD