Replacing backslashes
Sometimes AR System tables get their qualifications externally, which mean the EXT AR function is used inside the table qualification. In this case, a BackChannel CompileExternalQualification request occurs before GetTableEntryList is called.
Usually, you do not need to parse the CompileExternalQualification response. However, if a table qualification contains user-specific values, you must parse the response for GetTableEntryList. In this case, backslash ( \ ) escape characters can cause problems.
A CompileExternalQualification response should contain a formatted qualification string that BMC Remedy Mid Tier uses. This string already contains escape characters, but if you send the string as it is with GetTableListEntry, SilkPerformer encodes the escape characters again.
To fix the duplication, replace the double backslashes with a single backslash as follows:
function replaceBackSlash(inStr : string(10000)) : string
var
n, i, endPos : number;
nSlashPairCount : number;
aStrArray : array[300] of string(75);
tmpStr : string;
sResult : string;
begin
sResult := "";
n := StrSearch(inStr, "\\\\", STR SEARCH FIRST);
while n <> 0 do
n := StrSearch(inStr, "\\\\", STR SEARCH NEXT);
nSlashPairCount := nSlashPairCount + 1;
end;
// parse:
1\\1\\4\\1\\1\\302792000\\2\\6\\1000\\4\\1\\1\\160\\2\\1\\21\\4\\1\\2\\2\\1\\2\\2\\1\\
if nSlashPairCount >= 1 then
i := 1;
endPos := StrSearch(inStr,"\\", STR SEARCH FIRST);
SubStr(inStr, aStrArray\[i\],1, endPos-1);
i := 2;
end;
if nSlashPairCount >= 2 then
StrSearchDelimited(aStrArray[i], STRING_COMPLETE, inStr, "\\\\", 1, "\\\\", 1,
STR SEARCH FIRST | STR SEARCH IGNORE WHITESPACES);
end;
for i:= 3 to nSlashPairCount do
StrSearchDelimited(aStrArray[i], STRING COMPLETE, inStr, "\\\\", 1, "\\\\", 1,
STR SEARCH NEXT | STR SEARCH IGNORE WHITESPACES);
end;
// now reassemble string with new delimiters
for i:=1 to nSlashPairCount do
sResult := sResult + aStrArray [i] + "\\";
end;
replaceBackSlash := sResult;
end replaceBackSlash;