Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : GENBIN

GENBIN
Returns a syntax V string containing the same internal binary value as the input numeric value, right-justified.(F)
Invocation
string = GENBIN(value, length)
 
Usage
Examples
The following rule uses GENBIN to create strings of unprintable bytes:

 
RULE EDITOR ===> SCROLL: P
A(V,L);
_ LOCAL STR;
_ -------------------------------------------------------------------------------
_ ----------------------------------------------------------------+--------------
_ STR = GENBIN(V,L); | 1
_ CALL ENDMSG(STR || '; LENGTH OF STRING=' || LENGTH(STR)); | 2
_ -------------------------------------------------------------------------------

 
A(210,5) results in a 5‑byte STR buffer, the first 4 bytes are 0, the fifth byte is 210. When STR appears in the message log, unprintable text displays either as blanks, or assorted symbols. In this instance, STR displays in the message log as “    K” (210 is EBCDIC code for the printable character K).
A(0,8) results in an 8-byte STR buffer, the eight bytes are 0 and display in the message log as blanks.
The following rule uses GENBIN(0,1) to create 1-byte of null to be used in PEEL for peeling:

 
RULE EDITOR ===> SCROLL: P
PEELBLANKANDNULL(MYSTRING);
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ PEEL(' ' || GENBIN(0, 1), MYSTRING); | 1
_ ---------------------------------------------------------------------------

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved