Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (M)
Guardian Procedure Calls Reference Manual522629-013
9-7
MBCS_CHAR_ Procedure
THEN -- found valid MBCS character
BEGIN -- process and advance pointer
... user-required MBCS character processing here ...
@testmbcschar := @testmbcschar +
$dbl(charsize.<8:15>);
END -- process and advance pointer
ELSE -- found a 1-byte character
BEGIN -- process and advance pointer
... user-required 1-byte character processing here ...
@testmbcschar := @testmbcschar + 1d;
END; -- process and advance pointer
END; -- text string loop
When calling the MBCS_CHAR_ procedure, you must prevent attempts to read
out-of-bounds data. In the preceding example, the amount of remaining buffer
space (number of bytes) is conveyed by the
charinfo parameter on the call;
MBCS_CHAR_ does not attempt to access data beyond this buffer. When this
parameter is omitted, the MBCS_CHAR_ procedure operates upon the assumption
that enough bytes may be read to compose one character of the current MBCS.
The caller assumes responsibility for the accuracy of this assumption.
Related Programming Manual
For programming information about the MBCS_CHAR_ procedure, refer to the
Guardian Programmer’s Guide.