DIRMANAG.LST 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. Listing:
  2. 1 IMPLEMENTATION MODULE DirManager;
  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/dirmanag.mov 1.5 10 Mar 1991 15:26:24 coleb $
  13. 12 *
  14. 13 *)
  15. 14
  16. 15
  17. 16 IMPORT ControlUtils;
  18. 17 IMPORT Drectory;
  19. 18 IMPORT ErrStrgs;
  20. 19 IMPORT InputManager;
  21. 20 IMPORT FramePainter;
  22. 21 IMPORT M2Strings;
  23. 22 IMPORT PosUtils;
  24. 23 IMPORT ScrnTypes;
  25. 24 IMPORT ScrnUtl1;
  26. 25 IMPORT StrConv;
  27. 26 IMPORT StrEdit;
  28. 27 IMPORT StringIO;
  29. 28
  30. 29
  31. 30 VAR
  32. 31 Initialized : BOOLEAN;
  33. 32
  34. 33 PROCEDURE Init();
  35. 34 BEGIN
  36. 35 IF Initialized THEN
  37. 36 RETURN;
  38. 37 ELSE
  39. 38 Initialized := TRUE;
  40. 39 END;
  41. 40 ControlUtils.Init();
  42. ***** ^ not supported yet
  43. ***** ^ not supported yet
  44. ***** ^ not supported yet
  45. 41 Drectory.Init();
  46. ***** ^ not supported yet
  47. ***** ^ not supported yet
  48. ***** ^ not supported yet
  49. 42 ErrStrgs.Init();
  50. ***** ^ not supported yet
  51. ***** ^ not supported yet
  52. ***** ^ not supported yet
  53. 43 InputManager.Init();
  54. ***** ^ not supported yet
  55. ***** ^ not supported yet
  56. ***** ^ not supported yet
  57. 44 FramePainter.Init();
  58. ***** ^ not supported yet
  59. ***** ^ not supported yet
  60. ***** ^ not supported yet
  61. 45 M2Strings.Init();
  62. ***** ^ not supported yet
  63. ***** ^ not supported yet
  64. ***** ^ not supported yet
  65. 46 PosUtils.Init();
  66. ***** ^ not supported yet
  67. ***** ^ not supported yet
  68. ***** ^ not supported yet
  69. 47 ScrnTypes.Init();
  70. ***** ^ not supported yet
  71. ***** ^ not supported yet
  72. ***** ^ not supported yet
  73. 48 ScrnUtl1.Init();
  74. ***** ^ not supported yet
  75. ***** ^ not supported yet
  76. ***** ^ not supported yet
  77. 49 StrConv.Init();
  78. ***** ^ not supported yet
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. 50 StrEdit.Init();
  82. ***** ^ not supported yet
  83. ***** ^ not supported yet
  84. ***** ^ not supported yet
  85. 51 StringIO.Init();
  86. ***** ^ not supported yet
  87. ***** ^ not supported yet
  88. ***** ^ not supported yet
  89. 52 END Init;
  90. ***** ^ not supported yet
  91. 53
  92. 54
  93. 55 PROCEDURE MakeFileDataStr( FileInfo: Drectory.FileInfoRec; Columns:
  94. ***** ^ not supported yet
  95. 56 CARDINAL; VAR TheStr: ARRAY OF CHAR );
  96. ***** ^ not supported yet
  97. 57 VAR
  98. 58 dumstr: ARRAY [0..79] OF CHAR;
  99. ***** ^ not supported yet
  100. ***** ^ not supported yet
  101. 59 BEGIN
  102. 60 StrEdit.AssignStr( FileInfo.name, TheStr );
  103. ***** ^ not supported yet
  104. ***** ^ not supported yet
  105. ***** ^ not supported yet
  106. ***** ^ not supported yet
  107. ***** ^ not supported yet
  108. 61 M2Strings.Concat(' ',TheStr,TheStr);
  109. ***** ^ not supported yet
  110. ***** ^ not supported yet
  111. ***** ^ not supported yet
  112. ***** ^ not supported yet
  113. 62 IF Columns > 1 THEN
  114. 63 WHILE M2Strings.Length(TheStr) < 12 DO
  115. ***** ^ not supported yet
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. 64 StrEdit.Append( TheStr, ' ' );
  119. ***** ^ not supported yet
  120. ***** ^ not supported yet
  121. ***** ^ not supported yet
  122. ***** ^ not supported yet
  123. 65 END;
  124. 66 IF Drectory.SubdirectoryFile IN FileInfo.attribute THEN
  125. ***** ^ not supported yet
  126. ***** ^ not supported yet
  127. ***** ^ not supported yet
  128. ***** ^ not supported yet
  129. 67 StrEdit.Append( TheStr, ' <DIR>' );
  130. ***** ^ not supported yet
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. ***** ^ not supported yet
  134. 68 ELSE
  135. 69 StrConv.LongIntegerToStr( FileInfo.size, 8, dumstr );
  136. ***** ^ not supported yet
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. ***** ^ not supported yet
  140. ***** ^ not supported yet
  141. 70 StrEdit.Append( TheStr, dumstr );
  142. ***** ^ not supported yet
  143. ***** ^ not supported yet
  144. ***** ^ not supported yet
  145. ***** ^ not supported yet
  146. 71 END;
  147. 72 END;
  148. 73 IF Columns > 2 THEN
  149. 74 StrConv.DateToStr( FileInfo.month, FileInfo.day, FileInfo.year,
  150. ***** ^ not supported yet
  151. ***** ^ not supported yet
  152. ***** ^ not supported yet
  153. ***** ^ not supported yet
  154. ***** ^ not supported yet
  155. ***** ^ not supported yet
  156. ***** ^ not supported yet
  157. ***** ^ not supported yet
  158. 75 dumstr );
  159. ***** ^ not supported yet
  160. 76 StrEdit.Append( TheStr, ' ' );
  161. ***** ^ not supported yet
  162. ***** ^ not supported yet
  163. ***** ^ not supported yet
  164. ***** ^ not supported yet
  165. 77 StrEdit.Append( TheStr, dumstr );
  166. ***** ^ not supported yet
  167. ***** ^ not supported yet
  168. ***** ^ not supported yet
  169. ***** ^ not supported yet
  170. 78 END;
  171. 79 IF Columns > 3 THEN
  172. 80 StrConv.TimeToStr( FileInfo.hour, FileInfo.minute, FileInfo.second,
  173. ***** ^ not supported yet
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. ***** ^ not supported yet
  179. ***** ^ not supported yet
  180. ***** ^ not supported yet
  181. 81 FileInfo.second, dumstr );
  182. ***** ^ not supported yet
  183. ***** ^ not supported yet
  184. ***** ^ not supported yet
  185. 82 M2Strings.Delete( dumstr, M2Strings.Length(dumstr) - 7, 6 );
  186. ***** ^ not supported yet
  187. ***** ^ not supported yet
  188. ***** ^ not supported yet
  189. ***** ^ not supported yet
  190. ***** ^ not supported yet
  191. ***** ^ not supported yet
  192. ***** ^ not supported yet
  193. 83 StrEdit.Append( TheStr, ' ' );
  194. ***** ^ not supported yet
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. 84 StrEdit.Append( TheStr, dumstr );
  199. ***** ^ not supported yet
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. 85 END;
  204. 86 END MakeFileDataStr;
  205. ***** ^ not supported yet
  206. 87
  207. 88 PROCEDURE DirToFrame( FileSpec: ARRAY OF CHAR; TheFrame:
  208. ***** ^ not supported yet
  209. 89 ScrnTypes.DisplayFrame; ColumnsPerFile: CARDINAL ): CARDINAL;
  210. ***** ^ not supported yet
  211. 90 VAR
  212. 91 lngth1, VertSep, HorizSep, NextCol, NextRow: CARDINAL;
  213. 92 DirHandle, SavedMessage: CARDINAL;
  214. 93 InfoRec: Drectory.FileInfoRec;
  215. ***** ^ not supported yet
  216. 94 tmpstr: ARRAY [0..79] OF CHAR;
  217. ***** ^ not supported yet
  218. ***** ^ not supported yet
  219. 95 LastCh: CHAR;
  220. 96
  221. 97 PROCEDURE AddOne( VAR TheStr: ARRAY OF CHAR; VAR col, row:
  222. ***** ^ not supported yet
  223. 98 CARDINAL );
  224. 99 VAR
  225. 100 width: CARDINAL;
  226. 101 BEGIN
  227. 102 ControlUtils.AddMenuItem( TheFrame, col, row, TheStr,
  228. ***** ^ not supported yet
  229. ***** ^ not supported yet
  230. ***** ^ not supported yet
  231. ***** ^ not supported yet
  232. 103 M2Strings.Length(TheStr), 0, TheFrame^.normlnext );
  233. ***** ^ not supported yet
  234. ***** ^ not supported yet
  235. ***** ^ not supported yet
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. 104 IF ColumnsPerFile > 1 THEN
  239. 105 width := M2Strings.Length(TheStr) + HorizSep;
  240. ***** ^ not supported yet
  241. ***** ^ not supported yet
  242. ***** ^ not supported yet
  243. 106 ELSE
  244. 107 width := 12 + HorizSep;
  245. 108 END;
  246. 109 INC( col, width );
  247. ***** ^ undeclared identifier
  248. ***** ^ not supported yet
  249. 110 IF (col + width) > (TheFrame^.endcol
  250. ***** ^ not supported yet
  251. ***** ^ not supported yet
  252. 111 + 1) THEN
  253. 112 col := HorizSep;
  254. 113 INC( row, VertSep );
  255. ***** ^ undeclared identifier
  256. ***** ^ not supported yet
  257. 114 END;
  258. 115 END AddOne;
  259. ***** ^ not supported yet
  260. 116
  261. 117 BEGIN
  262. 118 (*DirToFrame*)
  263. 119 VertSep := 1;
  264. 120 HorizSep := 4;
  265. 121 NextCol := HorizSep;
  266. 122 NextRow := VertSep + TheFrame^.headline;
  267. ***** ^ not supported yet
  268. ***** ^ not supported yet
  269. 123 StrEdit.DeleteChar( ' ', FileSpec );
  270. ***** ^ not supported yet
  271. ***** ^ not supported yet
  272. ***** ^ not supported yet
  273. 124 lngth1 := M2Strings.Length( FileSpec );
  274. ***** ^ not supported yet
  275. ***** ^ not supported yet
  276. ***** ^ not supported yet
  277. 125 IF lngth1 > 0 THEN
  278. 126 LastCh := FileSpec[ lngth1 - 1 ];
  279. ***** ^ not supported yet
  280. ***** ^ not supported yet
  281. 127 ELSE
  282. 128 LastCh := ':';
  283. 129 END;
  284. 130 CASE LastCh OF
  285. 131 ':', '\', '/': StrEdit.Append( FileSpec, '*.*' );
  286. ***** ^ not supported yet
  287. ***** ^ not supported yet
  288. ***** ^ not supported yet
  289. ***** ^ not supported yet
  290. 132 ELSE
  291. 133 (*do nothing*)
  292. 134 END;
  293. 135 DirHandle := 1;
  294. 136 SavedMessage := Drectory.FindFirstFile( FileSpec, DirHandle, InfoRec );
  295. ***** ^ not supported yet
  296. ***** ^ not supported yet
  297. ***** ^ not supported yet
  298. ***** ^ not supported yet
  299. 137 IF SavedMessage # StringIO.NoError THEN
  300. ***** ^ not supported yet
  301. ***** ^ not supported yet
  302. 138 IF SavedMessage = StringIO.NoMoreFiles THEN
  303. ***** ^ not supported yet
  304. ***** ^ not supported yet
  305. 139 SavedMessage := StringIO.FileNotFound;
  306. ***** ^ not supported yet
  307. ***** ^ not supported yet
  308. 140 END;
  309. 141 ErrStrgs.NumToStr( SavedMessage, tmpstr );
  310. ***** ^ not supported yet
  311. ***** ^ not supported yet
  312. ***** ^ not supported yet
  313. 142 M2Strings.Insert( 'Error: ', tmpstr, 0 );
  314. ***** ^ not supported yet
  315. ***** ^ not supported yet
  316. ***** ^ not supported yet
  317. ***** ^ not supported yet
  318. ***** ^ not supported yet
  319. 143 AddOne( tmpstr, NextCol, NextRow );
  320. ***** ^ not supported yet
  321. ***** ^ not supported yet
  322. ***** ^ not supported yet
  323. 144 RETURN SavedMessage;
  324. 145 END;
  325. 146 WHILE SavedMessage = StringIO.NoError DO
  326. ***** ^ not supported yet
  327. ***** ^ not supported yet
  328. 147 MakeFileDataStr( InfoRec, ColumnsPerFile, tmpstr );
  329. ***** ^ not supported yet
  330. ***** ^ not supported yet
  331. ***** ^ not supported yet
  332. 148 AddOne( tmpstr, NextCol, NextRow );
  333. ***** ^ not supported yet
  334. ***** ^ not supported yet
  335. ***** ^ not supported yet
  336. 149 SavedMessage := Drectory.FindNextFile( DirHandle, InfoRec );
  337. ***** ^ not supported yet
  338. ***** ^ not supported yet
  339. ***** ^ not supported yet
  340. 150 END;
  341. 151 RETURN StringIO.NoError;
  342. ***** ^ not supported yet
  343. ***** ^ not supported yet
  344. 152 END DirToFrame;
  345. ***** ^ not supported yet
  346. 153
  347. 154 PROCEDURE ControlDirectory( FileSpec: ARRAY OF CHAR;
  348. ***** ^ not supported yet
  349. 155 TheFrame: ScrnTypes.DisplayFrame; ColumnsPerFile: CARDINAL;
  350. ***** ^ not supported yet
  351. 156 VAR SelectedFile: ARRAY OF CHAR; VAR NextFrame:
  352. ***** ^ not supported yet
  353. 157 ScrnTypes.AFrameName );
  354. ***** ^ not supported yet
  355. 158 VAR
  356. 159 SavedMessage: CARDINAL;
  357. 160 TmpName: ScrnTypes.AFrameName;
  358. ***** ^ not supported yet
  359. 161 spot: CARDINAL;
  360. 162 DriveLetter: CHAR;
  361. 163 PathName: ARRAY [0..127] OF CHAR;
  362. ***** ^ not supported yet
  363. ***** ^ not supported yet
  364. 164 ImageRec: ScrnTypes.ImageElement;
  365. ***** ^ not supported yet
  366. 165
  367. 166 BEGIN
  368. 167 Drectory.GetDrivePathAndName( FileSpec, DriveLetter, PathName,
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. ***** ^ not supported yet
  372. ***** ^ not supported yet
  373. 168 SelectedFile );
  374. ***** ^ not supported yet
  375. 169 SavedMessage := DirToFrame( FileSpec, TheFrame,
  376. ***** ^ not supported yet
  377. ***** ^ not supported yet
  378. ***** ^ not supported yet
  379. 170 ColumnsPerFile );
  380. ***** ^ not supported yet
  381. 171 FramePainter.ShowDisplayFrame( TheFrame, 0, 0, 0, 0 );
  382. ***** ^ not supported yet
  383. ***** ^ not supported yet
  384. ***** ^ not supported yet
  385. ***** ^ not supported yet
  386. 172 InputManager.ControlFrame( TheFrame, 1, '', FALSE, TmpName );
  387. ***** ^ not supported yet
  388. ***** ^ not supported yet
  389. ***** ^ not supported yet
  390. ***** ^ not supported yet
  391. 173 ScrnUtl1.GetFieldImageRec( TheFrame, TheFrame^.CurrentField, ImageRec );
  392. ***** ^ not supported yet
  393. ***** ^ not supported yet
  394. ***** ^ not supported yet
  395. ***** ^ not supported yet
  396. ***** ^ not supported yet
  397. ***** ^ not supported yet
  398. 174 StrEdit.AssignStr( ImageRec.text, SelectedFile );
  399. ***** ^ not supported yet
  400. ***** ^ not supported yet
  401. ***** ^ not supported yet
  402. ***** ^ not supported yet
  403. ***** ^ not supported yet
  404. 175 IF HIGH(SelectedFile) > 12 THEN
  405. ***** ^ undeclared identifier
  406. ***** ^ not supported yet
  407. 176 SelectedFile[13]:=0C
  408. ***** ^ not supported yet
  409. ***** ^ not supported yet
  410. 177 END;
  411. 178 StrEdit.DeleteChar( ' ', SelectedFile );
  412. ***** ^ not supported yet
  413. ***** ^ not supported yet
  414. ***** ^ not supported yet
  415. 179 IF M2Strings.Length(SelectedFile) > 0 THEN
  416. ***** ^ not supported yet
  417. ***** ^ not supported yet
  418. ***** ^ not supported yet
  419. 180 M2Strings.Insert( PathName, SelectedFile, 0 );
  420. ***** ^ not supported yet
  421. ***** ^ not supported yet
  422. ***** ^ not supported yet
  423. ***** ^ not supported yet
  424. ***** ^ not supported yet
  425. 181 M2Strings.Insert( ':', SelectedFile, 0 );
  426. ***** ^ not supported yet
  427. ***** ^ not supported yet
  428. ***** ^ not supported yet
  429. ***** ^ not supported yet
  430. 182 M2Strings.Insert( DriveLetter, SelectedFile, 0 );
  431. ***** ^ not supported yet
  432. ***** ^ not supported yet
  433. ***** ^ not supported yet
  434. ***** ^ not supported yet
  435. 183 END;
  436. 184 M2Strings.Assign( TmpName, NextFrame );
  437. ***** ^ not supported yet
  438. ***** ^ not supported yet
  439. ***** ^ not supported yet
  440. ***** ^ not supported yet
  441. 185 END ControlDirectory;
  442. ***** ^ not supported yet
  443. 186
  444. 187
  445. 188 PROCEDURE OldControlDirectory( FileSpec: ARRAY OF CHAR;
  446. ***** ^ not supported yet
  447. 189 TheFrame: ScrnTypes.DisplayFrame; ColumnsPerFile: CARDINAL;
  448. ***** ^ not supported yet
  449. 190 VAR SelectedFile: ARRAY OF CHAR ): ScrnTypes.FrameKey;
  450. ***** ^ not supported yet
  451. ***** ^ not supported yet
  452. 191 VAR
  453. 192 NextFrame: ScrnTypes.AFrameName;
  454. ***** ^ not supported yet
  455. 193 BEGIN
  456. 194 ControlDirectory( FileSpec, TheFrame, ColumnsPerFile,
  457. ***** ^ not supported yet
  458. ***** ^ not supported yet
  459. ***** ^ not supported yet
  460. 195 SelectedFile, NextFrame );
  461. ***** ^ not supported yet
  462. ***** ^ not supported yet
  463. 196 RETURN StrConv.ReturnedInt(NextFrame);
  464. ***** ^ not supported yet
  465. ***** ^ not supported yet
  466. ***** ^ not supported yet
  467. 197 END OldControlDirectory;
  468. ***** ^ not supported yet
  469. 198
  470. 199 BEGIN
  471. 200 Initialized := FALSE;
  472. 201 Init();
  473. ***** ^ not supported yet
  474. ***** ^ not supported yet
  475. 202 END DirManager.
  476. ***** ^ not supported yet
  477. 273 errors