|
Inverse Loop with specific index |
|
indexname |
Index name |
Namer |
Record |
seg |
Number of used fields in index (for complex indexes) |
TrHs |
true - continue loop, false - stop loop |
|
global
function Boolean IsSessionOpen(string machinename,string drawer,Date td,Time tt)
BEGIN
record POSEventVc POSEventr;
Boolean TrHs,res;
POSEventr.MachineName = machinename;
POSEventr.Drawer = drawer;
POSEventr.TransDate = td;
POSEventr.TransTime = tt;
TrHs = true;
while (LoopBackKey("MachineName",POSEventr,4,TrHs)) begin
if ((POSEventr.TransDate<td) or ((POSEventr.TransDate==td) and (POSEventr.TransTime<tt))) then begin
if ((POSEventr.Event==1) and (POSEventr.MachineName==machinename) and (POSEventr.Drawer==drawer)) then begin
res = true;
goto LIsSessionOpen;
end;
if ((POSEventr.Event!=1) and (POSEventr.MachineName==machinename) and (POSEventr.Drawer==drawer)) then begin
goto LIsSessionOpen;
end;
end else begin
goto LIsSessionOpen;
end;
end;
LIsSessionOpen:;
IsSessionOpen = res;
return;
END;
««