1 | unit uODBase;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, ORFn, uConst;
|
---|
7 |
|
---|
8 | { Order Checking }
|
---|
9 | function AddFillerAppID(const AnID: string): Boolean;
|
---|
10 | procedure ClearFillerAppList;
|
---|
11 |
|
---|
12 | { Ordering Environment }
|
---|
13 | procedure SetOrderFormIDOnCreate(AFormID: Integer);
|
---|
14 | function OrderFormIDOnCreate: Integer;
|
---|
15 | procedure SetOrderEventTypeOnCreate(AType: Char);
|
---|
16 | function OrderEventTypeOnCreate: Char;
|
---|
17 | procedure SetOrderEventIDOnCreate(AnEvtID: integer);
|
---|
18 | function OrderEventIDOnCreate: integer;
|
---|
19 | procedure SetOrderEventNameOnCreate(AnEvtNm: string);
|
---|
20 | function OrderEventNameOnCreate: string;
|
---|
21 | function GetKeyVars: string;
|
---|
22 | procedure PopKeyVars(NumLevels: Integer = 1);
|
---|
23 | procedure PushKeyVars(const NewVals: string);
|
---|
24 |
|
---|
25 | implementation
|
---|
26 |
|
---|
27 | var
|
---|
28 | uOrderEventType: Char;
|
---|
29 | uOrderEventID: Integer;
|
---|
30 | uOrderEventName: string;
|
---|
31 | uOrderFormID: Integer;
|
---|
32 | uFillerAppID: TStringList;
|
---|
33 | uKeyVarList: TStringList;
|
---|
34 |
|
---|
35 | { Order Checking }
|
---|
36 |
|
---|
37 | function AddFillerAppID(const AnID: string): Boolean;
|
---|
38 | begin
|
---|
39 | Result := False;
|
---|
40 | if uFillerAppID.IndexOf(AnID) < 0 then
|
---|
41 | begin
|
---|
42 | Result := True;
|
---|
43 | uFillerAppID.Add(AnID);
|
---|
44 | end;
|
---|
45 | end;
|
---|
46 |
|
---|
47 | procedure ClearFillerAppList;
|
---|
48 | begin
|
---|
49 | uFillerAppID.Clear;
|
---|
50 | end;
|
---|
51 |
|
---|
52 | { Ordering Environment }
|
---|
53 |
|
---|
54 | procedure SetOrderFormIDOnCreate(AFormID: Integer);
|
---|
55 | begin
|
---|
56 | uOrderFormID := AFormID;
|
---|
57 | end;
|
---|
58 |
|
---|
59 | function OrderFormIDOnCreate: Integer;
|
---|
60 | begin
|
---|
61 | Result := uOrderFormID;
|
---|
62 | end;
|
---|
63 |
|
---|
64 | procedure SetOrderEventTypeOnCreate(AType: Char);
|
---|
65 | begin
|
---|
66 | uOrderEventType := AType;
|
---|
67 | end;
|
---|
68 |
|
---|
69 | function OrderEventTypeOnCreate: Char;
|
---|
70 | begin
|
---|
71 | Result := uOrderEventType;
|
---|
72 | end;
|
---|
73 |
|
---|
74 | procedure SetOrderEventIDOnCreate(AnEvtID: Integer);
|
---|
75 | begin
|
---|
76 | uOrderEventID := AnEvtID;
|
---|
77 | end;
|
---|
78 |
|
---|
79 | procedure SetOrderEventNameOnCreate(AnEvtNm: string);
|
---|
80 | begin
|
---|
81 | uOrderEventName := AnEvtNm;
|
---|
82 | end;
|
---|
83 |
|
---|
84 | function OrderEventNameOnCreate: string;
|
---|
85 | begin
|
---|
86 | Result := uOrderEventName;
|
---|
87 | end;
|
---|
88 |
|
---|
89 | function OrderEventIDOnCreate: integer;
|
---|
90 | begin
|
---|
91 | Result := uOrderEventID;
|
---|
92 | end;
|
---|
93 |
|
---|
94 | function GetKeyVars: string;
|
---|
95 | begin
|
---|
96 | Result := '';
|
---|
97 | with uKeyVarList do if Count > 0 then Result := Strings[Count - 1];
|
---|
98 | end;
|
---|
99 |
|
---|
100 | procedure PopKeyVars(NumLevels: Integer = 1);
|
---|
101 | begin
|
---|
102 | with uKeyVarList do while (NumLevels > 0) and (Count > 0) do
|
---|
103 | begin
|
---|
104 | Delete(Count - 1);
|
---|
105 | Dec(NumLevels);
|
---|
106 | end;
|
---|
107 | end;
|
---|
108 |
|
---|
109 | procedure PushKeyVars(const NewVals: string);
|
---|
110 | var
|
---|
111 | i: Integer;
|
---|
112 | x: string;
|
---|
113 | begin
|
---|
114 | if uKeyVarList.Count > 0 then x := uKeyVarList[uKeyVarList.Count - 1] else x := '';
|
---|
115 | for i := 1 to MAX_KEYVARS do
|
---|
116 | if Piece(NewVals, U, i) <> '' then SetPiece(x, U, i, Piece(NewVals, U, i));
|
---|
117 | uKeyVarList.Add(x);
|
---|
118 | end;
|
---|
119 |
|
---|
120 | initialization
|
---|
121 | uOrderEventType := #0;
|
---|
122 | uOrderFormID := 0;
|
---|
123 | uOrderEventName := '';
|
---|
124 | uFillerAppID := TStringList.Create;
|
---|
125 | uKeyVarList := TStringList.Create;
|
---|
126 |
|
---|
127 | finalization
|
---|
128 | uFillerAppID.Free;
|
---|
129 | uKeyVarList.Free;
|
---|
130 |
|
---|
131 | end.
|
---|