PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
![]() | ![]() | ![]() | ![]() | ![]() |
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:
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