Guardian Programmer's Guide

Table Of Contents
Formatting and Manipulating Character Data
Guardian Programmer’s Guide 421922-014
19 - 20
!------------------------------------------------------------
! Procedure to write a line on the terminal.
!------------------------------------------------------------
PROC WRITE^LINE (BUF, LEN);
STRING .BUF;
INT LEN;
BEGIN
CALL WRITEX(TERM^NUM,BUF,LEN);
IF <> THEN CALL PROCESS_STOP_;
END;
!------------------------------------------------------------
! Procedure to display formatted data on the terminal.
!------------------------------------------------------------
PROC DISPLAY^MONTH;
BEGIN
! Literals and variables used by FORMATCONVERT:
LITERAL EFORMATMAXLEN = 256; !max length of external
! edit descriptors
STRING .EFORMAT[0:EFORMATMAXLEN - 1]; !array for external
! edit descriptors
INT EFORMATLEN; !length of external
! edit descriptor
! string
LITERAL IFORMATLEN = 512; !max length of internal
! edit descriptors
INT .WFORMAT[0:IFORMATLEN/2]; !word array for edit
! descriptors passed to
! FORMATDATA
STRING .IFORMAT := @WFORMAT '<<' 1;!string array for
! edit descriptors
! created by
! FORMATCONVERT
INT SCALES, !scale factor for
! decimal point
SCALE^COUNT, !number of scales
! arrays
CONVERSION; !type of conversion