PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: Quoted()[Next]: RandomString()
\ -> Rexx -> Inbuilt PPWIZARD Functions -> QuoteIt()


This is an inbuilt function function provided by PPWIZARD.

This function will examine the string you supply and determine a quote character which could safely be used to quote it (that is the string does not contain it). By default only the quote character is returned. Processing will abort if a quote character can't be determined.

The function requires at least the first parameter as follows:

  1. The string that you wish to quote.

  2. An optional list of all possible quote characters. If not supplied it defaults to trying double then single quotes. If you pass "ANY" then a default (long) list of characters is used.

  3. An optional parameter to indicate whether or not you wish the quoted value returned (by default it is not). Pass "Y" to have the quoted string returned rather than just the quote character. If you use this parameter you should use the newer Quoted() routine.

This routine is handy when a macro is passed some information and needs to generate the data in a quoted format. Some languages such as HTML allow information to be quoted with either a single or a double quote.

Stupid Examples

#evaluate     ''  ~RxQuote=QuoteIt('AS"DF')~
Should be double = <??RxQuote>
#evaluate     ''  ~RxQuote=QuoteIt("AS'DF")~
Should be single = <??RxQuote>
#evaluate     ''  ~RxContainsBothQuotes = 'AS"' || "'DF"~
#evaluate     ''  ~RxQuote=QuoteIt(RxContainsBothQuotes, '"' || "'^")~
Should be '^'    = <??RxQuote>
#evaluate     ''  ~RxQuote=QuoteIt(RxContainsBothQuotes)~   ;;Will die

email me  any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Search][Prev]: Quoted()[Next]: RandomString()

My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Saturday May 28 2022 at 2:55pm