function returns character
Description
Put single quotes around a string and make the necessary replacements inside the string
Parameters
Internal usage
BLF
QadFinancials
program code (program1/business.p)
if icToQuote = ?
or icToQuote = "?"
then return "?".
/* ================================================================= */
/* Replace one single quote with two single quote. */
/* ================================================================= */
if index(icToQuote,chr(39)) = 0
then vcWorkString = icToQuote.
else vcWorkString = replace(icToQuote,chr(39),chr(39) + chr(39)).
/* ================================================================= */
/* Replace one tilde with two tilde. */
/* ================================================================= */
if index(icToQuote,chr(126)) > 0
then vcWorkString = replace(vcWorkString,chr(126),chr(126) + chr(126)).
/* ================================================================= */
/* Replace curly brace with tilde plus curly brace. */
/* ================================================================= */
if index(icToQuote,chr(123)) > 0
then vcWorkString = replace(vcWorkString,chr(123),chr(126) + chr(123)).
/* ================================================================= */
/* Replace backslash with tilde + backslash. (unix only) */
/* ================================================================= */
if opsys = "UNIX":U
then if index(icToQuote,chr(92)) > 0
then vcWorkString = replace(vcWorkString,chr(92),chr(126) + chr(92)).
return chr(39) + vcWorkString + chr(39).