SCRN2NDX.LST 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899
  1. Listing:
  2. 1 IMPLEMENTATION MODULE Scrn2Ndx;
  3. 2 (*
  4. 3 * REPERTOIRE
  5. 4 * Release 1.6
  6. 5 * By Charles Bradford and Cole Brecheen
  7. 6 * (c) Copyright 1985-1992 PMI
  8. 7 * Green Bay, Wisconsin
  9. 8 * All rights reserved
  10. 9 * (414) 468-6040
  11. 10 *
  12. 11 * $Header: D:/logfiles/mods/scrn2ndx.mov 1.5 10 Mar 1991 15:32:02 coleb $
  13. 12 *
  14. 13 *)
  15. 14
  16. 15
  17. 16 IMPORT ControlUtils;
  18. 17 IMPORT GenLists;
  19. 18 IMPORT LowLevel;
  20. 19 IMPORT M2Strings;
  21. 20 IMPORT NdxBones;
  22. 21 IMPORT NdxFiles;
  23. 22 IMPORT NdxTypes;
  24. 23 IMPORT ScrnTypes;
  25. 24 IMPORT ScrnUtl1;
  26. 25 IMPORT StrEdit;
  27. 26 IMPORT SYSTEM;
  28. 27
  29. 28 VAR
  30. 29 Initialized : BOOLEAN;
  31. 30
  32. 31 PROCEDURE Init();
  33. 32 BEGIN
  34. 33 IF Initialized THEN
  35. 34 RETURN;
  36. 35 ELSE
  37. 36 Initialized := TRUE;
  38. 37 END;
  39. 38 ControlUtils.Init();
  40. ***** ^ not supported yet
  41. ***** ^ not supported yet
  42. ***** ^ not supported yet
  43. 39 GenLists.Init();
  44. ***** ^ not supported yet
  45. ***** ^ not supported yet
  46. ***** ^ not supported yet
  47. 40 LowLevel.Init();
  48. ***** ^ not supported yet
  49. ***** ^ not supported yet
  50. ***** ^ not supported yet
  51. 41 M2Strings.Init();
  52. ***** ^ not supported yet
  53. ***** ^ not supported yet
  54. ***** ^ not supported yet
  55. 42 NdxBones.Init();
  56. ***** ^ not supported yet
  57. ***** ^ not supported yet
  58. ***** ^ not supported yet
  59. 43 NdxFiles.Init();
  60. ***** ^ not supported yet
  61. ***** ^ not supported yet
  62. ***** ^ not supported yet
  63. 44 NdxTypes.Init();
  64. ***** ^ not supported yet
  65. ***** ^ not supported yet
  66. ***** ^ not supported yet
  67. 45 ScrnTypes.Init();
  68. ***** ^ not supported yet
  69. ***** ^ not supported yet
  70. ***** ^ not supported yet
  71. 46 ScrnUtl1.Init();
  72. ***** ^ not supported yet
  73. ***** ^ not supported yet
  74. ***** ^ not supported yet
  75. 47 StrEdit.Init();
  76. ***** ^ not supported yet
  77. ***** ^ not supported yet
  78. ***** ^ not supported yet
  79. 48 END Init;
  80. ***** ^ not supported yet
  81. 49
  82. 50 PROCEDURE PutScrRec( VAR NdxFile: NdxTypes.NdxFileType; VAR
  83. ***** ^ not supported yet
  84. 51 TheFrame: ScrnTypes.DisplayFrame; VAR RecName: ARRAY OF CHAR;
  85. ***** ^ not supported yet
  86. ***** ^ not supported yet
  87. 52 KeyField: ARRAY OF CHAR): BOOLEAN;
  88. ***** ^ not supported yet
  89. 53 (* Puts current screen data in out as a record. If RecName is
  90. 54 not null, it contains the record name to use. If RecName is
  91. 55 null, KeyField contains the name of the field on the screen
  92. 56 to use as the Record Name. RecName will always return the
  93. 57 record name used. *)
  94. 58 VAR
  95. 59 FoundAny: BOOLEAN;
  96. 60 FileStr: ARRAY [0..255] OF CHAR;
  97. ***** ^ not supported yet
  98. ***** ^ not supported yet
  99. 61 TmpList, TmpList2: GenLists.GenList;
  100. ***** ^ not supported yet
  101. 62 FieldCount: CARDINAL;
  102. 63 FieldRec: ScrnTypes.InputFieldRecord;
  103. ***** ^ not supported yet
  104. 64 ImageRec: ScrnTypes.ImageElement;
  105. ***** ^ not supported yet
  106. 65
  107. 66 BEGIN
  108. 67 FoundAny := FALSE;
  109. 68 IF M2Strings.Length( RecName) = 0 THEN
  110. ***** ^ not supported yet
  111. ***** ^ not supported yet
  112. ***** ^ not supported yet
  113. 69 (* read record name from field named in KeyField *)
  114. 70 ControlUtils.ReadInput( TheFrame, RecName, KeyField);
  115. ***** ^ not supported yet
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. ***** ^ not supported yet
  119. ***** ^ not supported yet
  120. 71 END;
  121. 72 StrEdit.CrunchBlanks( RecName );
  122. ***** ^ not supported yet
  123. ***** ^ not supported yet
  124. ***** ^ not supported yet
  125. 73 FieldCount := 1;
  126. 74 REPEAT
  127. 75 (* flip through the named fields on screen and put
  128. 76 their values in the record if they are in the
  129. 77 structure *)
  130. 78 ScrnUtl1.GetFieldRec( TheFrame, FieldCount, FieldRec );
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. ***** ^ not supported yet
  134. ***** ^ not supported yet
  135. 79 ScrnUtl1.GetImageRec( TheFrame, FieldRec.ImageNum, ImageRec );
  136. ***** ^ not supported yet
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. ***** ^ not supported yet
  140. ***** ^ not supported yet
  141. ***** ^ not supported yet
  142. 80 IF M2Strings.Length( FieldRec.fnam) # 0 THEN
  143. ***** ^ not supported yet
  144. ***** ^ not supported yet
  145. ***** ^ not supported yet
  146. ***** ^ not supported yet
  147. 81 (* for each named field *)
  148. 82 IF FieldRec.typ # ScrnTypes.GroupMember THEN
  149. ***** ^ not supported yet
  150. ***** ^ not supported yet
  151. ***** ^ not supported yet
  152. ***** ^ not supported yet
  153. 83 (* for any field except a group *)
  154. 84 IF FieldRec.typ = ScrnTypes.EditorCode THEN
  155. ***** ^ not supported yet
  156. ***** ^ not supported yet
  157. ***** ^ not supported yet
  158. ***** ^ not supported yet
  159. 85 (*We store editor fields as sublists.*)
  160. 86 IF ScrnUtl1.ListFromEdField( TheFrame, FieldCount, TmpList ) THEN
  161. ***** ^ not supported yet
  162. ***** ^ not supported yet
  163. ***** ^ not supported yet
  164. ***** ^ not supported yet
  165. 87 GenLists.CopyList( TmpList, TmpList2 );
  166. ***** ^ not supported yet
  167. ***** ^ not supported yet
  168. ***** ^ not supported yet
  169. ***** ^ not supported yet
  170. 88 FoundAny := NdxFiles.PutField( NdxFile, RecName, FieldRec.fnam,
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. ***** ^ not supported yet
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. 89 GenLists.ListCode, TmpList2) OR FoundAny;
  178. ***** ^ not supported yet
  179. ***** ^ not supported yet
  180. ***** ^ not supported yet
  181. 90 END;
  182. 91 ELSE
  183. 92 StrEdit.CutTrailingChars( ' ', ImageRec.text );
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. ***** ^ not supported yet
  187. ***** ^ not supported yet
  188. 93 FoundAny := NdxFiles.PutField( NdxFile, RecName, FieldRec.fnam,
  189. ***** ^ not supported yet
  190. ***** ^ not supported yet
  191. ***** ^ not supported yet
  192. ***** ^ not supported yet
  193. ***** ^ not supported yet
  194. ***** ^ not supported yet
  195. 94 GenLists.StrCode, ImageRec.text ) OR FoundAny;
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. ***** ^ not supported yet
  199. ***** ^ not supported yet
  200. 95 END;
  201. 96 ELSIF FieldRec.selected THEN
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. 97 (* for selected members of a group put a ONE *)
  205. 98 FoundAny := NdxFiles.PutField( NdxFile, RecName, FieldRec.fnam,
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. ***** ^ not supported yet
  210. ***** ^ not supported yet
  211. ***** ^ not supported yet
  212. 99 GenLists.StrCode, '1') OR FoundAny;
  213. ***** ^ not supported yet
  214. ***** ^ not supported yet
  215. ***** ^ not supported yet
  216. 100 ELSE
  217. 101 (* for non-selected members of a group put a NULL *)
  218. 102 FoundAny := NdxFiles.PutField( NdxFile, RecName, FieldRec.fnam,
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. ***** ^ not supported yet
  222. ***** ^ not supported yet
  223. ***** ^ not supported yet
  224. ***** ^ not supported yet
  225. 103 GenLists.StrCode, '') OR FoundAny;
  226. ***** ^ not supported yet
  227. ***** ^ not supported yet
  228. ***** ^ not supported yet
  229. 104 END;
  230. 105 END;
  231. 106 INC( FieldCount );
  232. ***** ^ undeclared identifier
  233. ***** ^ not supported yet
  234. 107 UNTIL FieldCount > ScrnUtl1.FieldListTotal( TheFrame );
  235. ***** ^ not supported yet
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. 108 RETURN FoundAny;
  239. 109 END PutScrRec;
  240. ***** ^ not supported yet
  241. 110
  242. 111 PROCEDURE FillScr( VAR NdxFile: NdxTypes.NdxFileType; VAR
  243. ***** ^ not supported yet
  244. 112 TheFrame: ScrnTypes.DisplayFrame; VAR RecName: ARRAY OF CHAR;
  245. ***** ^ not supported yet
  246. ***** ^ not supported yet
  247. 113 KeyField: ARRAY OF CHAR): BOOLEAN;
  248. ***** ^ not supported yet
  249. 114 (* Fills the current screen with the data from the record named
  250. 115 in RecName if RecName is not null. If RecName is null, KeyField
  251. 116 contains the name of the field on the screen to use as the
  252. 117 Record Name. RecName will always return the record name used.*)
  253. 118 VAR
  254. 119 FoundAny: BOOLEAN;
  255. 120 FileStr, BlankStr: ARRAY [0..255] OF CHAR;
  256. ***** ^ not supported yet
  257. ***** ^ not supported yet
  258. 121 FileLeng, ScrLeng, TheType: CARDINAL;
  259. 122 TmpList, TmpList2: GenLists.GenList;
  260. ***** ^ not supported yet
  261. 123 FieldCount: CARDINAL;
  262. 124 FieldRec: ScrnTypes.InputFieldRecord;
  263. ***** ^ not supported yet
  264. 125 ImageRec: ScrnTypes.ImageElement;
  265. ***** ^ not supported yet
  266. 126
  267. 127 BEGIN
  268. 128 LowLevel.Fill( SYSTEM.ADR( BlankStr), HIGH(BlankStr) + 1, ' ');
  269. ***** ^ not supported yet
  270. ***** ^ not supported yet
  271. ***** ^ not supported yet
  272. ***** ^ not supported yet
  273. ***** ^ not supported yet
  274. ***** ^ undeclared identifier
  275. ***** ^ not supported yet
  276. ***** ^ not supported yet
  277. 129 FoundAny := FALSE;
  278. 130 IF M2Strings.Length( RecName) = 0 THEN
  279. ***** ^ not supported yet
  280. ***** ^ not supported yet
  281. ***** ^ not supported yet
  282. 131 (* read record name from field named in KeyField *)
  283. 132 ControlUtils.ReadInput( TheFrame, RecName, KeyField);
  284. ***** ^ not supported yet
  285. ***** ^ not supported yet
  286. ***** ^ not supported yet
  287. ***** ^ not supported yet
  288. ***** ^ not supported yet
  289. 133 END;
  290. 134 StrEdit.CrunchBlanks( RecName );
  291. ***** ^ not supported yet
  292. ***** ^ not supported yet
  293. ***** ^ not supported yet
  294. 135 FieldCount := 1;
  295. 136 REPEAT
  296. 137 (* flip through the named fields on screen and extract
  297. 138 their value from the file if they exist there *)
  298. 139 ScrnUtl1.GetFieldRec( TheFrame, FieldCount, FieldRec );
  299. ***** ^ not supported yet
  300. ***** ^ not supported yet
  301. ***** ^ not supported yet
  302. ***** ^ not supported yet
  303. 140 ScrnUtl1.GetImageRec( TheFrame, FieldRec.ImageNum, ImageRec );
  304. ***** ^ not supported yet
  305. ***** ^ not supported yet
  306. ***** ^ not supported yet
  307. ***** ^ not supported yet
  308. ***** ^ not supported yet
  309. ***** ^ not supported yet
  310. 141 IF (M2Strings.Length( FieldRec.fnam) # 0) AND
  311. ***** ^ not supported yet
  312. ***** ^ not supported yet
  313. ***** ^ not supported yet
  314. ***** ^ not supported yet
  315. 142 NdxFiles.GetField( NdxFile, RecName, FieldRec.fnam,
  316. ***** ^ not supported yet
  317. ***** ^ not supported yet
  318. ***** ^ not supported yet
  319. ***** ^ not supported yet
  320. ***** ^ not supported yet
  321. ***** ^ not supported yet
  322. 143 TheType, FileStr) THEN
  323. ***** ^ not supported yet
  324. 144 (* for each named field we can get from the file *)
  325. 145 IF FieldRec.typ # ScrnTypes.GroupMember THEN
  326. ***** ^ not supported yet
  327. ***** ^ not supported yet
  328. ***** ^ not supported yet
  329. ***** ^ not supported yet
  330. 146 (* for any field except a group *)
  331. 147 FoundAny := TRUE;
  332. 148 IF TheType = GenLists.StrCode THEN
  333. ***** ^ not supported yet
  334. ***** ^ not supported yet
  335. 149 FileLeng := M2Strings.Length( FileStr);
  336. ***** ^ not supported yet
  337. ***** ^ not supported yet
  338. ***** ^ not supported yet
  339. 150 ScrLeng := M2Strings.Length( ImageRec.text);
  340. ***** ^ not supported yet
  341. ***** ^ not supported yet
  342. ***** ^ not supported yet
  343. ***** ^ not supported yet
  344. 151 IF FileLeng < ScrLeng THEN
  345. 152 (*We need to pad out stored string with blanks to
  346. 153 match length of screen field.*)
  347. 154 StrEdit.SetLength( BlankStr, ScrLeng - FileLeng);
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. ***** ^ not supported yet
  351. ***** ^ not supported yet
  352. 155 StrEdit.Append( FileStr, BlankStr);
  353. ***** ^ not supported yet
  354. ***** ^ not supported yet
  355. ***** ^ not supported yet
  356. ***** ^ not supported yet
  357. 156 END;
  358. 157 IF FieldRec.typ # ScrnTypes.EditorCode THEN
  359. ***** ^ not supported yet
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. ***** ^ not supported yet
  363. 158 StrEdit.AssignStr( FileStr, ImageRec.text);
  364. ***** ^ not supported yet
  365. ***** ^ not supported yet
  366. ***** ^ not supported yet
  367. ***** ^ not supported yet
  368. ***** ^ not supported yet
  369. 159 ELSE
  370. 160 GenLists.NewList( TmpList );
  371. ***** ^ not supported yet
  372. ***** ^ not supported yet
  373. ***** ^ not supported yet
  374. 161 GenLists.ListInsert( FileStr, GenLists.StrCode, TmpList, 1 );
  375. ***** ^ not supported yet
  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. 162 IF NOT ScrnUtl1.ListToEdField( TmpList, TheFrame,
  383. ***** ^ not supported yet
  384. ***** ^ not supported yet
  385. ***** ^ not supported yet
  386. ***** ^ not supported yet
  387. 163 FieldCount ) THEN
  388. ***** ^ not supported yet
  389. 164 HALT();
  390. ***** ^ undeclared identifier
  391. ***** ^ not supported yet
  392. 165 END;
  393. 166 END;
  394. 167 ELSIF TheType = GenLists.ListCode THEN
  395. ***** ^ not supported yet
  396. ***** ^ not supported yet
  397. 168 IF FieldRec.typ = ScrnTypes.EditorCode THEN
  398. ***** ^ not supported yet
  399. ***** ^ not supported yet
  400. ***** ^ not supported yet
  401. ***** ^ not supported yet
  402. 169 (*Make sure it's an editor field before we fill
  403. 170 it with a list.*)
  404. 171 IF NdxFiles.GetField( NdxFile, RecName,
  405. ***** ^ not supported yet
  406. ***** ^ not supported yet
  407. ***** ^ not supported yet
  408. ***** ^ not supported yet
  409. 172 FieldRec.fnam, TheType, TmpList ) THEN
  410. ***** ^ not supported yet
  411. ***** ^ not supported yet
  412. ***** ^ not supported yet
  413. 173 GenLists.CopyList( TmpList, TmpList2 );
  414. ***** ^ not supported yet
  415. ***** ^ not supported yet
  416. ***** ^ not supported yet
  417. ***** ^ not supported yet
  418. 174 IF NOT ScrnUtl1.ListToEdField( TmpList2, TheFrame,
  419. ***** ^ not supported yet
  420. ***** ^ not supported yet
  421. ***** ^ not supported yet
  422. ***** ^ not supported yet
  423. 175 FieldCount ) THEN
  424. ***** ^ not supported yet
  425. 176 HALT();
  426. ***** ^ undeclared identifier
  427. ***** ^ not supported yet
  428. 177 END;
  429. 178 END;
  430. 179 END;
  431. 180 (*You could add additional data conversion operations
  432. 181 here.*)
  433. 182 END;
  434. 183 ELSE
  435. 184 (* for members of a group *)
  436. 185 FoundAny := TRUE;
  437. 186 FieldRec.selected := M2Strings.Length( FileStr) # 0;
  438. ***** ^ not supported yet
  439. ***** ^ not supported yet
  440. ***** ^ not supported yet
  441. ***** ^ not supported yet
  442. ***** ^ not supported yet
  443. 187 (* this simple logic assumes that the groups are the
  444. 188 same on input and display screens *)
  445. 189 END;
  446. 190 ScrnUtl1.PutFieldImageRec( ImageRec, TheFrame, FieldCount );
  447. ***** ^ not supported yet
  448. ***** ^ not supported yet
  449. ***** ^ not supported yet
  450. ***** ^ not supported yet
  451. ***** ^ not supported yet
  452. 191 ScrnUtl1.PutFieldRec( FieldRec, TheFrame, FieldCount );
  453. ***** ^ not supported yet
  454. ***** ^ not supported yet
  455. ***** ^ not supported yet
  456. ***** ^ not supported yet
  457. ***** ^ not supported yet
  458. 192 END;
  459. 193 INC( FieldCount );
  460. ***** ^ undeclared identifier
  461. ***** ^ not supported yet
  462. 194 UNTIL FieldCount > ScrnUtl1.FieldListTotal( TheFrame );
  463. ***** ^ not supported yet
  464. ***** ^ not supported yet
  465. ***** ^ not supported yet
  466. 195 RETURN FoundAny;
  467. 196 END FillScr;
  468. ***** ^ not supported yet
  469. 197
  470. 198
  471. 199 PROCEDURE PutScrFast( VAR NdxFile: NdxTypes.NdxFileType; VAR
  472. ***** ^ not supported yet
  473. 200 TheFrame: ScrnTypes.DisplayFrame; VAR RecName: ARRAY OF CHAR;
  474. ***** ^ not supported yet
  475. ***** ^ not supported yet
  476. 201 KeyField: ARRAY OF CHAR): BOOLEAN;
  477. ***** ^ not supported yet
  478. 202 (* Works like PutScrRec except that it requires an exact match
  479. 203 between all named fields in the screen and the file record *)
  480. 204 VAR
  481. 205 Selctd: BOOLEAN;
  482. 206 FileStr: ARRAY [0..255] OF CHAR;
  483. ***** ^ not supported yet
  484. ***** ^ not supported yet
  485. 207 TmpList, TmpList2: GenLists.GenList;
  486. ***** ^ not supported yet
  487. 208 FileCntr, FileStructLen: CARDINAL;
  488. 209 FieldCount: CARDINAL;
  489. 210 FieldRec: ScrnTypes.InputFieldRecord;
  490. ***** ^ not supported yet
  491. 211 ImageRec: ScrnTypes.ImageElement;
  492. ***** ^ not supported yet
  493. 212
  494. 213 BEGIN
  495. 214 IF M2Strings.Length( RecName) = 0 THEN
  496. ***** ^ not supported yet
  497. ***** ^ not supported yet
  498. ***** ^ not supported yet
  499. 215 (* read record name from field named in KeyField *)
  500. 216 ControlUtils.ReadInput( TheFrame, RecName, KeyField);
  501. ***** ^ not supported yet
  502. ***** ^ not supported yet
  503. ***** ^ not supported yet
  504. ***** ^ not supported yet
  505. ***** ^ not supported yet
  506. 217 END;
  507. 218 StrEdit.CrunchBlanks( RecName );
  508. ***** ^ not supported yet
  509. ***** ^ not supported yet
  510. ***** ^ not supported yet
  511. 219 IF NOT NdxBones.InitBuffer( NdxFile, RecName) THEN
  512. ***** ^ not supported yet
  513. ***** ^ not supported yet
  514. ***** ^ not supported yet
  515. ***** ^ not supported yet
  516. 220 (* Loads file buffer with desired record; false result
  517. 221 probably indicates we're creating a new record, but
  518. 222 could actually indicate an error. We trust that we
  519. 223 will catch an error below. *)
  520. 224 END;
  521. 225 FieldCount := 1;
  522. 226 FileCntr := 0;
  523. 227 (* used to count fields written to record *)
  524. 228 FileStructLen := GenLists.ListLength( NdxFile^.ListBuf);
  525. ***** ^ not supported yet
  526. ***** ^ not supported yet
  527. ***** ^ not supported yet
  528. ***** ^ not supported yet
  529. 229 REPEAT
  530. 230 (* flip through the named fields on screen and store
  531. 231 each in the record *)
  532. 232 ScrnUtl1.GetFieldRec( TheFrame, FieldCount, FieldRec );
  533. ***** ^ not supported yet
  534. ***** ^ not supported yet
  535. ***** ^ not supported yet
  536. ***** ^ not supported yet
  537. 233 ScrnUtl1.GetImageRec( TheFrame, FieldRec.ImageNum, ImageRec );
  538. ***** ^ not supported yet
  539. ***** ^ not supported yet
  540. ***** ^ not supported yet
  541. ***** ^ not supported yet
  542. ***** ^ not supported yet
  543. ***** ^ not supported yet
  544. 234 IF M2Strings.Length( FieldRec.fnam) # 0 THEN
  545. ***** ^ not supported yet
  546. ***** ^ not supported yet
  547. ***** ^ not supported yet
  548. ***** ^ not supported yet
  549. 235 (* for each named field *)
  550. 236 INC( FileCntr);
  551. ***** ^ undeclared identifier
  552. ***** ^ not supported yet
  553. 237 (* go to next field in file *)
  554. 238 IF FileCntr > FileStructLen THEN
  555. 239 RETURN FALSE;
  556. 240 END;
  557. 241 IF FieldRec.typ # ScrnTypes.GroupMember THEN
  558. ***** ^ not supported yet
  559. ***** ^ not supported yet
  560. ***** ^ not supported yet
  561. ***** ^ not supported yet
  562. 242 (* for any field except a group *)
  563. 243 IF FieldRec.typ = ScrnTypes.EditorCode THEN
  564. ***** ^ not supported yet
  565. ***** ^ not supported yet
  566. ***** ^ not supported yet
  567. ***** ^ not supported yet
  568. 244 (*We store editor fields as sublists.*)
  569. 245 IF ScrnUtl1.ListFromEdField( TheFrame, FieldCount, TmpList ) THEN
  570. ***** ^ not supported yet
  571. ***** ^ not supported yet
  572. ***** ^ not supported yet
  573. ***** ^ not supported yet
  574. 246 GenLists.CopyList( TmpList, TmpList2 );
  575. ***** ^ not supported yet
  576. ***** ^ not supported yet
  577. ***** ^ not supported yet
  578. ***** ^ not supported yet
  579. 247 GenLists.ListReplace( TmpList2, GenLists.ListCode,
  580. ***** ^ not supported yet
  581. ***** ^ not supported yet
  582. ***** ^ not supported yet
  583. ***** ^ not supported yet
  584. ***** ^ not supported yet
  585. 248 NdxFile^.ListBuf, FileCntr);
  586. ***** ^ not supported yet
  587. ***** ^ not supported yet
  588. ***** ^ not supported yet
  589. 249 END;
  590. 250 ELSE
  591. 251 StrEdit.CutTrailingChars( ' ', ImageRec.text );
  592. ***** ^ not supported yet
  593. ***** ^ not supported yet
  594. ***** ^ not supported yet
  595. ***** ^ not supported yet
  596. 252 GenLists.ListReplace( ImageRec.text, GenLists.StrCode,
  597. ***** ^ not supported yet
  598. ***** ^ not supported yet
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. ***** ^ not supported yet
  602. ***** ^ not supported yet
  603. 253 NdxFile^.ListBuf, FileCntr);
  604. ***** ^ not supported yet
  605. ***** ^ not supported yet
  606. ***** ^ not supported yet
  607. 254 END;
  608. 255 ELSIF FieldRec.selected THEN
  609. ***** ^ not supported yet
  610. ***** ^ not supported yet
  611. 256 (* for selected members of a group put a ONE *)
  612. 257 GenLists.ListReplace( '1', GenLists.StrCode,
  613. ***** ^ not supported yet
  614. ***** ^ not supported yet
  615. ***** ^ not supported yet
  616. ***** ^ not supported yet
  617. 258 NdxFile^.ListBuf, FileCntr);
  618. ***** ^ not supported yet
  619. ***** ^ not supported yet
  620. ***** ^ not supported yet
  621. 259 ELSE
  622. 260 (* for non-selected members of a group put a NULL *)
  623. 261 GenLists.ListReplace( '', GenLists.StrCode,
  624. ***** ^ not supported yet
  625. ***** ^ not supported yet
  626. ***** ^ not supported yet
  627. ***** ^ not supported yet
  628. 262 NdxFile^.ListBuf, FileCntr);
  629. ***** ^ not supported yet
  630. ***** ^ not supported yet
  631. ***** ^ not supported yet
  632. 263 END;
  633. 264 END;
  634. 265 INC( FieldCount );
  635. ***** ^ undeclared identifier
  636. ***** ^ not supported yet
  637. 266 UNTIL FieldCount > ScrnUtl1.FieldListTotal( TheFrame );
  638. ***** ^ not supported yet
  639. ***** ^ not supported yet
  640. ***** ^ not supported yet
  641. 267 RETURN TRUE;
  642. 268 END PutScrFast;
  643. ***** ^ not supported yet
  644. 269
  645. 270
  646. 271 PROCEDURE FillScrFast( VAR NdxFile: NdxTypes.NdxFileType; VAR
  647. ***** ^ not supported yet
  648. 272 TheFrame: ScrnTypes.DisplayFrame; VAR RecName: ARRAY OF CHAR;
  649. ***** ^ not supported yet
  650. ***** ^ not supported yet
  651. 273 KeyField: ARRAY OF CHAR): BOOLEAN;
  652. ***** ^ not supported yet
  653. 274 (* Fills the current screen with the data from a record. Works
  654. 275 like FillScr except that it requires an exact match between all
  655. 276 named fields in the screen and the fields in the file record *)
  656. 277 VAR
  657. 278 Selctd : BOOLEAN;
  658. 279 FileStr, BlankStr: ARRAY [0..255] OF CHAR;
  659. ***** ^ not supported yet
  660. ***** ^ not supported yet
  661. 280 FileLeng, ScrLeng, TheType, FileCntr,
  662. 281 FileStructLen: CARDINAL;
  663. 282 TmpList, TmpList2: GenLists.GenList;
  664. ***** ^ not supported yet
  665. 283 FieldCount: CARDINAL;
  666. 284 FieldRec: ScrnTypes.InputFieldRecord;
  667. ***** ^ not supported yet
  668. 285 ImageRec: ScrnTypes.ImageElement;
  669. ***** ^ not supported yet
  670. 286
  671. 287 BEGIN
  672. 288 LowLevel.Fill( SYSTEM.ADR( BlankStr), HIGH(BlankStr) + 1, ' ');
  673. ***** ^ not supported yet
  674. ***** ^ not supported yet
  675. ***** ^ not supported yet
  676. ***** ^ not supported yet
  677. ***** ^ not supported yet
  678. ***** ^ undeclared identifier
  679. ***** ^ not supported yet
  680. ***** ^ not supported yet
  681. 289 IF M2Strings.Length( RecName) = 0 THEN
  682. ***** ^ not supported yet
  683. ***** ^ not supported yet
  684. ***** ^ not supported yet
  685. 290 (* read record name from field named in KeyField *)
  686. 291 ControlUtils.ReadInput( TheFrame, RecName, KeyField);
  687. ***** ^ not supported yet
  688. ***** ^ not supported yet
  689. ***** ^ not supported yet
  690. ***** ^ not supported yet
  691. ***** ^ not supported yet
  692. 292 END;
  693. 293 StrEdit.CrunchBlanks( RecName );
  694. ***** ^ not supported yet
  695. ***** ^ not supported yet
  696. ***** ^ not supported yet
  697. 294 IF NOT NdxBones.InitBuffer( NdxFile, RecName) THEN
  698. ***** ^ not supported yet
  699. ***** ^ not supported yet
  700. ***** ^ not supported yet
  701. ***** ^ not supported yet
  702. 295 (* loads file buffer with desired record *)
  703. 296 RETURN FALSE;
  704. 297 END;
  705. 298 FieldCount := 1;
  706. 299 FileCntr := 0;
  707. 300 FileStructLen := GenLists.ListLength( NdxFile^.ListBuf);
  708. ***** ^ not supported yet
  709. ***** ^ not supported yet
  710. ***** ^ not supported yet
  711. ***** ^ not supported yet
  712. 301 REPEAT
  713. 302 (* flip through the named fields on screen and, for
  714. 303 each, extract the next field in the file record *)
  715. 304 ScrnUtl1.GetFieldRec( TheFrame, FieldCount, FieldRec );
  716. ***** ^ not supported yet
  717. ***** ^ not supported yet
  718. ***** ^ not supported yet
  719. ***** ^ not supported yet
  720. 305 ScrnUtl1.GetImageRec( TheFrame, FieldRec.ImageNum, ImageRec );
  721. ***** ^ not supported yet
  722. ***** ^ not supported yet
  723. ***** ^ not supported yet
  724. ***** ^ not supported yet
  725. ***** ^ not supported yet
  726. ***** ^ not supported yet
  727. 306 IF M2Strings.Length( FieldRec.fnam) # 0 THEN
  728. ***** ^ not supported yet
  729. ***** ^ not supported yet
  730. ***** ^ not supported yet
  731. ***** ^ not supported yet
  732. 307 (* for each named field *)
  733. 308 INC( FileCntr);
  734. ***** ^ undeclared identifier
  735. ***** ^ not supported yet
  736. 309 (* go to next field in file *)
  737. 310 IF FileCntr > FileStructLen THEN
  738. 311 RETURN FALSE;
  739. 312 END;
  740. 313 GenLists.GetElmt( NdxFile^.ListBuf, FileCntr, FileStr, TheType);
  741. ***** ^ not supported yet
  742. ***** ^ not supported yet
  743. ***** ^ not supported yet
  744. ***** ^ not supported yet
  745. ***** ^ not supported yet
  746. ***** ^ not supported yet
  747. 314 (*Read file value.*)
  748. 315 IF FieldRec.typ # ScrnTypes.GroupMember THEN
  749. ***** ^ not supported yet
  750. ***** ^ not supported yet
  751. ***** ^ not supported yet
  752. ***** ^ not supported yet
  753. 316 (* for any field except a group *)
  754. 317 IF TheType = GenLists.StrCode THEN
  755. ***** ^ not supported yet
  756. ***** ^ not supported yet
  757. 318 FileLeng := M2Strings.Length( FileStr);
  758. ***** ^ not supported yet
  759. ***** ^ not supported yet
  760. ***** ^ not supported yet
  761. 319 ScrLeng := M2Strings.Length( ImageRec.text);
  762. ***** ^ not supported yet
  763. ***** ^ not supported yet
  764. ***** ^ not supported yet
  765. ***** ^ not supported yet
  766. 320 IF FileLeng < ScrLeng THEN
  767. 321 (*We need to pad out stored string with blanks to
  768. 322 match length of screen field.*)
  769. 323 StrEdit.SetLength( BlankStr, ScrLeng - FileLeng);
  770. ***** ^ not supported yet
  771. ***** ^ not supported yet
  772. ***** ^ not supported yet
  773. ***** ^ not supported yet
  774. 324 StrEdit.Append( FileStr, BlankStr);
  775. ***** ^ not supported yet
  776. ***** ^ not supported yet
  777. ***** ^ not supported yet
  778. ***** ^ not supported yet
  779. 325 END;
  780. 326 IF FieldRec.typ # ScrnTypes.EditorCode THEN
  781. ***** ^ not supported yet
  782. ***** ^ not supported yet
  783. ***** ^ not supported yet
  784. ***** ^ not supported yet
  785. 327 StrEdit.AssignStr( FileStr, ImageRec.text);
  786. ***** ^ not supported yet
  787. ***** ^ not supported yet
  788. ***** ^ not supported yet
  789. ***** ^ not supported yet
  790. ***** ^ not supported yet
  791. 328 ELSE
  792. 329 GenLists.NewList( TmpList );
  793. ***** ^ not supported yet
  794. ***** ^ not supported yet
  795. ***** ^ not supported yet
  796. 330 GenLists.ListInsert( FileStr, GenLists.StrCode, TmpList, 1 );
  797. ***** ^ not supported yet
  798. ***** ^ not supported yet
  799. ***** ^ not supported yet
  800. ***** ^ not supported yet
  801. ***** ^ not supported yet
  802. ***** ^ not supported yet
  803. ***** ^ not supported yet
  804. 331 IF NOT ScrnUtl1.ListToEdField( TmpList, TheFrame,
  805. ***** ^ not supported yet
  806. ***** ^ not supported yet
  807. ***** ^ not supported yet
  808. ***** ^ not supported yet
  809. 332 FieldCount ) THEN
  810. ***** ^ not supported yet
  811. 333 HALT();
  812. ***** ^ undeclared identifier
  813. ***** ^ not supported yet
  814. 334 END;
  815. 335 END;
  816. 336 ELSIF TheType = GenLists.ListCode THEN
  817. ***** ^ not supported yet
  818. ***** ^ not supported yet
  819. 337 IF FieldRec.typ = ScrnTypes.EditorCode THEN
  820. ***** ^ not supported yet
  821. ***** ^ not supported yet
  822. ***** ^ not supported yet
  823. ***** ^ not supported yet
  824. 338 (*Make sure it's an editor field before we fill
  825. 339 it with a list.*)
  826. 340 GenLists.GetChildList( NdxFile^.ListBuf, FileCntr, TmpList);
  827. ***** ^ not supported yet
  828. ***** ^ not supported yet
  829. ***** ^ not supported yet
  830. ***** ^ not supported yet
  831. ***** ^ not supported yet
  832. 341 GenLists.CopyList( TmpList, TmpList2 );
  833. ***** ^ not supported yet
  834. ***** ^ not supported yet
  835. ***** ^ not supported yet
  836. ***** ^ not supported yet
  837. 342 IF NOT ScrnUtl1.ListToEdField( TmpList2, TheFrame,
  838. ***** ^ not supported yet
  839. ***** ^ not supported yet
  840. ***** ^ not supported yet
  841. ***** ^ not supported yet
  842. 343 FieldCount ) THEN
  843. ***** ^ not supported yet
  844. 344 HALT();
  845. ***** ^ undeclared identifier
  846. ***** ^ not supported yet
  847. 345 END;
  848. 346 END;
  849. 347 (*You could add additional data conversion operations
  850. 348 here.*)
  851. 349 END;
  852. 350 ELSE
  853. 351 (* for members of a group *)
  854. 352 FieldRec.selected := M2Strings.Length( FileStr) # 0;
  855. ***** ^ not supported yet
  856. ***** ^ not supported yet
  857. ***** ^ not supported yet
  858. ***** ^ not supported yet
  859. ***** ^ not supported yet
  860. 353 (* this simple logic assumes that the groups are the
  861. 354 same on input and display screens *)
  862. 355 END;
  863. 356 ScrnUtl1.PutFieldImageRec( ImageRec, TheFrame, FieldCount );
  864. ***** ^ not supported yet
  865. ***** ^ not supported yet
  866. ***** ^ not supported yet
  867. ***** ^ not supported yet
  868. ***** ^ not supported yet
  869. 357 ScrnUtl1.PutFieldRec( FieldRec, TheFrame, FieldCount );
  870. ***** ^ not supported yet
  871. ***** ^ not supported yet
  872. ***** ^ not supported yet
  873. ***** ^ not supported yet
  874. ***** ^ not supported yet
  875. 358 END;
  876. 359 INC( FieldCount );
  877. ***** ^ undeclared identifier
  878. ***** ^ not supported yet
  879. 360 UNTIL FieldCount > ScrnUtl1.FieldListTotal( TheFrame );
  880. ***** ^ not supported yet
  881. ***** ^ not supported yet
  882. ***** ^ not supported yet
  883. 361 RETURN TRUE;
  884. 362 END FillScrFast;
  885. ***** ^ not supported yet
  886. 363
  887. 364
  888. 365 BEGIN
  889. 366 Initialized := FALSE;
  890. 367 Init();
  891. ***** ^ not supported yet
  892. ***** ^ not supported yet
  893. 368 END Scrn2Ndx.
  894. ***** ^ not supported yet
  895. 525 errors