project BLF > class Business Component > method EnQuote

function returns character

Description

Put single quotes around a string and make the necessary replacements inside the string


Parameters


icToQuoteinputcharacter


Internal usage


BLF
method business.ApiQueryFilterPrepare
method BCustomField.ApiExportCustomFields
method BStoredSearch.ApiExportCustomization
method BUDCConfiguration.apiExportCustomization
method BRole.ApiMaintainRolesForModuleURI

QadFinancials
method BMfgAccountDefaultMaster.LoadMfgData
method BMfgAcctSubCCProj.LoadMfgData
method BMfgAddress.LoadMfgData
method BMfgAddressListDetail.LoadMfgData
method BMfgGeneralizedCode.LoadMfgData
method BMfgCostCenter.LoadMfgData
method BMfgCountry.LoadMfgData
method BMfgCreditTerms.LoadMfgData
method BMfgCreditTermsDetail.LoadMfgData
method BMfgCurrency.LoadMfgData
method BMfgCustomer.LoadMfgData
method BMfgDaybook.LoadMfgData
method BMfgDomain.LoadMfgData
method BMfgEmployee.LoadMfgData
method BMfgEndUser.LoadMfgData
method BMfgEntity.LoadMfgData
method BMfgGLCalendar.LoadMfgData
method BMfgLanguage.LoadMfgData
method BMfgNRM.LoadMfgData
method BMfgPeriod.LoadMfgData
method BMfgProject.LoadMfgData
method BMfgRole.LoadMfgData
method BMfgRoundingMethod.LoadMfgData
method BMfgSubAccount.LoadMfgData
method BMfgSupplier.LoadMfgData
method BMfgSystemAccountControl.LoadMfgData
method BMfgUserDomainForUser.LoadMfgData
method BMfgUserDomainForUsrRole.LoadMfgData
method BMfgUserRole.LoadMfgData
method BMfgAccount.LoadMfgData


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).