Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

The CALCTEXT COLLATE message is used to calculate the width and height of a text string. The current font information, line spacing, and page size is used to calculate the height and width of the text. Use the Get_Printer CALCTEXT message to retrieve the width and height of the text after setting the text with the CALCTEXT messageset the collate property for the current report. Always check the return code from the COLLATE message for errors, because not all printers support this feature.

Parameters

ParameterDescription of FieldsCommentsDefault
Parm1 - TextCOLLATE<1> TextText to calculate width and heightCollage0 = No collate
1 = Collate
0""

Example

Code Block
*  The following example shows how to use the CALCTEXTCOLLATE message.
declare function Set_Printer
stat = Set_Printer("INIT")  ;* Start printing
stat = Set_Printer("CALCTEXTCOLLATE", "This is a test. ")
size = Get_Printer("CALCTEXT") 1) ;* getcollate the sizeoutput
textWidthif =stat size<1> ;*< width of the text
textHeight = size<2> 0 then
goto ErrorHandler ;* height of the textnot supported
end
stat = Set_Printer("TERM")  ;* End printing