"Trak\" ofbin empty { dup !Sim.Prev %%% make sure the next record to search is an outgoing one "????????_??????_" &_Sim.Sid &"_to_" textwild _wilder ^3 File.NextOf isnull ? empty !Cmd.Command % % next command output body file % dup ^3 read % % stack: path seed seed-content % dup !Sim.Data execstr dup "_" 0 2 1 parse ^"_" & ^"_" !Cmd.Time _Cmd.Time &"_" ^"LOC" &_Sim.Sid ^_Sim.Net text !Sim.Dest %%% detect either type of record in or out "????????_??????_" &_Sim.Sid &"_??_*.txt" !wildes _Sim.Dest exists { %%% this LOC record already exists %%% delete the outgoing location command %%% and any receptions following it dup !Sim.Now "ex del out " log() dup ^3 del { %%% cycling through following records of already existing LOC _wilder ^3 File.NextOf isnull { %%% there is no next record, in or out true } { %%% there is a next record, in or out "_to_" second Str.Found positive { %%% this is an outgoing record, reinstate deleted seed pop _Sim.Now true } { %%% this is an incoming record, remove it "ex del in " log() dup ^3 del false } ifelse } ifelse ? } loop %%% the entries in or out producing the existing LOC are gone } { %%% this is a possible new LOC record _Cmd.Command "smslink" within? pop2nd { %%% this is an outgoing location request %%% gather received records from outgoing location command dup !Sim.Now 0 !counter empty !sumr { %%% only stop if there is no next record in or out _wildes ^3 File.NextOf isnull { %%% no next record true } { %%% there is a next record in or out, make sure it is a receive "_fr_" second Str.Found positive { %%% this is a receive record empty !Cmd.Command dup ^3 read execstr _Cmd.Command dup !Sim.Data ^_sumr !sumr +:counter %%% keep trying for more records false } { %%% this is not a received record pop _Sim.Now true } ifelse } ifelse ? } loop %%% there has to be a minimum 2 records, max 4 records _counter 4 le _counter 1 ge and { %%% valid number of records summated %%% check that an http record exists within the collected data "http" _sumr Str.Found positive { %%% this has the proper entry to be considered parseable *trakloce } { %%% does not qualify after collection of records } ifelse } { %%% not a correct number of receptions } ifelse } if } ifelse isnull ? } loop pop2