SiebelTokenHtmlSingleQuote Function

Action

Extract single tokens from value arrays as used by Siebel 7 Web applications in HTML responses.

Include file

Siebel7Web.bdh

Syntax

SiebelTokenHtmlSingleQuote( inout sValueArray : string,
                            in    nTokenIndex : number) : string;

Return value

Returns the nTokenIndex-th token in the value array. Token indizes are 0-based.

Parameter Description
sValueArray Value array, usually parsed from a server response.
nTokenIndex The token index (0-based)

sValueArray must be a sequences of strings (tokens) enclosed in single quotes ('). Any sequence of characters may appear before the first token, after the last token and between tokens. Such extra content is skipped by these functions.

Example

transaction TTokenHtml
  var
    sValArrayHtml   : string;
    sValArrayHtmlSQ : string;
    i               : number;
    sToken          : string;
  begin
    sValArrayHtml   := "var row = [\"Foo\",\"\",\"Bar\",\"USD\",\n"
                       "// this is a javascript comment\n"
                       " \"05/23/2003\",\"N\",\"1-T8T\"];";
    sValArrayHtmlSQ := "var row = ['Foo','','Bar','USD',\n"
                       "// this is a javascript comment\n"
                       "  '05/23/2003','N','1-T8T'];";
    Writeln("-- Output of SiebelTokenHtml --");
    for i := 0 to 6 do
      sToken := SiebelTokenHtml(sValArrayHtml, i);
      Writeln("Token #" + string(i) + " = <" + sToken + ">");
    end;
    Writeln("-- Output of SiebelTokenHtmlSingleQuote --");
    for i := 0 to 6 do
      sToken := SiebelTokenHtmlSingleQuote(sValArrayHtmlSQ, i);
      Writeln("Token #" + string(i) + " = <" + sToken + ">");
    end;
end TTokenHtml;

Output

-- Output of SiebelTokenHtml --
Token #0 = <Foo>
Token #1 = <>
Token #2 = <Bar>
Token #3 = <USD>
Token #4 = <05/23/2003>
Token #5 = <N>
Token #6 = <1-T8T>
-- Output of SiebelTokenHtmlSingleQuote --
Token #0 = <Foo>
Token #1 = <>
Token #2 = <Bar>
Token #3 = <USD>
Token #4 = <05/23/2003>
Token #5 = <N>
Token #6 = <1-T8T>