PRICETAB.LST 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. Listing:
  2. 1 IMPLEMENTATION MODULE PriceTable;
  3. 2 (*
  4. 3 * ModBase
  5. 4 * Release 3.0
  6. 5 * (c) Copyright 1986 - 1991 PMI
  7. 6 * P.O. Box 8402
  8. 7 * Green Bay Wi 53308
  9. 8 * All Rights Reserved
  10. 9 * by Ed Ross
  11. 10 *)
  12. 11
  13. 12 FROM NumTypes IMPORT Real8;
  14. 13 FROM Numbers IMPORT Max;
  15. 14 FROM Hash IMPORT HashTable,Define,Dispose,Insert,GetData,KeyFind;
  16. 15 FROM StrConv IMPORT RealToStr,CardinalToStr;
  17. 16 FROM ScrnUtl1 IMPORT GetFieldImageRec;
  18. 17 FROM Tables IMPORT Table,CellValue,GetCell,PutCell,BuildTable,
  19. 18 DefineTextCol,DefineIntegerCol,DefineRealCol,DefineTable,ControlTable,
  20. 19 DeleteTable,ShowTable,NumberOfRows;
  21. 20 FROM GenLists IMPORT GenList,ListLength,GetElmtAdr,BlockToList,
  22. 21 GetElmt, ListInsertAdr,NewList,DisposeList,ListInsert,ShellSortList;
  23. 22 FROM StringIO IMPORT ErrorMessage,NoError,WriteEol,WriteStr,outp;
  24. 23 FROM PosUtils IMPORT Equal,Present,Pos;
  25. 24 FROM Prompts IMPORT PromptStr,PromptYN;
  26. 25 FROM M2Strings IMPORT Length,CompareStr,Assign;
  27. 26 FROM StrEdit IMPORT CAPstr,CrunchBlanks,Append,SetLength,AssignStr,LowerStr,
  28. 27 DeleteRightJustified,CAPstr;
  29. ***** ^ duplicate identifier
  30. 28 FROM ControlUtils IMPORT AddMenuItem,ChangeField,ReadInput,Control;
  31. 29 FROM FramePainter IMPORT ShowDisplayFrame;
  32. 30 FROM InputManager IMPORT ControlFrame;
  33. 31 FROM ScrnTypes IMPORT InitDisplayFrame,DisplayFrame,AFrameName,ImageElement;
  34. 32 FROM ScrnUtl2 IMPORT CloseDisplayFrame;
  35. 33 FROM LowLevel IMPORT Fill;
  36. 34 FROM SYSTEM IMPORT TSIZE,ADR,ADDRESS;
  37. 35 IMPORT VWindows;
  38. 36 FROM VStorage IMPORT DosAlloc,DosDealloc;
  39. 37 IMPORT InitCompilerMods;
  40. 38 FROM HandleIO IMPORT FileExists, OpenFile,CreateFile,CloseHandle,
  41. 39 BlockRead,BlockWrite;
  42. 40
  43. 41 TYPE
  44. 42 PriceTblItem = RECORD
  45. 43 Quantity : ARRAY[1..4] OF CARDINAL;
  46. ***** ^ not supported yet
  47. ***** ^ not supported yet
  48. 44 Price : ARRAY[1 ..4] OF Real8;
  49. ***** ^ not supported yet
  50. ***** ^ not supported yet
  51. 45 Desc : ARRAY[0..30] OF CHAR;
  52. ***** ^ not supported yet
  53. ***** ^ not supported yet
  54. 46 END;
  55. ***** ^ not supported yet
  56. 47
  57. 48
  58. 49
  59. 50 VAR
  60. 51 DF : DisplayFrame;
  61. 52 Tab : Table;
  62. 53 Initialized : BOOLEAN;
  63. 54 SerList : GenList;
  64. 55 FileName : ARRAY[0..20] OF CHAR;
  65. ***** ^ not supported yet
  66. ***** ^ not supported yet
  67. 56 Card : CARDINAL;
  68. 57 EM : ErrorMessage;
  69. 58 Code,J : CARDINAL;
  70. 59 Bool : BOOLEAN;
  71. 60 PriceTbl : POINTER TO ARRAY[0..26] OF PriceTblItem;
  72. ***** ^ not supported yet
  73. ***** ^ not supported yet
  74. 61
  75. 62 GroupCnt : POINTER TO ARRAY[1..20] OF CARDINAL;
  76. ***** ^ not supported yet
  77. ***** ^ not supported yet
  78. 63 NxtGrp : CARDINAL; (* next assigned index into array *)
  79. 64 GrpTab : HashTable;
  80. 65
  81. 66 (* pricing is done on a sliding scale depending on the number of items
  82. 67 purchased. The item count is summed on the group level not the
  83. 68 SKU level at the inventory level *)
  84. 69
  85. 70
  86. 71
  87. 72 PROCEDURE ClearGrpCnt();
  88. 73 (* this procedure will clear out the group count table for a
  89. 74 recompute *)
  90. 75 BEGIN
  91. 76 Fill(GroupCnt,SIZE(GroupCnt^),0);
  92. ***** ^ not supported yet
  93. ***** ^ not supported yet
  94. ***** ^ undeclared identifier
  95. ***** ^ not supported yet
  96. ***** ^ not supported yet
  97. 77
  98. 78 END ClearGrpCnt;
  99. ***** ^ not supported yet
  100. 79
  101. 80 PROCEDURE GrpTotal(Grp : ARRAY OF CHAR) : CARDINAL;
  102. ***** ^ not supported yet
  103. 81 VAR
  104. 82 Index : CARDINAL;
  105. 83 BEGIN
  106. 84 IF KeyFind(GrpTab,Grp)
  107. ***** ^ not supported yet
  108. ***** ^ not supported yet
  109. ***** ^ not supported yet
  110. 85 THEN
  111. 86 GetData(GrpTab,Index);
  112. ***** ^ not supported yet
  113. ***** ^ not supported yet
  114. ***** ^ not supported yet
  115. 87 RETURN GroupCnt^[Index];
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. 88 ELSE
  119. 89 RETURN 0;
  120. 90 END;
  121. 91
  122. 92 END GrpTotal;
  123. ***** ^ not supported yet
  124. 93
  125. 94 PROCEDURE AddGrp(Grp : ARRAY OF CHAR; AddAmt : CARDINAL);
  126. ***** ^ not supported yet
  127. 95 VAR Index : CARDINAL;
  128. 96 BEGIN
  129. 97
  130. 98 IF KeyFind(GrpTab,Grp)
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. ***** ^ not supported yet
  134. 99 THEN
  135. 100 GetData(GrpTab,Index);
  136. ***** ^ not supported yet
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. 101 GroupCnt^[Index] := GroupCnt^[Index] + AddAmt;
  140. ***** ^ not supported yet
  141. ***** ^ not supported yet
  142. ***** ^ not supported yet
  143. ***** ^ not supported yet
  144. 102 ELSE
  145. 103 Insert(GrpTab,Grp,NxtGrp);
  146. ***** ^ not supported yet
  147. ***** ^ not supported yet
  148. ***** ^ not supported yet
  149. ***** ^ not supported yet
  150. 104 GroupCnt^[NxtGrp] := AddAmt;
  151. ***** ^ not supported yet
  152. ***** ^ not supported yet
  153. 105 INC(NxtGrp);
  154. ***** ^ undeclared identifier
  155. ***** ^ not supported yet
  156. 106 END;
  157. 107
  158. 108 END AddGrp;
  159. ***** ^ not supported yet
  160. 109
  161. 110 PROCEDURE InitGrp();
  162. 111 BEGIN
  163. 112 NxtGrp := 1;
  164. 113 Define(GrpTab,100,2);
  165. ***** ^ not supported yet
  166. ***** ^ not supported yet
  167. ***** ^ not supported yet
  168. 114 DosAlloc(GroupCnt,SIZE(GroupCnt^));
  169. ***** ^ not supported yet
  170. ***** ^ not supported yet
  171. ***** ^ undeclared identifier
  172. ***** ^ not supported yet
  173. 115 ClearGrpCnt();
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. 116 END InitGrp;
  177. ***** ^ not supported yet
  178. 117
  179. 118 (* Table should look like this
  180. 119 1234567890123456789012345678901234567890123456789012345678901234567890123456
  181. 120 1 2 3 4 5 6 7
  182. 121 Nbr Min 1 Price 1 Min 2 Price 2 Min 3 Price 3 Min 4 Price 4 Desc
  183. 122 xx xxxxx xxxx.xx xxxxx xxxx.xx xxxxx xxxx.xx xxxxx xxxx.xx xxxxxxxxxxxxxxxxxxxxxx
  184. 123 *)
  185. 124
  186. 125
  187. 126 PROCEDURE SetupTable();
  188. 127 BEGIN
  189. 128
  190. 129 DefineTable(Tab,'Price Table');
  191. ***** ^ not supported yet
  192. ***** ^ not supported yet
  193. ***** ^ not supported yet
  194. 130 DefineTextCol(Tab,3,2,'Nbr',TRUE);
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. ***** ^ not supported yet
  199. 131
  200. 132 DefineIntegerCol(Tab,7,6,'Min 1',0,9999);
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. ***** ^ not supported yet
  205. 133 DefineRealCol(Tab,14,8,'Price 1',0.0,9999.99);
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. ***** ^ not supported yet
  210. 134
  211. 135 DefineIntegerCol(Tab,23,6,'Min 2',0,99999);
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. ***** ^ not supported yet
  215. ***** ^ not supported yet
  216. 136 DefineRealCol(Tab,30,8,'Price 2',0.0,9999.99);
  217. ***** ^ not supported yet
  218. ***** ^ not supported yet
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. 137
  222. 138 DefineIntegerCol(Tab,39,6,'Min 3',0,99999);
  223. ***** ^ not supported yet
  224. ***** ^ not supported yet
  225. ***** ^ not supported yet
  226. ***** ^ not supported yet
  227. 139 DefineRealCol(Tab,46,8,'Price 3',0.0,9999.99);
  228. ***** ^ not supported yet
  229. ***** ^ not supported yet
  230. ***** ^ not supported yet
  231. ***** ^ not supported yet
  232. 140
  233. 141 DefineIntegerCol(Tab,55,6,'Min 4',0,99999);
  234. ***** ^ not supported yet
  235. ***** ^ not supported yet
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. 142 DefineRealCol(Tab,62,8,'Price 4',0.0,9999.99);
  239. ***** ^ not supported yet
  240. ***** ^ not supported yet
  241. ***** ^ not supported yet
  242. ***** ^ not supported yet
  243. 143
  244. 144
  245. 145 DefineTextCol(Tab,71,20,'Desc',FALSE);
  246. ***** ^ not supported yet
  247. ***** ^ not supported yet
  248. ***** ^ not supported yet
  249. ***** ^ not supported yet
  250. 146
  251. 147 END SetupTable;
  252. ***** ^ not supported yet
  253. 148
  254. 149
  255. 150
  256. 151
  257. 152
  258. 153
  259. 154
  260. 155 PROCEDURE GetPriceTbl();
  261. 156
  262. 157 (* return a list of all products *)
  263. 158 VAR
  264. 159 H : CARDINAL;
  265. 160 EM : ErrorMessage;
  266. 161 Size : CARDINAL;
  267. 162 J : CARDINAL;
  268. 163 BEGIN
  269. 164
  270. 165 J := SIZE(PriceTbl^);
  271. ***** ^ undeclared identifier
  272. ***** ^ not supported yet
  273. 166 DosAlloc(PriceTbl,SIZE(PriceTbl^));
  274. ***** ^ not supported yet
  275. ***** ^ not supported yet
  276. ***** ^ undeclared identifier
  277. ***** ^ not supported yet
  278. 167 IF FileExists('Price.tbl')
  279. ***** ^ not supported yet
  280. ***** ^ not supported yet
  281. 168 THEN
  282. 169 EM := OpenFile(H,'Price.Tbl');
  283. ***** ^ not supported yet
  284. ***** ^ not supported yet
  285. ***** ^ not supported yet
  286. 170 EM := BlockRead(H,PriceTbl,SIZE(PriceTbl^));
  287. ***** ^ not supported yet
  288. ***** ^ not supported yet
  289. ***** ^ not supported yet
  290. ***** ^ undeclared identifier
  291. ***** ^ not supported yet
  292. 171 EM := CloseHandle(H);
  293. ***** ^ not supported yet
  294. ***** ^ not supported yet
  295. ***** ^ not supported yet
  296. 172 ELSE
  297. 173 Fill(PriceTbl,SIZE(PriceTbl^),0);
  298. ***** ^ not supported yet
  299. ***** ^ not supported yet
  300. ***** ^ undeclared identifier
  301. ***** ^ not supported yet
  302. ***** ^ not supported yet
  303. 174
  304. 175 END;
  305. 176 END GetPriceTbl;
  306. ***** ^ not supported yet
  307. 177
  308. 178
  309. 179
  310. 180
  311. 181
  312. 182 PROCEDURE DefinePriceTbl();
  313. 183 VAR
  314. 184 H : CARDINAL;
  315. 185 EM : CARDINAL;
  316. 186 J : CARDINAL;
  317. 187 Cell : CellValue;
  318. 188 Row : CARDINAL;
  319. 189 Str : ARRAY [0..5] OF CHAR;
  320. ***** ^ not supported yet
  321. ***** ^ not supported yet
  322. 190 Nbr : ARRAY[0..4] OF CHAR;
  323. ***** ^ not supported yet
  324. ***** ^ not supported yet
  325. 191 Size,Code : CARDINAL;
  326. 192 BEGIN
  327. 193 IF NOT Initialized
  328. 194 THEN
  329. 195 InitGrp();
  330. ***** ^ not supported yet
  331. ***** ^ not supported yet
  332. 196 GetPriceTbl();
  333. ***** ^ not supported yet
  334. ***** ^ not supported yet
  335. 197 Initialized := TRUE;
  336. 198 END;
  337. 199 WriteEol(outp,'..This may take a few minutes .. standby..');
  338. ***** ^ not supported yet
  339. ***** ^ not supported yet
  340. ***** ^ not supported yet
  341. 200 SetupTable();
  342. ***** ^ not supported yet
  343. ***** ^ not supported yet
  344. 201 BuildTable(Tab,26); (* increase table size by *)
  345. ***** ^ not supported yet
  346. ***** ^ not supported yet
  347. ***** ^ not supported yet
  348. 202 FOR Row := 1 TO 25 DO
  349. 203
  350. 204 CardinalToStr(Row,3,Nbr);
  351. ***** ^ not supported yet
  352. ***** ^ not supported yet
  353. 205 Assign( Nbr,Cell.Str);
  354. ***** ^ not supported yet
  355. ***** ^ not supported yet
  356. ***** ^ not supported yet
  357. ***** ^ not supported yet
  358. 206 PutCell(Tab,1,Row,Cell); (* indexed *)
  359. ***** ^ not supported yet
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. 207
  363. 208
  364. 209 Cell.I := PriceTbl^[Row].Quantity[1]; (* min 1 *)
  365. ***** ^ not supported yet
  366. ***** ^ not supported yet
  367. ***** ^ not supported yet
  368. ***** ^ not supported yet
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. 210 PutCell(Tab,2,Row,Cell);
  372. ***** ^ not supported yet
  373. ***** ^ not supported yet
  374. ***** ^ not supported yet
  375. 211 Cell.R := PriceTbl^[Row].Price[1]; (* min price *)
  376. ***** ^ not supported yet
  377. ***** ^ not supported yet
  378. ***** ^ not supported yet
  379. ***** ^ not supported yet
  380. ***** ^ not supported yet
  381. ***** ^ not supported yet
  382. 212 PutCell(Tab,3,Row,Cell);
  383. ***** ^ not supported yet
  384. ***** ^ not supported yet
  385. ***** ^ not supported yet
  386. 213
  387. 214 Cell.I := PriceTbl^[Row].Quantity[2]; (* min 2 *)
  388. ***** ^ not supported yet
  389. ***** ^ not supported yet
  390. ***** ^ not supported yet
  391. ***** ^ not supported yet
  392. ***** ^ not supported yet
  393. ***** ^ not supported yet
  394. 215 PutCell(Tab,4,Row,Cell);
  395. ***** ^ not supported yet
  396. ***** ^ not supported yet
  397. ***** ^ not supported yet
  398. 216 Cell.R := PriceTbl^[Row].Price[2]; (* min price *)
  399. ***** ^ not supported yet
  400. ***** ^ not supported yet
  401. ***** ^ not supported yet
  402. ***** ^ not supported yet
  403. ***** ^ not supported yet
  404. ***** ^ not supported yet
  405. 217 PutCell(Tab,5,Row,Cell);
  406. ***** ^ not supported yet
  407. ***** ^ not supported yet
  408. ***** ^ not supported yet
  409. 218
  410. 219 Cell.I := PriceTbl^[Row].Quantity[3]; (* min 3 *)
  411. ***** ^ not supported yet
  412. ***** ^ not supported yet
  413. ***** ^ not supported yet
  414. ***** ^ not supported yet
  415. ***** ^ not supported yet
  416. ***** ^ not supported yet
  417. 220 PutCell(Tab,6,Row,Cell);
  418. ***** ^ not supported yet
  419. ***** ^ not supported yet
  420. ***** ^ not supported yet
  421. 221 Cell.R := PriceTbl^[Row].Price[3]; (* min price *)
  422. ***** ^ not supported yet
  423. ***** ^ not supported yet
  424. ***** ^ not supported yet
  425. ***** ^ not supported yet
  426. ***** ^ not supported yet
  427. ***** ^ not supported yet
  428. 222 PutCell(Tab,7,Row,Cell);
  429. ***** ^ not supported yet
  430. ***** ^ not supported yet
  431. ***** ^ not supported yet
  432. 223
  433. 224 Cell.I := PriceTbl^[Row].Quantity[4]; (* min 3 *)
  434. ***** ^ not supported yet
  435. ***** ^ not supported yet
  436. ***** ^ not supported yet
  437. ***** ^ not supported yet
  438. ***** ^ not supported yet
  439. ***** ^ not supported yet
  440. 225 PutCell(Tab,8,Row,Cell);
  441. ***** ^ not supported yet
  442. ***** ^ not supported yet
  443. ***** ^ not supported yet
  444. 226 Cell.R := PriceTbl^[Row].Price[4]; (* min price *)
  445. ***** ^ not supported yet
  446. ***** ^ not supported yet
  447. ***** ^ not supported yet
  448. ***** ^ not supported yet
  449. ***** ^ not supported yet
  450. ***** ^ not supported yet
  451. 227 PutCell(Tab,9,Row,Cell);
  452. ***** ^ not supported yet
  453. ***** ^ not supported yet
  454. ***** ^ not supported yet
  455. 228
  456. 229
  457. 230 Assign(PriceTbl^[Row].Desc,Cell.Str);
  458. ***** ^ not supported yet
  459. ***** ^ not supported yet
  460. ***** ^ not supported yet
  461. ***** ^ not supported yet
  462. ***** ^ not supported yet
  463. ***** ^ not supported yet
  464. 231 PutCell(Tab,10,Row,Cell);
  465. ***** ^ not supported yet
  466. ***** ^ not supported yet
  467. ***** ^ not supported yet
  468. 232
  469. 233
  470. 234 END;
  471. 235 ControlTable(Tab,2,5,79,20);
  472. ***** ^ not supported yet
  473. ***** ^ not supported yet
  474. ***** ^ not supported yet
  475. 236 (* now read the table in and save values *)
  476. 237 FOR Row := 1 TO 25 DO
  477. 238 GetCell(Tab,2,Row,Cell);
  478. ***** ^ not supported yet
  479. ***** ^ not supported yet
  480. ***** ^ not supported yet
  481. 239 PriceTbl^[Row].Quantity[1] := Cell.I;
  482. ***** ^ not supported yet
  483. ***** ^ not supported yet
  484. ***** ^ not supported yet
  485. ***** ^ not supported yet
  486. ***** ^ not supported yet
  487. ***** ^ not supported yet
  488. 240 GetCell(Tab,3,Row,Cell);
  489. ***** ^ not supported yet
  490. ***** ^ not supported yet
  491. ***** ^ not supported yet
  492. 241 PriceTbl^[Row].Price[1] := Cell.R;
  493. ***** ^ not supported yet
  494. ***** ^ not supported yet
  495. ***** ^ not supported yet
  496. ***** ^ not supported yet
  497. ***** ^ not supported yet
  498. ***** ^ not supported yet
  499. 242
  500. 243 GetCell(Tab,4,Row,Cell);
  501. ***** ^ not supported yet
  502. ***** ^ not supported yet
  503. ***** ^ not supported yet
  504. 244 PriceTbl^[Row].Quantity[2] := Cell.I;
  505. ***** ^ not supported yet
  506. ***** ^ not supported yet
  507. ***** ^ not supported yet
  508. ***** ^ not supported yet
  509. ***** ^ not supported yet
  510. ***** ^ not supported yet
  511. 245 GetCell(Tab,5,Row,Cell);
  512. ***** ^ not supported yet
  513. ***** ^ not supported yet
  514. ***** ^ not supported yet
  515. 246 PriceTbl^[Row].Price[2] := Cell.R;
  516. ***** ^ not supported yet
  517. ***** ^ not supported yet
  518. ***** ^ not supported yet
  519. ***** ^ not supported yet
  520. ***** ^ not supported yet
  521. ***** ^ not supported yet
  522. 247
  523. 248 GetCell(Tab,6,Row,Cell);
  524. ***** ^ not supported yet
  525. ***** ^ not supported yet
  526. ***** ^ not supported yet
  527. 249 PriceTbl^[Row].Quantity[3] := Cell.I;
  528. ***** ^ not supported yet
  529. ***** ^ not supported yet
  530. ***** ^ not supported yet
  531. ***** ^ not supported yet
  532. ***** ^ not supported yet
  533. ***** ^ not supported yet
  534. 250 GetCell(Tab,7,Row,Cell);
  535. ***** ^ not supported yet
  536. ***** ^ not supported yet
  537. ***** ^ not supported yet
  538. 251 PriceTbl^[Row].Price[3] := Cell.R;
  539. ***** ^ not supported yet
  540. ***** ^ not supported yet
  541. ***** ^ not supported yet
  542. ***** ^ not supported yet
  543. ***** ^ not supported yet
  544. ***** ^ not supported yet
  545. 252
  546. 253 GetCell(Tab,8,Row,Cell);
  547. ***** ^ not supported yet
  548. ***** ^ not supported yet
  549. ***** ^ not supported yet
  550. 254 PriceTbl^[Row].Quantity[4] := Cell.I;
  551. ***** ^ not supported yet
  552. ***** ^ not supported yet
  553. ***** ^ not supported yet
  554. ***** ^ not supported yet
  555. ***** ^ not supported yet
  556. ***** ^ not supported yet
  557. 255 GetCell(Tab,9,Row,Cell);
  558. ***** ^ not supported yet
  559. ***** ^ not supported yet
  560. ***** ^ not supported yet
  561. 256 PriceTbl^[Row].Price[4] := Cell.R;
  562. ***** ^ not supported yet
  563. ***** ^ not supported yet
  564. ***** ^ not supported yet
  565. ***** ^ not supported yet
  566. ***** ^ not supported yet
  567. ***** ^ not supported yet
  568. 257
  569. 258
  570. 259 GetCell(Tab,10,Row,Cell);
  571. ***** ^ not supported yet
  572. ***** ^ not supported yet
  573. ***** ^ not supported yet
  574. 260 Assign( Cell.Str,PriceTbl^[Row].Desc);
  575. ***** ^ not supported yet
  576. ***** ^ not supported yet
  577. ***** ^ not supported yet
  578. ***** ^ not supported yet
  579. ***** ^ not supported yet
  580. ***** ^ not supported yet
  581. 261 END;
  582. 262 (* now save the price table in the file *)
  583. 263 DeleteTable(Tab);
  584. ***** ^ not supported yet
  585. ***** ^ not supported yet
  586. 264 IF NOT FileExists('Price.Tbl')
  587. ***** ^ not supported yet
  588. ***** ^ not supported yet
  589. 265 THEN EM := CreateFile(H,'Price.tbl');
  590. ***** ^ not supported yet
  591. ***** ^ not supported yet
  592. 266 ELSE EM := OpenFile(H,'Price.tbl');
  593. ***** ^ not supported yet
  594. ***** ^ not supported yet
  595. 267 END;
  596. 268 EM := BlockWrite(H,PriceTbl,SIZE(PriceTbl^));
  597. ***** ^ not supported yet
  598. ***** ^ not supported yet
  599. ***** ^ undeclared identifier
  600. ***** ^ not supported yet
  601. 269 EM := CloseHandle(H);
  602. ***** ^ not supported yet
  603. ***** ^ not supported yet
  604. 270
  605. 271
  606. 272 END DefinePriceTbl;
  607. ***** ^ not supported yet
  608. 273
  609. 274 PROCEDURE GetPrice(Line : CARDINAL; Quantity : CARDINAL;
  610. 275 StartAtLvl : CARDINAL) : Real8;
  611. 276 VAR
  612. 277 ItemCnt : CARDINAL;
  613. 278 BEGIN
  614. 279 IF NOT Initialized
  615. 280 THEN
  616. 281 GetPriceTbl();
  617. ***** ^ not supported yet
  618. ***** ^ not supported yet
  619. 282 Initialized := TRUE;
  620. 283 END;
  621. 284 IF ((Line = 0 ) OR (Line > 25))
  622. 285 THEN RETURN 0.0
  623. ***** ^ bad RETURN
  624. 286 END;
  625. 287 IF StartAtLvl < 1
  626. 288 THEN
  627. 289 StartAtLvl := 1;
  628. 290 END;
  629. 291 IF StartAtLvl > 4
  630. 292 THEN
  631. 293 StartAtLvl := 4;
  632. 294 END;
  633. 295 (* get either the actual count or the count for the quantity specified*)
  634. 296 ItemCnt := Max(Quantity,PriceTbl^[Line].Quantity[StartAtLvl]);
  635. ***** ^ not supported yet
  636. ***** ^ not supported yet
  637. ***** ^ not supported yet
  638. ***** ^ not supported yet
  639. ***** ^ not supported yet
  640. 297 IF ItemCnt < PriceTbl^[Line].Quantity[2]
  641. ***** ^ not supported yet
  642. ***** ^ not supported yet
  643. ***** ^ not supported yet
  644. ***** ^ not supported yet
  645. 298 THEN RETURN PriceTbl^[Line].Price[1]
  646. ***** ^ not supported yet
  647. ***** ^ not supported yet
  648. ***** ^ not supported yet
  649. ***** ^ not supported yet
  650. 299 ELSIF ItemCnt < PriceTbl^[Line].Quantity[3]
  651. ***** ^ not supported yet
  652. ***** ^ not supported yet
  653. ***** ^ not supported yet
  654. ***** ^ not supported yet
  655. 300 THEN RETURN PriceTbl^[Line].Price[2]
  656. ***** ^ not supported yet
  657. ***** ^ not supported yet
  658. ***** ^ not supported yet
  659. ***** ^ not supported yet
  660. 301 ELSIF ItemCnt < PriceTbl^[Line].Quantity[4]
  661. ***** ^ not supported yet
  662. ***** ^ not supported yet
  663. ***** ^ not supported yet
  664. ***** ^ not supported yet
  665. 302 THEN RETURN PriceTbl^[Line].Price[3]
  666. ***** ^ not supported yet
  667. ***** ^ not supported yet
  668. ***** ^ not supported yet
  669. ***** ^ not supported yet
  670. 303 ELSE RETURN PriceTbl^[Line].Price[4];
  671. ***** ^ not supported yet
  672. ***** ^ not supported yet
  673. ***** ^ not supported yet
  674. ***** ^ not supported yet
  675. 304 END;
  676. 305 END GetPrice;
  677. ***** ^ not supported yet
  678. 306
  679. 307 PROCEDURE GetPriceTable(TblNbr : CARDINAL;
  680. 308 VAR Q1,Q2,Q3,Q4 : CARDINAL;
  681. 309 VAR P1,P2,P3,P4 : Real8);
  682. 310
  683. 311 (* return the price table for a line
  684. 312 so the invoice routine can display *)
  685. 313 BEGIN
  686. 314 IF (TblNbr = 0) OR (TblNbr > 25)
  687. 315 THEN
  688. 316 P1 := 0.0;
  689. ***** ^ not supported yet
  690. 317 P2 := 0.0;
  691. ***** ^ not supported yet
  692. 318 P3 := 0.0;
  693. ***** ^ not supported yet
  694. 319 P4 := 0.0;
  695. ***** ^ not supported yet
  696. 320 Q1 := 0;
  697. 321 Q2 := 0;
  698. 322 Q3 := 0;
  699. 323 Q4 := 0;
  700. 324 RETURN;
  701. 325 END;
  702. 326 Q1 := PriceTbl^[TblNbr].Quantity[1];
  703. ***** ^ not supported yet
  704. ***** ^ not supported yet
  705. ***** ^ not supported yet
  706. ***** ^ not supported yet
  707. 327 Q2 := PriceTbl^[TblNbr].Quantity[2];
  708. ***** ^ not supported yet
  709. ***** ^ not supported yet
  710. ***** ^ not supported yet
  711. ***** ^ not supported yet
  712. 328 Q3 := PriceTbl^[TblNbr].Quantity[3];
  713. ***** ^ not supported yet
  714. ***** ^ not supported yet
  715. ***** ^ not supported yet
  716. ***** ^ not supported yet
  717. 329 Q4 := PriceTbl^[TblNbr].Quantity[4];
  718. ***** ^ not supported yet
  719. ***** ^ not supported yet
  720. ***** ^ not supported yet
  721. ***** ^ not supported yet
  722. 330 P1 := PriceTbl^[TblNbr].Price[1];
  723. ***** ^ not supported yet
  724. ***** ^ not supported yet
  725. ***** ^ not supported yet
  726. ***** ^ not supported yet
  727. ***** ^ not supported yet
  728. 331 P2 := PriceTbl^[TblNbr].Price[2];
  729. ***** ^ not supported yet
  730. ***** ^ not supported yet
  731. ***** ^ not supported yet
  732. ***** ^ not supported yet
  733. ***** ^ not supported yet
  734. 332 P3 := PriceTbl^[TblNbr].Price[3];
  735. ***** ^ not supported yet
  736. ***** ^ not supported yet
  737. ***** ^ not supported yet
  738. ***** ^ not supported yet
  739. ***** ^ not supported yet
  740. 333 P4 := PriceTbl^[TblNbr].Price[4];
  741. ***** ^ not supported yet
  742. ***** ^ not supported yet
  743. ***** ^ not supported yet
  744. ***** ^ not supported yet
  745. ***** ^ not supported yet
  746. 334 END GetPriceTable;
  747. ***** ^ not supported yet
  748. 335
  749. 336 PROCEDURE InitializePrice();
  750. 337 BEGIN
  751. 338 GetPriceTbl();
  752. ***** ^ not supported yet
  753. ***** ^ not supported yet
  754. 339 InitGrp();
  755. ***** ^ not supported yet
  756. ***** ^ not supported yet
  757. 340 Initialized := TRUE;
  758. 341 END InitializePrice;
  759. ***** ^ not supported yet
  760. 342
  761. 343
  762. 344
  763. 345 BEGIN
  764. 346
  765. 347 Initialized := FALSE;
  766. 348
  767. 349 END PriceTable.
  768. ***** ^ not supported yet
  769. 418 errors