Text Commands SECTION 6 Functions and Methods
89
With the text left aligned, and with a width field (for instance '%-6ld' to insert a
value left aligned with a field 6 characters wide).
References
More complex expressions (for instance controlling justification, decimal
places, number base, etc.) are also possible. Refer to any C language
reference book for full details of the format used by the 'sprintf' function.
6-12-5 GetTextLength
Syntax
value = GetTextLength (textpoint)
Remarks
Typical Example
textpoint = "Hello World"
count = GetTextLength (textpoint)
The number of characters in 'textpoint' is counted and the point 'count' is set to
the value 11.
6-12-6 Hex
Syntax
result = Hex (value)
Remarks
Typical Example
HStr = Hex (44)
In this example, 'Hstr' contains '2C'.
Note: The formatting characters are standard 'C' formatting characters (as used by
the C-language sprintf function). Some commonly used types are:
• %ld. Insert integer value;
• %f. Insert decimal value. Prefix with decimal point and number to control
position (for instance '%.2f' for 2 decimal places);
• %s. Insert string;
• %IX. Insert hexadecimal value (upper case HEX characters, for instance
'FFFF');
• %lx. Insert hexadecimal value (lower case HEX characters, for instance
'ffff');
• %c. Insert character (can be used to convert value to character, for
instance to insert control character).
Argument Type Description
textpoint text
point
This is the point which has its text length
counted.
returnpoint Integer /
real
This is the point that holds the return value.
Argument Type Description
Value Number to be converted to a Hex number.
Result String containing Hex representation of value.