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


Chapter 3 Tools : QUOTE

QUOTE
Returns a string with single quotation marks around it and doubles any single quotation marks in the string. (F)
Invocation
quoted = QUOTE(string)
 
Single quotation marks in string are changed to two single quotation marks.
Example
The following rule adds quotation marks to a string that is passed to MESSAGE. The quotation marks are needed for the third argument because MESSAGE uses TOKEN to separate the tokens in this argument. Each token is used to substitute for a percent sign (%) in the message in the MESSAGES table. Message number 2 in the TABLE table instance is: At %.
By putting quotation marks around the string, it becomes a quoted string. TOKEN treats a quoted string as one token, and so the entire string substitutes for the percent sign.

 
DISPLAY_MSG2(TABLENAME);
_ LOCAL TEXTSTRING;
_ ---------------------------------------------------------------------
_ ------------------------------------------------------------+--------
_ TEXTSTRING = 'the TOP of table "' || TABLENAME || '"'; | 1
_ RETURN(MESSAGE('TABLE', 2, QUOTE(TEXTSTRING))); | 2
_ ---------------------------------------------------------------------

 
If the table name passed to DISPLAY_MSG2 is EMPLOYEE, the message that is returned is:
At the TOP of table "EMPLOYEE".

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