source: cprs/branches/foia-cprs/CPRS-Chart/Orders/uODBase.pas@ 459

Last change on this file since 459 was 459, checked in by Kevin Toppenberg, 16 years ago

Adding foia-cprs branch

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