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


Chapter 3 Tools : HEADSTRING

HEADSTRING
Returns the head portion of the specified string. (F)
Invocation
head = HEADSTRING(string, length)
 
The string from which to return the head portion. Its syntax can be C (fixed-length character string), UN (Unicode), V (variable-length character string), or W (double-byte character).
Usage Notes
string is not modified.
If length is less than or equal to 0, an empty string is returned.
If length is greater than the length of string, the entire string is returned.
Example
The following rule determines the first character of a string and prints both the character and the string to the message log:

 
HEADSTRING_1;
_ LOCAL SOURCE_STRING, HEAD_STRING;
_ ------------------------------------------------------------------------
_ ------------------------------------------------------------+-----------
_ SOURCE_STRING = 'THIS IS THE SOURCE STRING.'; | 1
_ HEAD_STRING = HEADSTRING(SOURCE_STRING, 1); | 2
_ CALL MSGLOG('THE HEAD STRING IS: ' || HEAD_STRING); | 3
_ CALL MSGLOG('THE SOURCE STRING IS STILL: ' || | 4
_ SOURCE_STRING); |
_ ------------------------------------------------------------------------

 
Output for the HEADSTRING_1 Rule
Pressing PF2 after executing this rule displays the following screen:

 
----------------------- INFORMATIONAL MESSAGE LOG ---------------------
COMMAND ===> SCROLL ===> P
THE HEAD STRING IS: T
THE SOURCE STRING IS STILL: THIS IS THE SOURCE STRING.

 

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