Table of Content
HAL Forum
function Boolean LoopBackKey (
String indexname,record NameVc Namer,Integer seg,Boolean TrHs)
Description:
Inverse Loop with specific index
Parameters:
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;
Related topics:
««