var sName1:string = 'DATA'; sName2:string = 'RESULT'; data: string; res: double;begin// checks that a variable is stored beforeif IsVariableStored(sName1) then // retrieves a stored variable data := PopVariable(sName1)else data := ''; // calculate your result here.... // adds or changes a variable in a data packet SetVariable(sName2, res); // stores a value between script executions (if necessary) PushVariable(sName2, res);end.
var sName1:string = 'DATA'; sName2:string = 'RESULT'; data: string; dist: string; i: integer; res: double;begin...
varsname1:string = 'DATA_PACKET'; //the name of the parser itemdata:string;dist:array[1..141] of word;i,j: integer;begin // get data from the parser item data := GetVariable(sname1); // try to create an integer array i := 1; j := 1; while (i<length(data))and(j<=141) do begin dist[j] := ord(data[i])+$100*ord(data[i+1]); //SetVariable('VAL'+IntToStr(j), dist[j]); // export value j := j + 1; i := i + 2; end;//continue calculating ...end.
StrtoInt(Copy(data,2*i-1,2));