SiebelTokenApplet Function

Action

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

Include file

Siebel7Web.bdh

Syntax

SiebelTokenApplet( 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 is a sequence of length prefixed strings with no leading, trailing or intermittent characters allowed. Each length prefixed strings consists of:

  1. the length of the actual value, in decimal ASCII

  2. an asterisk (*)

  3. the actual value

Example

transaction TTokenApplet
  var
    sValArray : string;
    i         : number;
    sToken    : string;
  begin
    sValArray := "3*Foo0*3*Bar3*USD10*05/23/20031*N5*1-T8T";
    Writeln("-- Output of SiebelTokenApplet --");
    for i := 0 to 6 do
      sToken := SiebelTokenApplet(sValArray, i);
      Writeln("Token #" + string(i) + " = <" + sToken + ">");
    end;
  end TTokenApplet;

Output

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