Changeset 460 for cprs/branches/foia-cprs/CPRS-Chart/Orders/uODBase.pas
- Timestamp:
- Jul 6, 2008, 8:20:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/foia-cprs/CPRS-Chart/Orders/uODBase.pas
r459 r460 22 22 procedure PopKeyVars(NumLevels: Integer = 1); 23 23 procedure PushKeyVars(const NewVals: string); 24 procedure ExpandOrderObjects(var Txt: string; var ContainsObjects: boolean; msg: string = ''); 24 25 25 26 implementation 27 28 uses 29 dShared, Windows, rTemplates; 26 30 27 31 var … … 118 122 end; 119 123 124 procedure ExpandOrderObjects(var Txt: string; var ContainsObjects: boolean; msg: string = ''); 125 var 126 ObjList: TStringList; 127 Err: TStringList; 128 i, j, k, oLen: integer; 129 obj, ObjTxt: string; 130 const 131 CRDelim = #13; 132 TC_BOILER_ERR = 'Order Boilerplate Object Error'; 133 TX_BOILER_ERR = 'Contact IRM and inform them about this error.' + CRLF + 134 'Make sure you give them the name of the quick' + CRLF + 135 'order that you are processing.' ; 136 begin 137 ObjList := TStringList.Create; 138 try 139 Err := nil; 140 if(not dmodShared.BoilerplateOK(Txt, CRDelim, ObjList, Err)) and (assigned(Err)) then 141 begin 142 try 143 Err.Add(CRLF + TX_BOILER_ERR); 144 InfoBox(Err.Text, TC_BOILER_ERR, MB_OK + MB_ICONERROR); 145 finally 146 Err.Free; 147 end; 148 end; 149 if(ObjList.Count > 0) then 150 begin 151 ContainsObjects := True; 152 GetTemplateText(ObjList); 153 i := 0; 154 while (i < ObjList.Count) do 155 begin 156 if(pos(ObjMarker, ObjList[i]) = 1) then 157 begin 158 obj := copy(ObjList[i], ObjMarkerLen+1, MaxInt); 159 if(obj = '') then break; 160 j := i + 1; 161 while (j < ObjList.Count) and (pos(ObjMarker, ObjList[j]) = 0) do 162 inc(j); 163 if((j - i) > 2) then 164 begin 165 ObjTxt := ''; 166 for k := i+1 to j-1 do 167 ObjTxt := ObjTxt + #13 + ObjList[k]; 168 end 169 else 170 ObjTxt := ObjList[i+1]; 171 i := j; 172 obj := '|' + obj + '|'; 173 oLen := length(obj); 174 repeat 175 j := pos(obj, Txt); 176 if(j > 0) then 177 begin 178 delete(Txt, j, OLen); 179 insert(ObjTxt, Txt, j); 180 end; 181 until(j = 0); 182 end 183 else 184 inc(i); 185 end 186 end; 187 finally 188 ObjList.Free; 189 end; 190 end; 191 120 192 initialization 121 193 uOrderEventType := #0;
Note:
See TracChangeset
for help on using the changeset viewer.