DBSCREEN.LST 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943
  1. Listing:
  2. 1
  3. 2 IMPLEMENTATION MODULE DBScreen;
  4. 3 (*
  5. 4 * ModBase
  6. 5 * Release 3.0
  7. 6 * By Don Fletcher & John McMonagle
  8. 7 * (c) Copyright 1986 - 1991 PMI
  9. 8 * P.O. Box 8402
  10. 9 * Green Bay Wi 53308
  11. 10 * All Rights Reserved
  12. 11 *
  13. 12 *)
  14. 13
  15. 14 IMPORT SYSTEM;
  16. 15
  17. 16 (*Repertoire modules*)
  18. 17 IMPORT BigSets;
  19. 18 IMPORT LowLevel;
  20. 19 IMPORT KbdInput;
  21. 20 IMPORT SmartScreen;
  22. 21 IMPORT StrEdit;
  23. 22 IMPORT StrInput;
  24. 23 IMPORT StrConv;
  25. 24 IMPORT M2Strings;
  26. 25 IMPORT VWindows;
  27. 26 IMPORT WindowPrims;
  28. 27 IMPORT ModBase3;
  29. 28 IMPORT ErrorManager;
  30. 29 FROM MiscFunctions IMPORT FieldName, FieldNameChar,
  31. 30 Alph, Trim, Upper;
  32. 31 CONST Blank = ' ';
  33. 32 MaxGets = 80;
  34. 33 MaxField = 128;
  35. 34 MaxLength = 256;
  36. 35 MaxNLength = 18;
  37. 36
  38. 37 CRnum = 13;
  39. 38 TABnum = 9;
  40. 39 BSPnum = 8;
  41. 40 ESCnum = 27;
  42. 41 BTBnum = 15 + KbdInput.Extended;
  43. ***** ^ not supported yet
  44. ***** ^ not supported yet
  45. 42 (*back tab numeric code for extended scan code*)
  46. 43 LARWnum = 75 + KbdInput.Extended;
  47. ***** ^ not supported yet
  48. ***** ^ not supported yet
  49. 44 (*left arrow numeric code*)
  50. 45 RARWnum = 77 + KbdInput.Extended;
  51. ***** ^ not supported yet
  52. ***** ^ not supported yet
  53. 46 (*right arrow*)
  54. 47 UARWnum = 72 + KbdInput.Extended;
  55. ***** ^ not supported yet
  56. ***** ^ not supported yet
  57. 48 (*up arrow*)
  58. 49 DARWnum = 80 + KbdInput.Extended;
  59. ***** ^ not supported yet
  60. ***** ^ not supported yet
  61. 50
  62. 51 TYPE
  63. 52 String = ARRAY [0..MaxField] OF CHAR;
  64. ***** ^ not supported yet
  65. ***** ^ not supported yet
  66. 53
  67. 54 StrPtr = POINTER TO String;
  68. ***** ^ not supported yet
  69. 55
  70. 56 GetType = RECORD
  71. 57 row: CARDINAL;
  72. 58 col: CARDINAL;
  73. 59 len: CARDINAL;
  74. 60 val: StrPtr;
  75. 61 END;
  76. ***** ^ not supported yet
  77. 62
  78. 63 InputArray = ARRAY [1..MaxGets] OF GetType;
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. 64
  82. 65 VAR input: InputArray;
  83. ***** ^ not supported yet
  84. 66 lastget: CARDINAL;
  85. 67
  86. 68 PROCEDURE ValidType(ch: CHAR): BOOLEAN;
  87. 69 BEGIN
  88. 70 RETURN (CAP(ch)='C') OR (CAP(ch)='N') OR (CAP(ch)='L') OR
  89. ***** ^ undeclared identifier
  90. ***** ^ not supported yet
  91. ***** ^ undeclared identifier
  92. ***** ^ not supported yet
  93. ***** ^ undeclared identifier
  94. ***** ^ not supported yet
  95. 71 (CAP(ch)='D') OR (CAP(ch)='M');
  96. ***** ^ undeclared identifier
  97. ***** ^ not supported yet
  98. ***** ^ undeclared identifier
  99. ***** ^ not supported yet
  100. 72 END ValidType;
  101. ***** ^ not supported yet
  102. 73
  103. 74 PROCEDURE ValidSize(size: CARDINAL; fieldtype: CHAR): BOOLEAN;
  104. 75 (* Checks to see whether size is valid for the given fieldtype*)
  105. 76 BEGIN
  106. 77 CASE CAP(fieldtype) OF
  107. ***** ^ undeclared identifier
  108. ***** ^ not supported yet
  109. 78 'C': RETURN (size >= 1) AND (size <= MaxLength);
  110. 79 | 'N': RETURN (size >= 1) AND (size <= MaxNLength);
  111. 80 | 'L': RETURN (size = 1);
  112. 81 | 'D': RETURN (size = 8);
  113. 82 | 'M': RETURN (size = 10);
  114. 83 END;
  115. 84 RETURN FALSE;
  116. 85 END ValidSize;
  117. ***** ^ not supported yet
  118. 86
  119. 87 PROCEDURE ValidDec(size, decimalplaces: CARDINAL): BOOLEAN;
  120. 88 BEGIN
  121. 89 RETURN (decimalplaces <= size);
  122. 90 END ValidDec;
  123. ***** ^ not supported yet
  124. 91
  125. 92 PROCEDURE GetDescriptors(VAR fields: ARRAY OF ModBase3.DBFieldDescriptor);
  126. ***** ^ not supported yet
  127. 93
  128. 94 VAR
  129. 95 i, j, crow, ccol, lastfield, pagebottom, pagetop: CARDINAL;
  130. 96 sizestring: ARRAY [0..2] OF CHAR;
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. 97 decstr: ARRAY [0..1] OF CHAR;
  134. ***** ^ not supported yet
  135. ***** ^ not supported yet
  136. 98 confirmed: CHAR;
  137. 99 ok: BOOLEAN;
  138. 100
  139. 101 PROCEDURE UniqueName(testname: ARRAY OF CHAR): BOOLEAN;
  140. ***** ^ not supported yet
  141. 102 VAR i, matches: CARDINAL;
  142. 103 BEGIN
  143. 104 i := 0;
  144. 105 matches := 0;
  145. 106 WHILE (i <= lastfield) DO
  146. 107 IF (M2Strings.CompareStr(fields[i].name, testname) = 0) THEN
  147. ***** ^ not supported yet
  148. ***** ^ not supported yet
  149. ***** ^ not supported yet
  150. ***** ^ not supported yet
  151. ***** ^ not supported yet
  152. ***** ^ not supported yet
  153. 108 INC(matches)
  154. ***** ^ undeclared identifier
  155. ***** ^ not supported yet
  156. 109 END;
  157. 110 INC(i)
  158. ***** ^ undeclared identifier
  159. ***** ^ not supported yet
  160. 111 END;
  161. 112 RETURN matches = 1;
  162. 113 END UniqueName;
  163. ***** ^ not supported yet
  164. 114
  165. 115 BEGIN
  166. 116 WindowPrims.PushColors();
  167. ***** ^ not supported yet
  168. ***** ^ not supported yet
  169. ***** ^ not supported yet
  170. 117 SmartScreen.ClearScreen();
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. ***** ^ not supported yet
  174. 118 i := 0;
  175. 119 pagetop := i;
  176. 120 pagebottom := i+29;
  177. 121 confirmed := 'N';
  178. 122 Say(2, 5, 'NAME------ TYPE SIZE DEC');
  179. ***** ^ undeclared identifier
  180. ***** ^ not supported yet
  181. 123 SmartScreen.SetAttribOrColor( SmartScreen.red,
  182. ***** ^ not supported yet
  183. ***** ^ not supported yet
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. 124 SmartScreen.blue, SmartScreen.ReverseVideo );
  187. ***** ^ not supported yet
  188. ***** ^ not supported yet
  189. ***** ^ not supported yet
  190. ***** ^ not supported yet
  191. 125 REPEAT
  192. 126 crow := (i MOD 15) + 4;
  193. 127 ccol := 5+((i DIV 15) * 35);
  194. 128 Say(crow, ccol, fields[i].name);
  195. ***** ^ undeclared identifier
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. ***** ^ not supported yet
  199. 129 Say(crow, ccol+12, fields[i].fldtype);
  200. ***** ^ undeclared identifier
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. 130 StrConv.CardinalToStr(fields[i].size, 3, sizestring);
  205. ***** ^ not supported yet
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. ***** ^ not supported yet
  210. ***** ^ not supported yet
  211. 131 Say(crow, ccol+18, sizestring);
  212. ***** ^ undeclared identifier
  213. ***** ^ not supported yet
  214. 132 StrConv.CardinalToStr(fields[i].decplaces, 3, decstr);
  215. ***** ^ not supported yet
  216. ***** ^ not supported yet
  217. ***** ^ not supported yet
  218. ***** ^ not supported yet
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. 133 Say(crow, ccol+24, decstr);
  222. ***** ^ undeclared identifier
  223. ***** ^ not supported yet
  224. 134 INC(i);
  225. ***** ^ undeclared identifier
  226. ***** ^ not supported yet
  227. 135 UNTIL (NOT FieldName(fields[i].name)) OR (i >= pagebottom);
  228. ***** ^ not supported yet
  229. ***** ^ not supported yet
  230. ***** ^ not supported yet
  231. ***** ^ not supported yet
  232. 136 lastfield := i-1;
  233. 137 REPEAT
  234. 138 i := 0;
  235. 139 REPEAT
  236. 140 REPEAT
  237. 141 crow := (i MOD 15) + 4;
  238. 142 ccol := 5+((i DIV 15) * 35);
  239. 143 Get(crow, ccol, fields[i].name);
  240. ***** ^ undeclared identifier
  241. ***** ^ not supported yet
  242. ***** ^ not supported yet
  243. ***** ^ not supported yet
  244. 144 Get(crow, ccol + 12, fields[i].fldtype);
  245. ***** ^ undeclared identifier
  246. ***** ^ not supported yet
  247. ***** ^ not supported yet
  248. ***** ^ not supported yet
  249. 145 ReadGets;
  250. ***** ^ undeclared identifier
  251. 146 fields[i].fldtype := CAP(fields[i].fldtype);
  252. ***** ^ not supported yet
  253. ***** ^ not supported yet
  254. ***** ^ not supported yet
  255. ***** ^ undeclared identifier
  256. ***** ^ not supported yet
  257. ***** ^ not supported yet
  258. ***** ^ not supported yet
  259. 147 Upper(fields[i].name);
  260. ***** ^ not supported yet
  261. ***** ^ not supported yet
  262. ***** ^ not supported yet
  263. ***** ^ not supported yet
  264. 148 Say(crow, ccol, fields[i].name);
  265. ***** ^ undeclared identifier
  266. ***** ^ not supported yet
  267. ***** ^ not supported yet
  268. ***** ^ not supported yet
  269. 149 Say(crow, ccol + 12, fields[i].fldtype);
  270. ***** ^ undeclared identifier
  271. ***** ^ not supported yet
  272. ***** ^ not supported yet
  273. ***** ^ not supported yet
  274. 150 UNTIL (FieldName(fields[i].name) AND UniqueName(fields[i].name))
  275. ***** ^ not supported yet
  276. ***** ^ not supported yet
  277. ***** ^ not supported yet
  278. ***** ^ not supported yet
  279. ***** ^ not supported yet
  280. ***** ^ not supported yet
  281. ***** ^ not supported yet
  282. ***** ^ not supported yet
  283. 151 AND (ValidType(fields[i].fldtype))
  284. ***** ^ not supported yet
  285. ***** ^ not supported yet
  286. ***** ^ not supported yet
  287. ***** ^ not supported yet
  288. 152 OR (fields[i].name[0] = ' ')
  289. ***** ^ not supported yet
  290. ***** ^ not supported yet
  291. ***** ^ not supported yet
  292. ***** ^ not supported yet
  293. 153 OR (lastdirection = Escape);
  294. ***** ^ undeclared identifier
  295. ***** ^ undeclared identifier
  296. 154 IF ((fields[i].name[0]) # ' ') AND (lastdirection # Back) THEN
  297. ***** ^ not supported yet
  298. ***** ^ not supported yet
  299. ***** ^ not supported yet
  300. ***** ^ not supported yet
  301. ***** ^ undeclared identifier
  302. ***** ^ undeclared identifier
  303. 155 CASE fields[i].fldtype OF
  304. ***** ^ not supported yet
  305. ***** ^ not supported yet
  306. ***** ^ not supported yet
  307. 156 'D' : fields[i].size := 8 |
  308. ***** ^ not supported yet
  309. ***** ^ not supported yet
  310. ***** ^ not supported yet
  311. 157 'M' : fields[i].size := 10 |
  312. ***** ^ not supported yet
  313. ***** ^ not supported yet
  314. ***** ^ not supported yet
  315. 158 'L' : fields[i].size := 1
  316. ***** ^ not supported yet
  317. ***** ^ not supported yet
  318. ***** ^ not supported yet
  319. 159 ELSE
  320. 160 StrConv.CardinalToStr(fields[i].size, 3, sizestring);
  321. ***** ^ not supported yet
  322. ***** ^ not supported yet
  323. ***** ^ not supported yet
  324. ***** ^ not supported yet
  325. ***** ^ not supported yet
  326. ***** ^ not supported yet
  327. 161 StrConv.CardinalToStr(fields[i].decplaces, 3, decstr);
  328. ***** ^ not supported yet
  329. ***** ^ not supported yet
  330. ***** ^ not supported yet
  331. ***** ^ not supported yet
  332. ***** ^ not supported yet
  333. ***** ^ not supported yet
  334. 162 REPEAT
  335. 163 Get(crow, ccol + 18, sizestring);
  336. ***** ^ undeclared identifier
  337. ***** ^ not supported yet
  338. 164 ReadGets;
  339. ***** ^ undeclared identifier
  340. 165 Trim(sizestring);
  341. ***** ^ not supported yet
  342. ***** ^ not supported yet
  343. 166 ok := StrConv.StrToCardinal(sizestring, 0, fields[i].size);
  344. ***** ^ not supported yet
  345. ***** ^ not supported yet
  346. ***** ^ not supported yet
  347. ***** ^ not supported yet
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. 167 UNTIL ok AND ValidSize(fields[i].size, fields[i].fldtype);
  351. ***** ^ not supported yet
  352. ***** ^ not supported yet
  353. ***** ^ not supported yet
  354. ***** ^ not supported yet
  355. ***** ^ not supported yet
  356. ***** ^ not supported yet
  357. ***** ^ not supported yet
  358. 168 IF fields[i].fldtype = 'N' THEN
  359. ***** ^ not supported yet
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. 169 REPEAT
  363. 170 Get(crow, ccol + 24, decstr);
  364. ***** ^ undeclared identifier
  365. ***** ^ not supported yet
  366. 171 ReadGets;
  367. ***** ^ undeclared identifier
  368. 172 Trim(decstr);
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. 173 ok := StrConv.StrToCardinal(decstr, 0, fields[i].decplaces);
  372. ***** ^ not supported yet
  373. ***** ^ not supported yet
  374. ***** ^ not supported yet
  375. ***** ^ not supported yet
  376. ***** ^ not supported yet
  377. ***** ^ not supported yet
  378. 174 UNTIL ok AND ValidDec(fields[i].size, fields[i].decplaces);
  379. ***** ^ not supported yet
  380. ***** ^ not supported yet
  381. ***** ^ not supported yet
  382. ***** ^ not supported yet
  383. ***** ^ not supported yet
  384. ***** ^ not supported yet
  385. ***** ^ not supported yet
  386. 175 END;
  387. 176 END; (* case *)
  388. 177 END;
  389. 178 IF (i < lastfield) AND (fields[i].name[0] = ' ') THEN
  390. ***** ^ not supported yet
  391. ***** ^ not supported yet
  392. ***** ^ not supported yet
  393. ***** ^ not supported yet
  394. 179 (* the user has deleted a field in mid-record so the subsequent
  395. 180 fields must be 'sucked up' *)
  396. 181 FOR j := i TO lastfield DO
  397. 182 fields[j] := fields[j+1]
  398. ***** ^ not supported yet
  399. ***** ^ not supported yet
  400. ***** ^ not supported yet
  401. ***** ^ not supported yet
  402. 183 END (* for *);
  403. 184 END;
  404. 185 IF lastdirection = Ahead THEN
  405. ***** ^ undeclared identifier
  406. ***** ^ undeclared identifier
  407. 186 IF i < MaxField-1 THEN
  408. 187 IF i >= lastfield THEN INC(lastfield) END;
  409. ***** ^ undeclared identifier
  410. ***** ^ not supported yet
  411. 188 INC(i)
  412. ***** ^ undeclared identifier
  413. ***** ^ not supported yet
  414. 189 END;
  415. 190 ELSIF lastdirection = Back THEN
  416. ***** ^ undeclared identifier
  417. ***** ^ undeclared identifier
  418. 191 IF i > 0 THEN
  419. 192 DEC(i)
  420. ***** ^ undeclared identifier
  421. ***** ^ not supported yet
  422. 193 END;
  423. 194 END;
  424. 195 UNTIL (lastdirection = Escape)
  425. ***** ^ undeclared identifier
  426. ***** ^ undeclared identifier
  427. 196 OR (fields[i-1].name[0] = ' ')
  428. ***** ^ not supported yet
  429. ***** ^ not supported yet
  430. ***** ^ not supported yet
  431. ***** ^ not supported yet
  432. 197 OR (i < pagetop)
  433. 198 OR (i > pagebottom);
  434. 199 (* CONFIRM *)
  435. 200 Say(24,5, 'Enter "Y" to confirm - ');
  436. ***** ^ undeclared identifier
  437. ***** ^ not supported yet
  438. 201 Get(24, 28, confirmed);
  439. ***** ^ undeclared identifier
  440. ***** ^ not supported yet
  441. 202 ReadGets;
  442. ***** ^ undeclared identifier
  443. 203 UNTIL CAP(confirmed) = 'Y';
  444. ***** ^ undeclared identifier
  445. ***** ^ not supported yet
  446. 204 WindowPrims.PopColors();
  447. ***** ^ not supported yet
  448. ***** ^ not supported yet
  449. ***** ^ not supported yet
  450. 205 END GetDescriptors;
  451. ***** ^ not supported yet
  452. 206
  453. 207 PROCEDURE ModifyDBStruc(VAR alias: ModBase3.DBFile);
  454. ***** ^ not supported yet
  455. 208 VAR displayoffset: CARDINAL;
  456. 209 new: ModBase3.DBFile;
  457. ***** ^ not supported yet
  458. 210 BEGIN
  459. 211 (* new = alias;
  460. 212 ChangeExt(alias.name, 'BAK');
  461. 213 (* Rename alias to *.bak *)
  462. 214 Rename(alias.fileID, alias.name);
  463. 215 CloseDBF(alias);
  464. 216
  465. 217 (* Rename alias to *.bak *)
  466. 218 GetDescriptors(new.fieldlist);
  467. 219 BuildDBF(new.name, new.fieldlist, alias);
  468. 220 CloseDBF(alias);
  469. 221 (* UpDate from *.bak *)
  470. 222 *)
  471. 223 END ModifyDBStruc;
  472. ***** ^ not supported yet
  473. 224
  474. 225 (*
  475. 226 PROCEDURE ChangeExt(VAR filename: ARRAY OF CHAR; ext: ARRAY OF CHAR);
  476. 227 (* add the ext after the last period in the filename *)
  477. 228 VAR i, j: CARDINAL;
  478. 229 BEGIN
  479. 230 i := M2Strings.Length(filename)-1;
  480. 231 WHILE (i > 0) AND (filename[i] # '.') DO
  481. 232 DEC(i)
  482. 233 END;
  483. 234 IF i = 0 THEN
  484. 235 i := M2Strings.Length(filename)-1;
  485. 236 END;
  486. 237 FOR j := i+1 TO i+M2Strings.Length(ext)+1 DO
  487. 238 filename[j] := ext[j-(i+1)]
  488. 239 END;
  489. 240 IF HIGH(filename) > (i+M2Strings.Length(ext)+1) THEN
  490. 241 filename[i+M2Strings.Length(ext)] := 0C;
  491. 242 END;
  492. 243 END ChangeExt;
  493. 244 *)
  494. 245
  495. 246 PROCEDURE CreateDBF(dbfilename: ARRAY OF CHAR; VAR alias: ModBase3.DBFile);
  496. ***** ^ not supported yet
  497. ***** ^ not supported yet
  498. 247 VAR descarray: ARRAY [0..MaxField-1] OF ModBase3.DBFieldDescriptor;
  499. ***** ^ not supported yet
  500. ***** ^ not supported yet
  501. 248 i: CARDINAL;
  502. 249 BEGIN
  503. 250 (* initialize field descriptor array *)
  504. 251 FOR i := 0 TO MaxField-1 DO
  505. 252 WITH descarray[i] DO
  506. ***** ^ not supported yet
  507. ***** ^ not supported yet
  508. 253 name := ' ';
  509. ***** ^ undeclared identifier
  510. ***** ^ not supported yet
  511. 254 size := 0;
  512. ***** ^ undeclared identifier
  513. 255 fldtype := ' ';
  514. ***** ^ undeclared identifier
  515. 256 decplaces := 0;
  516. ***** ^ undeclared identifier
  517. 257 offset := 0;
  518. ***** ^ undeclared identifier
  519. 258 END;
  520. ***** ^ not supported yet
  521. 259 END;
  522. 260 GetDescriptors(descarray);
  523. ***** ^ not supported yet
  524. ***** ^ undeclared identifier
  525. 261 IF ModBase3.BuildDBF(descarray,MaxField, alias) # 0 THEN
  526. ***** ^ not supported yet
  527. ***** ^ not supported yet
  528. ***** ^ undeclared identifier
  529. ***** ^ undeclared identifier
  530. 262 ErrorManager.WARN('Unable to create DataBase File')
  531. ***** ^ not supported yet
  532. ***** ^ not supported yet
  533. ***** ^ not supported yet
  534. 263 END;
  535. 264 END CreateDBF;
  536. ***** ^ not supported yet
  537. 265
  538. 266
  539. 267
  540. 268 PROCEDURE Row(): CARDINAL;
  541. 269 VAR row, col: CARDINAL;
  542. 270 BEGIN
  543. 271 WindowPrims.GetCursorCoords( col, row );
  544. ***** ^ not supported yet
  545. ***** ^ not supported yet
  546. ***** ^ not supported yet
  547. 272 RETURN row;
  548. 273 END Row;
  549. ***** ^ not supported yet
  550. 274
  551. 275 PROCEDURE Col(): CARDINAL;
  552. 276 VAR row, col: CARDINAL;
  553. 277 BEGIN
  554. 278 WindowPrims.GetCursorCoords( col, row );
  555. ***** ^ not supported yet
  556. ***** ^ not supported yet
  557. ***** ^ not supported yet
  558. 279 RETURN col;
  559. 280 END Col;
  560. ***** ^ not supported yet
  561. 281
  562. 282
  563. 283 PROCEDURE Say(row, col: CARDINAL; s: ARRAY OF CHAR);
  564. ***** ^ not supported yet
  565. 284 BEGIN
  566. 285 WindowPrims.PushColors();
  567. ***** ^ not supported yet
  568. ***** ^ not supported yet
  569. ***** ^ not supported yet
  570. 286 (* Note that we don't push and pop the cursor size or
  571. 287 position here or in Get, and we don't turn it off,
  572. 288 because we don't want it to flash between fields as they
  573. 289 are initially written. Means you ought to turn it off
  574. 290 before doing a series of Say and Get statements. *)
  575. 291 SmartScreen.SetAttribOrColor( writeattr.fore, writeattr.back,
  576. ***** ^ not supported yet
  577. ***** ^ not supported yet
  578. ***** ^ undeclared identifier
  579. ***** ^ not supported yet
  580. ***** ^ undeclared identifier
  581. ***** ^ not supported yet
  582. 292 writeattr.MonoAttr );
  583. ***** ^ undeclared identifier
  584. ***** ^ not supported yet
  585. 293 SmartScreen.WriteAt( col, row, s );
  586. ***** ^ not supported yet
  587. ***** ^ not supported yet
  588. ***** ^ not supported yet
  589. 294 SmartScreen.GotoXY( SmartScreen.NominalCol,
  590. ***** ^ not supported yet
  591. ***** ^ not supported yet
  592. ***** ^ not supported yet
  593. ***** ^ not supported yet
  594. 295 SmartScreen.NominalRow );
  595. ***** ^ not supported yet
  596. ***** ^ not supported yet
  597. 296 (* The GotoXY guarantees consistent cursor placement between
  598. 297 VideoMethods; in DMA mode, WriteAt doesn't move the
  599. 298 cursor. See documentation for SmartScreen in the
  600. 299 Repertoire manual. *)
  601. 300 WindowPrims.PopColors();
  602. ***** ^ not supported yet
  603. ***** ^ not supported yet
  604. ***** ^ not supported yet
  605. 301 END Say;
  606. ***** ^ not supported yet
  607. 302
  608. 303 PROCEDURE Get(row, col: CARDINAL; VAR s: ARRAY OF CHAR);
  609. ***** ^ not supported yet
  610. 304 BEGIN
  611. 305 WindowPrims.PushColors();
  612. ***** ^ not supported yet
  613. ***** ^ not supported yet
  614. ***** ^ not supported yet
  615. 306 (* pad the string with trailing blanks *)
  616. 307 WHILE M2Strings.Length(s) <= HIGH(s) DO
  617. ***** ^ not supported yet
  618. ***** ^ not supported yet
  619. ***** ^ not supported yet
  620. ***** ^ undeclared identifier
  621. ***** ^ not supported yet
  622. 308 StrEdit.Append( s, Blank );
  623. ***** ^ not supported yet
  624. ***** ^ not supported yet
  625. ***** ^ not supported yet
  626. ***** ^ not supported yet
  627. 309 END;
  628. 310 INC(lastget);
  629. ***** ^ undeclared identifier
  630. ***** ^ not supported yet
  631. 311 input[lastget].row := row;
  632. ***** ^ not supported yet
  633. ***** ^ not supported yet
  634. ***** ^ not supported yet
  635. 312 input[lastget].col := col;
  636. ***** ^ not supported yet
  637. ***** ^ not supported yet
  638. ***** ^ not supported yet
  639. 313 input[lastget].len := HIGH(s)+1;
  640. ***** ^ not supported yet
  641. ***** ^ not supported yet
  642. ***** ^ not supported yet
  643. ***** ^ undeclared identifier
  644. ***** ^ not supported yet
  645. 314 input[lastget].val := SYSTEM.ADR(s);
  646. ***** ^ not supported yet
  647. ***** ^ not supported yet
  648. ***** ^ not supported yet
  649. ***** ^ not supported yet
  650. ***** ^ not supported yet
  651. ***** ^ not supported yet
  652. 315
  653. 316 SmartScreen.SetAttribOrColor( readattr.fore, readattr.back,
  654. ***** ^ not supported yet
  655. ***** ^ not supported yet
  656. ***** ^ undeclared identifier
  657. ***** ^ not supported yet
  658. ***** ^ undeclared identifier
  659. ***** ^ not supported yet
  660. 317 readattr.MonoAttr );
  661. ***** ^ undeclared identifier
  662. ***** ^ not supported yet
  663. 318
  664. 319 SmartScreen.GotoXY( col, row );
  665. ***** ^ not supported yet
  666. ***** ^ not supported yet
  667. ***** ^ not supported yet
  668. 320 SmartScreen.WriteAt( col, row, s );
  669. ***** ^ not supported yet
  670. ***** ^ not supported yet
  671. ***** ^ not supported yet
  672. 321 SmartScreen.GotoXY( SmartScreen.NominalCol,
  673. ***** ^ not supported yet
  674. ***** ^ not supported yet
  675. ***** ^ not supported yet
  676. ***** ^ not supported yet
  677. 322 SmartScreen.NominalRow );
  678. ***** ^ not supported yet
  679. ***** ^ not supported yet
  680. 323 WindowPrims.PopColors();
  681. ***** ^ not supported yet
  682. ***** ^ not supported yet
  683. ***** ^ not supported yet
  684. 324 END Get;
  685. ***** ^ not supported yet
  686. 325
  687. 326
  688. 327 PROCEDURE ReadGets;
  689. 328 VAR
  690. 329 tmpLen, currentget, CursorPos, LastKey : CARDINAL;
  691. 330 ExitKeys: KbdInput.KeyNumSet;
  692. ***** ^ not supported yet
  693. 331 InsertMode: BOOLEAN;
  694. 332 TmpStr: ARRAY [0..128] OF CHAR;
  695. ***** ^ not supported yet
  696. ***** ^ not supported yet
  697. 333 tmpStrPtr: StrPtr;
  698. ***** ^ not supported yet
  699. 334 LocalInput: InputArray;
  700. ***** ^ not supported yet
  701. 335 BEGIN
  702. 336 LocalInput := input;
  703. ***** ^ not supported yet
  704. ***** ^ not supported yet
  705. 337 (* We do this to make the routine easier to follow in the
  706. 338 runtime debugger. The global input variable isn't
  707. 339 normally visible there because it's global to a module
  708. 340 outside the calling chain. *)
  709. 341 WindowPrims.PushColors();
  710. ***** ^ not supported yet
  711. ***** ^ not supported yet
  712. ***** ^ not supported yet
  713. 342 WindowPrims.PushCursorCoords();
  714. ***** ^ not supported yet
  715. ***** ^ not supported yet
  716. ***** ^ not supported yet
  717. 343 (* Insulates calling procedures from the color choices and
  718. 344 cursor-position changes we make here. We don't need to
  719. 345 push and pop the cursor size or turn it off because
  720. 346 ReadWithEdits handles that internally. *)
  721. 347 SmartScreen.SetAttribOrColor( readattr.fore, readattr.back,
  722. ***** ^ not supported yet
  723. ***** ^ not supported yet
  724. ***** ^ undeclared identifier
  725. ***** ^ not supported yet
  726. ***** ^ undeclared identifier
  727. ***** ^ not supported yet
  728. 348 readattr.MonoAttr );
  729. ***** ^ undeclared identifier
  730. ***** ^ not supported yet
  731. 349 InsertMode := TRUE;
  732. 350 BigSets.InitSet( ExitKeys );
  733. ***** ^ not supported yet
  734. ***** ^ not supported yet
  735. ***** ^ not supported yet
  736. 351 BigSets.AppendSet( ExitKeys, '{8, 9, 13, 27, 271, 328, 329, 336, 337}' );
  737. ***** ^ not supported yet
  738. ***** ^ not supported yet
  739. ***** ^ not supported yet
  740. ***** ^ not supported yet
  741. 352 (* Means BackSpace, TAB, BackTab, CR, ESC, and the arrow
  742. 353 keys let you out of a field. *)
  743. 354 IF lastget > 0 THEN
  744. 355 currentget:= 1;
  745. 356 lastdirection := Nowhere;
  746. ***** ^ undeclared identifier
  747. ***** ^ undeclared identifier
  748. 357 WHILE (lastdirection # Escape) AND
  749. ***** ^ undeclared identifier
  750. ***** ^ undeclared identifier
  751. 358 (currentget > 0) AND
  752. 359 (currentget <= lastget) DO
  753. 360 CursorPos := 0;
  754. 361 tmpStrPtr := LocalInput[currentget].val;
  755. ***** ^ not supported yet
  756. ***** ^ not supported yet
  757. ***** ^ not supported yet
  758. ***** ^ not supported yet
  759. 362 (* Break out the steps because otherwise Stony Brook
  760. 363 generates code that causes a protection fault
  761. 364 when the pointer is dereferenced. *)
  762. 365 tmpLen := LocalInput[currentget].len;
  763. ***** ^ not supported yet
  764. ***** ^ not supported yet
  765. ***** ^ not supported yet
  766. 366 LowLevel.Move(tmpStrPtr, SYSTEM.ADR(TmpStr), tmpLen);
  767. ***** ^ not supported yet
  768. ***** ^ not supported yet
  769. ***** ^ not supported yet
  770. ***** ^ not supported yet
  771. ***** ^ not supported yet
  772. ***** ^ not supported yet
  773. ***** ^ not supported yet
  774. 367 (* We have to do this to prevent overflows; since val
  775. 368 points to an area of memory larger than what we are
  776. 369 really considering the variable here, ReadWithEdits
  777. 370 can't reliably tell whether it should put a length
  778. 371 byte at the end of the string. Notice that we can't
  779. 372 use M2Strings.Copy because it will begin by trying to
  780. 373 make a copy of all HIGH+1 bytes of the first argument
  781. 374 on the stack. In this case, they aren't all there.*)
  782. 375 StrInput.ReadWithEdits( VWindows.CurrentWindow, TmpStr,
  783. ***** ^ not supported yet
  784. ***** ^ not supported yet
  785. ***** ^ not supported yet
  786. ***** ^ not supported yet
  787. ***** ^ not supported yet
  788. 376 LocalInput[currentget].col, LocalInput[currentget].row,
  789. ***** ^ not supported yet
  790. ***** ^ not supported yet
  791. ***** ^ not supported yet
  792. ***** ^ not supported yet
  793. ***** ^ not supported yet
  794. ***** ^ not supported yet
  795. 377 LocalInput[currentget].len, CursorPos, InsertMode, FALSE,
  796. ***** ^ not supported yet
  797. ***** ^ not supported yet
  798. ***** ^ not supported yet
  799. 378 LastKey, KbdInput.AnyKeyNum, ExitKeys );
  800. ***** ^ not supported yet
  801. ***** ^ not supported yet
  802. ***** ^ not supported yet
  803. 379
  804. 380 LowLevel.Move( SYSTEM.ADR(TmpStr), LocalInput[currentget].val,
  805. ***** ^ not supported yet
  806. ***** ^ not supported yet
  807. ***** ^ not supported yet
  808. ***** ^ not supported yet
  809. ***** ^ not supported yet
  810. ***** ^ not supported yet
  811. ***** ^ not supported yet
  812. ***** ^ not supported yet
  813. 381 LocalInput[currentget].len );
  814. ***** ^ not supported yet
  815. ***** ^ not supported yet
  816. ***** ^ not supported yet
  817. 382 CASE LastKey OF
  818. 383 BSPnum, BTBnum, LARWnum, UARWnum:
  819. ***** ^ not supported yet
  820. 384 DEC( currentget );
  821. ***** ^ undeclared identifier
  822. ***** ^ not supported yet
  823. 385 lastdirection := Back;
  824. ***** ^ undeclared identifier
  825. ***** ^ undeclared identifier
  826. 386 | CRnum, TABnum, RARWnum, DARWnum:
  827. ***** ^ not supported yet
  828. ***** ^ not supported yet
  829. 387 INC(currentget);
  830. ***** ^ undeclared identifier
  831. ***** ^ not supported yet
  832. 388 lastdirection := Ahead;
  833. ***** ^ undeclared identifier
  834. ***** ^ undeclared identifier
  835. 389 | ESCnum:
  836. ***** ^ not supported yet
  837. 390 lastdirection := Escape
  838. ***** ^ undeclared identifier
  839. ***** ^ undeclared identifier
  840. 391 ELSE (* nothing *)
  841. 392 END;
  842. 393
  843. 394 END; (*WHILE*)
  844. 395
  845. 396 FOR currentget := 1 TO lastget DO
  846. 397 tmpStrPtr := LocalInput[currentget].val;
  847. ***** ^ not supported yet
  848. ***** ^ not supported yet
  849. ***** ^ not supported yet
  850. ***** ^ not supported yet
  851. 398 tmpLen := LocalInput[currentget].len;
  852. ***** ^ not supported yet
  853. ***** ^ not supported yet
  854. ***** ^ not supported yet
  855. 399 LowLevel.Move(tmpStrPtr, SYSTEM.ADR(TmpStr), tmpLen);
  856. ***** ^ not supported yet
  857. ***** ^ not supported yet
  858. ***** ^ not supported yet
  859. ***** ^ not supported yet
  860. ***** ^ not supported yet
  861. ***** ^ not supported yet
  862. ***** ^ not supported yet
  863. 400 (* Same problem here; the procedure that strips the
  864. 401 blanks can't reliably determine where the end of the
  865. 402 string is because we are trying to pass it only a
  866. 403 part of the string. So we copy into a local
  867. 404 variable. *)
  868. 405 StrEdit.CutTrailingChars( Blank, TmpStr );
  869. ***** ^ not supported yet
  870. ***** ^ not supported yet
  871. ***** ^ not supported yet
  872. 406 LowLevel.Move( SYSTEM.ADR(TmpStr), LocalInput[currentget].val,
  873. ***** ^ not supported yet
  874. ***** ^ not supported yet
  875. ***** ^ not supported yet
  876. ***** ^ not supported yet
  877. ***** ^ not supported yet
  878. ***** ^ not supported yet
  879. ***** ^ not supported yet
  880. ***** ^ not supported yet
  881. 407 LocalInput[currentget].len );
  882. ***** ^ not supported yet
  883. ***** ^ not supported yet
  884. ***** ^ not supported yet
  885. 408 END;
  886. 409 lastget := 0;
  887. 410 END; (* if *)
  888. 411 WindowPrims.PopCursorCoords();
  889. ***** ^ not supported yet
  890. ***** ^ not supported yet
  891. ***** ^ not supported yet
  892. 412 WindowPrims.PopColors();
  893. ***** ^ not supported yet
  894. ***** ^ not supported yet
  895. ***** ^ not supported yet
  896. 413 input := LocalInput;
  897. ***** ^ not supported yet
  898. ***** ^ not supported yet
  899. 414 END ReadGets;
  900. ***** ^ not supported yet
  901. 415
  902. 416 BEGIN (* main *)
  903. 417 WITH readattr DO
  904. ***** ^ undeclared identifier
  905. 418 MonoAttr := SmartScreen.ReverseVideo;
  906. ***** ^ undeclared identifier
  907. ***** ^ not supported yet
  908. ***** ^ not supported yet
  909. 419 fore := SmartScreen.blue;
  910. ***** ^ undeclared identifier
  911. ***** ^ not supported yet
  912. ***** ^ not supported yet
  913. 420 back := SmartScreen.lightgrey;
  914. ***** ^ undeclared identifier
  915. ***** ^ not supported yet
  916. ***** ^ not supported yet
  917. 421 END;
  918. ***** ^ not supported yet
  919. 422 WITH writeattr DO
  920. ***** ^ undeclared identifier
  921. 423 MonoAttr := SmartScreen.plain;
  922. ***** ^ undeclared identifier
  923. ***** ^ not supported yet
  924. ***** ^ not supported yet
  925. 424 fore := SmartScreen.lightgrey;
  926. ***** ^ undeclared identifier
  927. ***** ^ not supported yet
  928. ***** ^ not supported yet
  929. 425 back := SmartScreen.blue;
  930. ***** ^ undeclared identifier
  931. ***** ^ not supported yet
  932. ***** ^ not supported yet
  933. 426 END;
  934. ***** ^ not supported yet
  935. 427 lastget := 0;
  936. 428 END DBScreen.
  937. ***** ^ not supported yet
  938. 429
  939. 508 errors