IO.LST 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587
  1. Listing:
  2. 1 (* Release 3.10 *)
  3. 2 (*-------------------------------------------------------------------------*
  4. 3 * *
  5. 4 * IO.MOD - Terminal input/output *
  6. 5 * *
  7. 6 * COPYRIGHT (C) 1987..1992 Clarion Software Corporation. *
  8. 7 * All Rights Reserved *
  9. 8 * *
  10. 9 *--------------------------------------------------------------------------*)
  11. 10
  12. 11 (*%F _fdata *)
  13. 12 (*# call(seg_name => null) *)
  14. 13 (*# data(seg_name => null) *)
  15. 14 (*%E *)
  16. 15 (*# module(implementation=>off) *)
  17. 16 (*# call(o_a_copy => off) *)
  18. 17 (*# check(stack=>off,
  19. 18 index=>off,
  20. 19 range=>off,
  21. 20 overflow=>off,
  22. 21 nil_ptr=>off) *)
  23. 22
  24. 23 IMPLEMENTATION MODULE IO;
  25. 24
  26. 25 (*%F _OS2 *)
  27. 26 IMPORT Lib, Str, SYSTEM, CoreIO, CoreSig;
  28. 27 (*%E *)
  29. 28 (*%T _OS2 *)
  30. 29 IMPORT Str,Dos,Vio,Kbd,Lib,CoreIO,CoreSig;
  31. 30 (*%E *)
  32. 31 (*%T _mthread *)
  33. 32 IMPORT Process, CoreProc;
  34. 33 (*%E *)
  35. 34 CONST
  36. 35 TrueStr = 'TRUE';
  37. ***** ^ not supported yet
  38. 36 ConStr = 'CON';
  39. ***** ^ not supported yet
  40. 37
  41. 38 VAR
  42. 39 VIOoutput : BOOLEAN;
  43. 40 LWW : BOOLEAN;
  44. 41 Buffer : ARRAY[0..MaxRdLength-1] OF CHAR;
  45. ***** ^ undeclared identifier
  46. ***** ^ not supported yet
  47. ***** ^ not supported yet
  48. 42 s,e : CARDINAL;
  49. 43 (*%T _mthread *)
  50. 44 OKTable: ARRAY [1..Process.MaxProcess] OF BOOLEAN;
  51. ***** ^ not supported yet
  52. ***** ^ not supported yet
  53. ***** ^ not supported yet
  54. 45 (*%E *)
  55. 46
  56. 47 TYPE
  57. 48 Str80 = ARRAY[0..79] OF CHAR;
  58. ***** ^ not supported yet
  59. ***** ^ not supported yet
  60. 49 PathStr = Str80;
  61. 50
  62. 51 (*%F _OS2 *)
  63. 52 PROCEDURE KeyPressed (): BOOLEAN;
  64. 53 VAR R : SYSTEM.Registers;
  65. 54 BEGIN
  66. 55 WITH R DO
  67. 56 AH := 0BH;
  68. 57 Lib.Dos(R);
  69. 58 RETURN AL=0FFH;
  70. 59 END;
  71. 60 END KeyPressed;
  72. 61
  73. 62 PROCEDURE TerminalRdStr(VAR string: ARRAY OF CHAR);
  74. 63 VAR
  75. 64 R : SYSTEM.Registers;
  76. 65 H : CARDINAL;
  77. 66 I : CARDINAL;
  78. 67 InputBuffer : RECORD
  79. 68 LenBuf : CHAR;
  80. 69 Len : CHAR;
  81. 70 Buf : ARRAY[0..81] OF CHAR;
  82. 71 END;
  83. 72 BEGIN
  84. 73 IF Prompt AND NOT LWW THEN WrStr('?'); END;
  85. 74 LWW := FALSE;
  86. 75 H := HIGH(string);
  87. 76 IF H > 80 THEN
  88. 77 InputBuffer.LenBuf := CHR(82);
  89. 78 ELSE
  90. 79 InputBuffer.LenBuf := CHR(H+2);
  91. 80 END;
  92. 81 InputBuffer.Len := CHR(0);
  93. 82 WITH R DO
  94. 83 DS := Seg(InputBuffer);
  95. 84 DX := Ofs(InputBuffer);
  96. 85 AH := 0AH;
  97. 86 Lib.Dos(R);
  98. 87 END;
  99. 88 I := ORD(InputBuffer.Len);
  100. 89 IF I <= H THEN
  101. 90 string[I] := CHR(0);
  102. 91 END;
  103. 92 WHILE (I>0) DO
  104. 93 DEC(I);
  105. 94 string[I] := InputBuffer.Buf[I];
  106. 95 END;
  107. 96 WrLn;
  108. 97 END TerminalRdStr;
  109. 98 (*%E *)
  110. 99
  111. 100 PROCEDURE GetName(name: ARRAY OF CHAR; VAR fn: PathStr);
  112. ***** ^ not supported yet
  113. 101 (* Makes Null terminated filename, also sets IOR to 0 *)
  114. 102 BEGIN
  115. 103 Str.Copy(fn,name);
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. ***** ^ not supported yet
  119. ***** ^ not supported yet
  120. 104 fn[HIGH(fn)] := CHR(0);
  121. ***** ^ not supported yet
  122. ***** ^ undeclared identifier
  123. ***** ^ not supported yet
  124. ***** ^ undeclared identifier
  125. ***** ^ not supported yet
  126. 105 END GetName;
  127. ***** ^ not supported yet
  128. 106
  129. 107
  130. 108 (*%T _OS2 *)
  131. 109
  132. 110 VAR tchar : CHAR;
  133. 111
  134. 112 PROCEDURE KeyPressed():BOOLEAN;
  135. 113 VAR r : CARDINAL; k : Kbd.KEYINFO;
  136. ***** ^ not supported yet
  137. 114 BEGIN
  138. 115 k.char := 0C;
  139. ***** ^ not supported yet
  140. ***** ^ not supported yet
  141. 116 k.scan := 0;
  142. ***** ^ not supported yet
  143. ***** ^ not supported yet
  144. 117 k.nlsShift := 0;
  145. ***** ^ not supported yet
  146. ***** ^ not supported yet
  147. 118 r := Kbd.Peek(k,0);
  148. ***** ^ not supported yet
  149. ***** ^ not supported yet
  150. ***** ^ not supported yet
  151. ***** ^ not supported yet
  152. 119 RETURN (tchar#0C) OR (k.scan#0) OR (k.char#0C);
  153. ***** ^ not supported yet
  154. ***** ^ not supported yet
  155. ***** ^ not supported yet
  156. ***** ^ not supported yet
  157. 120 END KeyPressed;
  158. ***** ^ not supported yet
  159. 121
  160. 122 PROCEDURE FileRdStr(VAR string: ARRAY OF CHAR);
  161. ***** ^ not supported yet
  162. 123 VAR
  163. 124 NumRead: CARDINAL;
  164. 125 BEGIN
  165. 126 IF Dos.Read(0, FarADR(string), HIGH(string), NumRead) # 0 THEN END;
  166. ***** ^ not supported yet
  167. ***** ^ not supported yet
  168. ***** ^ undeclared identifier
  169. ***** ^ not supported yet
  170. ***** ^ undeclared identifier
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. 127 string[NumRead] := CHR(0);
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. ***** ^ undeclared identifier
  177. ***** ^ not supported yet
  178. 128 END FileRdStr;
  179. ***** ^ not supported yet
  180. 129
  181. 130 PROCEDURE TerminalRdStr(VAR string: ARRAY OF CHAR);
  182. ***** ^ not supported yet
  183. 131 VAR l : Kbd.STRINGINBUF;
  184. ***** ^ not supported yet
  185. 132 r : CARDINAL;
  186. 133 BEGIN
  187. 134 IF Prompt AND NOT LWW THEN WrStr('?'); END;
  188. ***** ^ undeclared identifier
  189. ***** ^ undeclared identifier
  190. ***** ^ not supported yet
  191. 135 LWW := FALSE;
  192. 136 IF NOT InputRedirected THEN
  193. ***** ^ undeclared identifier
  194. 137 l.b := HIGH(string);
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. ***** ^ undeclared identifier
  198. ***** ^ not supported yet
  199. 138 r := Kbd.StringIn( string,l,0,0);
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. ***** ^ not supported yet
  205. 139 IF l.chIn < l.b THEN
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. ***** ^ not supported yet
  210. 140 string[l.chIn]:= 0C;
  211. ***** ^ not supported yet
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. 141 END;
  215. 142 WrLn;
  216. ***** ^ undeclared identifier
  217. 143 ELSE
  218. 144 FileRdStr(string);
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. 145 END;
  222. 146 END TerminalRdStr;
  223. ***** ^ not supported yet
  224. 147 (*%E *)
  225. 148
  226. 149
  227. 150 (*%T _mthread *)
  228. 151 PROCEDURE SetThreadOK( b : BOOLEAN);
  229. 152
  230. 153 BEGIN
  231. 154 OKTable[CoreProc._getTID()] := b;
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. ***** ^ not supported yet
  235. ***** ^ not supported yet
  236. 155 END SetThreadOK;
  237. ***** ^ not supported yet
  238. 156 (*%E *)
  239. 157
  240. 158
  241. 159
  242. 160 PROCEDURE WrStr(s: ARRAY OF CHAR);
  243. ***** ^ not supported yet
  244. 161 BEGIN
  245. 162 WrStrRedirect(s);
  246. ***** ^ undeclared identifier
  247. ***** ^ not supported yet
  248. 163 END WrStr;
  249. ***** ^ not supported yet
  250. 164
  251. 165 PROCEDURE RdStr ( VAR s : ARRAY OF CHAR );
  252. ***** ^ not supported yet
  253. 166 BEGIN
  254. 167 RdStrRedirect(s);
  255. ***** ^ undeclared identifier
  256. ***** ^ not supported yet
  257. 168 END RdStr;
  258. ***** ^ not supported yet
  259. 169
  260. 170
  261. 171 PROCEDURE RdBuff;
  262. 172 VAR
  263. 173 p,h : CARDINAL;
  264. 174 BEGIN
  265. 175 RdStrRedirect(Buffer);
  266. ***** ^ undeclared identifier
  267. ***** ^ not supported yet
  268. 176 p := Str.Length(Buffer);
  269. ***** ^ not supported yet
  270. ***** ^ not supported yet
  271. ***** ^ not supported yet
  272. 177 h := SIZE(Buffer)-1;
  273. ***** ^ undeclared identifier
  274. ***** ^ not supported yet
  275. 178 IF p>h-1 THEN p := h-1; END;
  276. 179 Buffer[p] := CHR(13); INC(p);
  277. ***** ^ not supported yet
  278. ***** ^ not supported yet
  279. ***** ^ undeclared identifier
  280. ***** ^ not supported yet
  281. ***** ^ undeclared identifier
  282. ***** ^ not supported yet
  283. 180 Buffer[p] := CHR(10); INC(p);
  284. ***** ^ not supported yet
  285. ***** ^ not supported yet
  286. ***** ^ undeclared identifier
  287. ***** ^ not supported yet
  288. ***** ^ undeclared identifier
  289. ***** ^ not supported yet
  290. 181 IF p<=h THEN Buffer[p] := CHR(0) END;
  291. ***** ^ not supported yet
  292. ***** ^ not supported yet
  293. ***** ^ undeclared identifier
  294. ***** ^ not supported yet
  295. 182 e := p; s := 0;
  296. 183 END RdBuff;
  297. ***** ^ not supported yet
  298. 184
  299. 185 (*%F _OS2 *)
  300. 186 PROCEDURE TerminalWrStr(string: ARRAY OF CHAR);
  301. 187 VAR R : SYSTEM.Registers;
  302. 188 BEGIN
  303. 189 LWW := TRUE;
  304. 190 WITH R DO
  305. 191 BX := 1;
  306. 192 AH := 40H;
  307. 193 DS := Seg( string );
  308. 194 DX := Ofs( string );
  309. 195 CX := Str.Length(string);
  310. 196 Lib.Dos( R );
  311. 197 END;
  312. 198 END TerminalWrStr;
  313. 199
  314. 200 PROCEDURE RdKey() : CHAR;
  315. 201 VAR R : SYSTEM.Registers;
  316. 202 BEGIN
  317. 203 WITH R DO
  318. 204 AH := 8;
  319. 205 Lib.Dos(R);
  320. 206 IF AL=0E0H THEN AL := 0 END;
  321. 207 RETURN CHR(AL);
  322. 208 END;
  323. 209 END RdKey;
  324. 210 (*%E *)
  325. 211
  326. 212 (*%T _OS2 *)
  327. 213 PROCEDURE TerminalWrStr(string: ARRAY OF CHAR);
  328. ***** ^ not supported yet
  329. 214 VAR r : CARDINAL;
  330. 215 n : CARDINAL ;
  331. 216 BEGIN
  332. 217 LWW := TRUE;
  333. 218 IF (VIOoutput) AND (NOT OutputRedirected) THEN
  334. ***** ^ undeclared identifier
  335. 219 r := Vio.WrtTTY(string,Str.Length(string),0);
  336. ***** ^ not supported yet
  337. ***** ^ not supported yet
  338. ***** ^ not supported yet
  339. ***** ^ not supported yet
  340. ***** ^ not supported yet
  341. ***** ^ not supported yet
  342. ***** ^ not supported yet
  343. 220 ELSE
  344. 221 r := Dos.Write(1,FarADR(string),Str.Length(string),n);
  345. ***** ^ not supported yet
  346. ***** ^ not supported yet
  347. ***** ^ undeclared identifier
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. ***** ^ not supported yet
  351. ***** ^ not supported yet
  352. ***** ^ not supported yet
  353. 222 END ;
  354. 223 END TerminalWrStr;
  355. ***** ^ not supported yet
  356. 224
  357. 225
  358. 226 PROCEDURE RdKey() : CHAR;
  359. 227 VAR k : Kbd.KEYINFO; r : CARDINAL; c:CHAR;
  360. ***** ^ not supported yet
  361. 228 BEGIN
  362. 229 IF (tchar#0C) THEN
  363. 230 c := tchar;
  364. 231 tchar:=0C;
  365. 232 RETURN c;
  366. 233 ELSE
  367. 234 r := Kbd.CharIn( k,0,0 );
  368. ***** ^ not supported yet
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. ***** ^ not supported yet
  372. 235 IF (k.char=0C) OR (k.char=CHR(0E0H)) THEN
  373. ***** ^ not supported yet
  374. ***** ^ not supported yet
  375. ***** ^ not supported yet
  376. ***** ^ not supported yet
  377. ***** ^ undeclared identifier
  378. ***** ^ not supported yet
  379. 236 tchar := CHAR(k.scan);
  380. ***** ^ not supported yet
  381. ***** ^ not supported yet
  382. 237 k.char := 0C;
  383. ***** ^ not supported yet
  384. ***** ^ not supported yet
  385. 238 END;
  386. 239 RETURN (k.char);
  387. ***** ^ not supported yet
  388. ***** ^ not supported yet
  389. 240 END;
  390. 241 END RdKey;
  391. ***** ^ not supported yet
  392. 242 (*%E *)
  393. 243
  394. 244 (*# save,
  395. 245 call(o_a_copy => on) *)
  396. 246
  397. 247 PROCEDURE WrStrAdj( S : ARRAY OF CHAR; Length : INTEGER );
  398. ***** ^ not supported yet
  399. 248 VAR
  400. 249 L : CARDINAL;
  401. 250 a : INTEGER;
  402. 251 BEGIN
  403. 252 OK := TRUE;
  404. ***** ^ undeclared identifier
  405. 253 (*%T _mthread *)
  406. 254 SetThreadOK(TRUE);
  407. ***** ^ not supported yet
  408. ***** ^ not supported yet
  409. 255 (*%E *)
  410. 256 IF RdLnOnWr THEN RdLn; END;
  411. ***** ^ undeclared identifier
  412. ***** ^ undeclared identifier
  413. 257 L := Str.Length( S );
  414. ***** ^ not supported yet
  415. ***** ^ not supported yet
  416. ***** ^ not supported yet
  417. 258 a := ABS( Length ) - INTEGER( L );
  418. ***** ^ undeclared identifier
  419. ***** ^ not supported yet
  420. ***** ^ not supported yet
  421. 259 IF (a < 0) AND ChopOff THEN
  422. ***** ^ undeclared identifier
  423. 260 L := CARDINAL(ABS(Length));
  424. ***** ^ undeclared identifier
  425. ***** ^ not supported yet
  426. 261 IF L<=HIGH(S) THEN S[L] := CHR(0); END;
  427. ***** ^ undeclared identifier
  428. ***** ^ not supported yet
  429. ***** ^ not supported yet
  430. ***** ^ not supported yet
  431. ***** ^ undeclared identifier
  432. ***** ^ not supported yet
  433. 262 WHILE (L>0) DO DEC(L); S[L] := '?'; END;
  434. ***** ^ undeclared identifier
  435. ***** ^ not supported yet
  436. ***** ^ not supported yet
  437. ***** ^ not supported yet
  438. 263 OK := FALSE;
  439. ***** ^ undeclared identifier
  440. 264 (*%T _mthread *)
  441. 265 SetThreadOK(FALSE);
  442. ***** ^ not supported yet
  443. ***** ^ not supported yet
  444. 266 (*%E *)
  445. 267 a := 0;
  446. 268 END;
  447. 269 IF (Length > 0) AND (a > 0) THEN WrCharRep( PrefixChar,a ); END;
  448. ***** ^ undeclared identifier
  449. ***** ^ undeclared identifier
  450. ***** ^ not supported yet
  451. 270 WrStr( S );
  452. ***** ^ not supported yet
  453. ***** ^ not supported yet
  454. 271 IF (Length < 0) AND (a > 0) THEN WrCharRep( SuffixChar,a ); END;
  455. ***** ^ undeclared identifier
  456. ***** ^ undeclared identifier
  457. ***** ^ not supported yet
  458. 272 END WrStrAdj;
  459. ***** ^ not supported yet
  460. 273
  461. 274 (*# restore *)
  462. 275
  463. 276 PROCEDURE WrChar( V: CHAR );
  464. 277 BEGIN
  465. 278 IF RdLnOnWr THEN RdLn; END;
  466. ***** ^ undeclared identifier
  467. ***** ^ undeclared identifier
  468. 279 WrStr( V );
  469. ***** ^ not supported yet
  470. ***** ^ not supported yet
  471. 280 END WrChar;
  472. ***** ^ not supported yet
  473. 281
  474. 282 PROCEDURE WrCharRep(V: CHAR; count: CARDINAL);
  475. 283 VAR
  476. 284 s : Str80;
  477. ***** ^ not supported yet
  478. 285 i,j : CARDINAL;
  479. 286 BEGIN
  480. 287 IF RdLnOnWr THEN RdLn; END;
  481. ***** ^ undeclared identifier
  482. ***** ^ undeclared identifier
  483. 288 WHILE count>0 DO
  484. 289 i := SIZE(s)-2;
  485. ***** ^ undeclared identifier
  486. ***** ^ not supported yet
  487. 290 IF i>count THEN i := count END;
  488. 291 DEC(count,i);
  489. ***** ^ undeclared identifier
  490. ***** ^ not supported yet
  491. 292 j := 0;
  492. 293 WHILE (j<i) DO s[j] := V; INC(j) END;
  493. ***** ^ not supported yet
  494. ***** ^ not supported yet
  495. ***** ^ undeclared identifier
  496. ***** ^ not supported yet
  497. 294 s[j] := CHR(0);
  498. ***** ^ not supported yet
  499. ***** ^ not supported yet
  500. ***** ^ undeclared identifier
  501. ***** ^ not supported yet
  502. 295 WrStr(s);
  503. ***** ^ not supported yet
  504. ***** ^ not supported yet
  505. 296 END;
  506. 297 END WrCharRep;
  507. ***** ^ not supported yet
  508. 298
  509. 299 PROCEDURE WrBool(V: BOOLEAN; Length: INTEGER);
  510. 300 BEGIN
  511. 301 IF V THEN
  512. 302 WrStrAdj(TrueStr,Length);
  513. ***** ^ not supported yet
  514. ***** ^ not supported yet
  515. ***** ^ not supported yet
  516. 303 ELSE
  517. 304 WrStrAdj('FALSE',Length);
  518. ***** ^ not supported yet
  519. ***** ^ not supported yet
  520. ***** ^ not supported yet
  521. 305 END;
  522. 306 END WrBool;
  523. ***** ^ not supported yet
  524. 307
  525. 308 PROCEDURE WrShtInt(V: SHORTINT; Length: INTEGER);
  526. 309 VAR
  527. 310 S : Str80;
  528. ***** ^ not supported yet
  529. 311 b : BOOLEAN;
  530. 312 BEGIN
  531. 313 Str.IntToStr( LONGINT(V),S,10,b);
  532. ***** ^ not supported yet
  533. ***** ^ not supported yet
  534. ***** ^ not supported yet
  535. ***** ^ not supported yet
  536. ***** ^ not supported yet
  537. 314 (*%T _mthread *)
  538. 315 SetThreadOK(b);
  539. ***** ^ not supported yet
  540. ***** ^ not supported yet
  541. 316 (*%E *)
  542. 317 IF b THEN
  543. 318 WrStrAdj(S,Length );
  544. ***** ^ not supported yet
  545. ***** ^ not supported yet
  546. ***** ^ not supported yet
  547. 319 END;
  548. 320 OK := b;
  549. ***** ^ undeclared identifier
  550. 321 END WrShtInt;
  551. ***** ^ not supported yet
  552. 322
  553. 323 PROCEDURE WrInt(V: INTEGER; Length: INTEGER);
  554. 324 VAR
  555. 325 S : Str80;
  556. ***** ^ not supported yet
  557. 326 b : BOOLEAN;
  558. 327 BEGIN
  559. 328 Str.IntToStr( LONGINT(V),S,10,b);
  560. ***** ^ not supported yet
  561. ***** ^ not supported yet
  562. ***** ^ not supported yet
  563. ***** ^ not supported yet
  564. ***** ^ not supported yet
  565. 329 (*%T _mthread *)
  566. 330 SetThreadOK(b);
  567. ***** ^ not supported yet
  568. ***** ^ not supported yet
  569. 331 (*%E *)
  570. 332 IF b THEN
  571. 333 WrStrAdj(S,Length );
  572. ***** ^ not supported yet
  573. ***** ^ not supported yet
  574. ***** ^ not supported yet
  575. 334 END;
  576. 335 OK := b;
  577. ***** ^ undeclared identifier
  578. 336 END WrInt;
  579. ***** ^ not supported yet
  580. 337
  581. 338 PROCEDURE WrLngInt(V: LONGINT; Length: INTEGER);
  582. 339 VAR
  583. 340 S : Str80;
  584. ***** ^ not supported yet
  585. 341 b : BOOLEAN;
  586. 342 BEGIN
  587. 343 Str.IntToStr( V,S,10,b);
  588. ***** ^ not supported yet
  589. ***** ^ not supported yet
  590. ***** ^ not supported yet
  591. ***** ^ not supported yet
  592. 344 (*%T _mthread *)
  593. 345 SetThreadOK(b);
  594. ***** ^ not supported yet
  595. ***** ^ not supported yet
  596. 346 (*%E *)
  597. 347 IF b THEN
  598. 348 WrStrAdj(S,Length );
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. ***** ^ not supported yet
  602. 349 END;
  603. 350 OK := b;
  604. ***** ^ undeclared identifier
  605. 351 END WrLngInt;
  606. ***** ^ not supported yet
  607. 352
  608. 353 PROCEDURE WrShtCard(V: SHORTCARD; Length: INTEGER);
  609. 354 VAR S : Str80;
  610. ***** ^ not supported yet
  611. 355 b : BOOLEAN;
  612. 356 BEGIN
  613. 357 Str.CardToStr(LONGCARD(V),S,10,b);
  614. ***** ^ not supported yet
  615. ***** ^ not supported yet
  616. ***** ^ undeclared identifier
  617. ***** ^ not supported yet
  618. ***** ^ not supported yet
  619. ***** ^ not supported yet
  620. 358 (*%T _mthread *)
  621. 359 SetThreadOK(b);
  622. ***** ^ not supported yet
  623. ***** ^ not supported yet
  624. 360 (*%E *)
  625. 361 IF b THEN
  626. 362 WrStrAdj(S,Length );
  627. ***** ^ not supported yet
  628. ***** ^ not supported yet
  629. ***** ^ not supported yet
  630. 363 END;
  631. 364 OK := b;
  632. ***** ^ undeclared identifier
  633. 365 END WrShtCard;
  634. ***** ^ not supported yet
  635. 366
  636. 367 PROCEDURE WrCard(V: CARDINAL; Length: INTEGER);
  637. 368 VAR
  638. 369 S : Str80;
  639. ***** ^ not supported yet
  640. 370 b : BOOLEAN;
  641. 371 BEGIN
  642. 372 Str.CardToStr(LONGCARD(V),S,10,b);
  643. ***** ^ not supported yet
  644. ***** ^ not supported yet
  645. ***** ^ undeclared identifier
  646. ***** ^ not supported yet
  647. ***** ^ not supported yet
  648. ***** ^ not supported yet
  649. 373 (*%T _mthread *)
  650. 374 SetThreadOK(b);
  651. ***** ^ not supported yet
  652. ***** ^ not supported yet
  653. 375 (*%E *)
  654. 376 IF b THEN
  655. 377 WrStrAdj(S,Length );
  656. ***** ^ not supported yet
  657. ***** ^ not supported yet
  658. ***** ^ not supported yet
  659. 378 END;
  660. 379 OK := b;
  661. ***** ^ undeclared identifier
  662. 380 END WrCard;
  663. ***** ^ not supported yet
  664. 381
  665. 382 PROCEDURE WrLngCard(V: LONGCARD; Length: INTEGER);
  666. ***** ^ undeclared identifier
  667. 383 VAR
  668. 384 S : Str80;
  669. ***** ^ not supported yet
  670. 385 b : BOOLEAN;
  671. 386 BEGIN
  672. 387 Str.CardToStr(V,S,10,b);
  673. ***** ^ not supported yet
  674. ***** ^ not supported yet
  675. ***** ^ not supported yet
  676. ***** ^ not supported yet
  677. ***** ^ not supported yet
  678. 388 (*%T _mthread *)
  679. 389 SetThreadOK(b);
  680. ***** ^ not supported yet
  681. ***** ^ not supported yet
  682. 390 (*%E *)
  683. 391 IF b THEN
  684. 392 WrStrAdj(S,Length );
  685. ***** ^ not supported yet
  686. ***** ^ not supported yet
  687. ***** ^ not supported yet
  688. 393 END;
  689. 394 OK := b;
  690. ***** ^ undeclared identifier
  691. 395 END WrLngCard;
  692. ***** ^ not supported yet
  693. 396
  694. 397 PROCEDURE WrShtHex(V: SHORTCARD; Length: INTEGER);
  695. 398 VAR
  696. 399 S : Str80;
  697. ***** ^ not supported yet
  698. 400 b : BOOLEAN;
  699. 401 BEGIN
  700. 402 Str.CardToStr(LONGCARD(V),S,16,b);
  701. ***** ^ not supported yet
  702. ***** ^ not supported yet
  703. ***** ^ undeclared identifier
  704. ***** ^ not supported yet
  705. ***** ^ not supported yet
  706. ***** ^ not supported yet
  707. 403 (*%T _mthread *)
  708. 404 SetThreadOK(b);
  709. ***** ^ not supported yet
  710. ***** ^ not supported yet
  711. 405 (*%E *)
  712. 406 IF b THEN
  713. 407 WrStrAdj(S,Length );
  714. ***** ^ not supported yet
  715. ***** ^ not supported yet
  716. ***** ^ not supported yet
  717. 408 END;
  718. 409 OK := b;
  719. ***** ^ undeclared identifier
  720. 410 END WrShtHex;
  721. ***** ^ not supported yet
  722. 411
  723. 412 PROCEDURE WrHex(V: CARDINAL; Length: INTEGER);
  724. 413 VAR
  725. 414 S : Str80;
  726. ***** ^ not supported yet
  727. 415 b : BOOLEAN;
  728. 416 BEGIN
  729. 417 Str.CardToStr(LONGCARD(V),S,16,b);
  730. ***** ^ not supported yet
  731. ***** ^ not supported yet
  732. ***** ^ undeclared identifier
  733. ***** ^ not supported yet
  734. ***** ^ not supported yet
  735. ***** ^ not supported yet
  736. 418 (*%T _mthread *)
  737. 419 SetThreadOK(b);
  738. ***** ^ not supported yet
  739. ***** ^ not supported yet
  740. 420 (*%E *)
  741. 421 IF b THEN
  742. 422 WrStrAdj(S,Length );
  743. ***** ^ not supported yet
  744. ***** ^ not supported yet
  745. ***** ^ not supported yet
  746. 423 END;
  747. 424 OK := b;
  748. ***** ^ undeclared identifier
  749. 425 END WrHex;
  750. ***** ^ not supported yet
  751. 426
  752. 427 PROCEDURE WrLngHex(V: LONGCARD; Length: INTEGER);
  753. ***** ^ undeclared identifier
  754. 428 VAR S : Str80;
  755. ***** ^ not supported yet
  756. 429 b : BOOLEAN;
  757. 430 BEGIN
  758. 431 Str.CardToStr(V,S,16,b);
  759. ***** ^ not supported yet
  760. ***** ^ not supported yet
  761. ***** ^ not supported yet
  762. ***** ^ not supported yet
  763. ***** ^ not supported yet
  764. 432 (*%T _mthread *)
  765. 433 SetThreadOK(b);
  766. ***** ^ not supported yet
  767. ***** ^ not supported yet
  768. 434 (*%E *)
  769. 435 IF b THEN
  770. 436 WrStrAdj(S,Length );
  771. ***** ^ not supported yet
  772. ***** ^ not supported yet
  773. ***** ^ not supported yet
  774. 437 END;
  775. 438 OK := b;
  776. ***** ^ undeclared identifier
  777. 439 END WrLngHex;
  778. ***** ^ not supported yet
  779. 440
  780. 441 PROCEDURE WrReal(V: REAL; Precision: CARDINAL; Length: INTEGER);
  781. 442 VAR
  782. 443 S : Str80;
  783. ***** ^ not supported yet
  784. 444 b : BOOLEAN;
  785. 445 BEGIN
  786. 446 Str.RealToStr( LONGREAL ( V ),Precision,Eng,S,b);
  787. ***** ^ not supported yet
  788. ***** ^ not supported yet
  789. ***** ^ not supported yet
  790. ***** ^ undeclared identifier
  791. ***** ^ not supported yet
  792. ***** ^ not supported yet
  793. 447 (*%T _mthread *)
  794. 448 SetThreadOK(b);
  795. ***** ^ not supported yet
  796. ***** ^ not supported yet
  797. 449 (*%E *)
  798. 450 IF b THEN
  799. 451 WrStrAdj(S,Length );
  800. ***** ^ not supported yet
  801. ***** ^ not supported yet
  802. ***** ^ not supported yet
  803. 452 END;
  804. 453 OK := b;
  805. ***** ^ undeclared identifier
  806. 454 END WrReal;
  807. ***** ^ not supported yet
  808. 455
  809. 456 PROCEDURE WrFixReal(V: REAL; Precision: CARDINAL; Length: INTEGER);
  810. 457 VAR
  811. 458 S : Str80;
  812. ***** ^ not supported yet
  813. 459 b : BOOLEAN;
  814. 460 BEGIN
  815. 461 Str.FixRealToStr( LONGREAL ( V ),Precision,S,b );
  816. ***** ^ not supported yet
  817. ***** ^ not supported yet
  818. ***** ^ not supported yet
  819. ***** ^ not supported yet
  820. ***** ^ not supported yet
  821. 462 (*%T _mthread *)
  822. 463 SetThreadOK(b);
  823. ***** ^ not supported yet
  824. ***** ^ not supported yet
  825. 464 (*%E *)
  826. 465 IF b THEN
  827. 466 WrStrAdj(S,Length );
  828. ***** ^ not supported yet
  829. ***** ^ not supported yet
  830. ***** ^ not supported yet
  831. 467 END;
  832. 468 OK := b;
  833. ***** ^ undeclared identifier
  834. 469 END WrFixReal;
  835. ***** ^ not supported yet
  836. 470
  837. 471 PROCEDURE WrLngReal(V : LONGREAL; Precision: CARDINAL; Length: INTEGER);
  838. 472 VAR
  839. 473 S : Str80;
  840. ***** ^ not supported yet
  841. 474 b : BOOLEAN;
  842. 475 BEGIN
  843. 476 Str.RealToStr( V,Precision,Eng,S,b);
  844. ***** ^ not supported yet
  845. ***** ^ not supported yet
  846. ***** ^ undeclared identifier
  847. ***** ^ not supported yet
  848. ***** ^ not supported yet
  849. 477 (*%T _mthread *)
  850. 478 SetThreadOK(b);
  851. ***** ^ not supported yet
  852. ***** ^ not supported yet
  853. 479 (*%E *)
  854. 480 IF b THEN
  855. 481 WrStrAdj(S,Length );
  856. ***** ^ not supported yet
  857. ***** ^ not supported yet
  858. ***** ^ not supported yet
  859. 482 END;
  860. 483 OK := b;
  861. ***** ^ undeclared identifier
  862. 484 END WrLngReal;
  863. ***** ^ not supported yet
  864. 485
  865. 486 PROCEDURE WrFixLngReal(V: LONGREAL; Precision: CARDINAL; Length: INTEGER);
  866. 487 VAR
  867. 488 S : Str80;
  868. ***** ^ not supported yet
  869. 489 b : BOOLEAN;
  870. 490 BEGIN
  871. 491 Str.FixRealToStr(V,Precision,S,b );
  872. ***** ^ not supported yet
  873. ***** ^ not supported yet
  874. ***** ^ not supported yet
  875. ***** ^ not supported yet
  876. 492 (*%T _mthread *)
  877. 493 SetThreadOK(b);
  878. ***** ^ not supported yet
  879. ***** ^ not supported yet
  880. 494 (*%E *)
  881. 495 IF b THEN
  882. 496 WrStrAdj(S,Length );
  883. ***** ^ not supported yet
  884. ***** ^ not supported yet
  885. ***** ^ not supported yet
  886. 497 END;
  887. 498 OK := b;
  888. ***** ^ undeclared identifier
  889. 499 END WrFixLngReal;
  890. ***** ^ not supported yet
  891. 500
  892. 501 PROCEDURE WrLn;
  893. 502 TYPE
  894. 503 a3 = ARRAY [0..1] OF CHAR;
  895. ***** ^ not supported yet
  896. ***** ^ not supported yet
  897. 504 CONST
  898. 505 crlf = a3(CHR(13),CHR(10));
  899. ***** ^ undeclared identifier
  900. ***** ^ not supported yet
  901. ***** ^ undeclared identifier
  902. ***** ^ not supported yet
  903. 506 BEGIN
  904. 507 IF RdLnOnWr THEN RdLn; END;
  905. ***** ^ undeclared identifier
  906. ***** ^ undeclared identifier
  907. 508 WrStr( crlf );
  908. ***** ^ not supported yet
  909. ***** ^ not supported yet
  910. 509 LWW := FALSE;
  911. 510 END WrLn;
  912. ***** ^ not supported yet
  913. 511
  914. 512 PROCEDURE RdBool() : BOOLEAN;
  915. 513 VAR s : Str80;
  916. ***** ^ not supported yet
  917. 514 BEGIN
  918. 515 RdItem( s );
  919. ***** ^ undeclared identifier
  920. ***** ^ not supported yet
  921. 516 RETURN Str.Compare( s,TrueStr )=0;
  922. ***** ^ not supported yet
  923. ***** ^ not supported yet
  924. ***** ^ not supported yet
  925. ***** ^ not supported yet
  926. 517 END RdBool;
  927. ***** ^ not supported yet
  928. 518
  929. 519 PROCEDURE RdShtInt() : SHORTINT;
  930. 520 VAR
  931. 521 S : Str80;
  932. ***** ^ not supported yet
  933. 522 i : LONGINT;
  934. 523 b : BOOLEAN;
  935. 524 BEGIN
  936. 525 RdItem(S );
  937. ***** ^ undeclared identifier
  938. ***** ^ not supported yet
  939. 526 i := Str.StrToInt( S,10,b );
  940. ***** ^ not supported yet
  941. ***** ^ not supported yet
  942. ***** ^ not supported yet
  943. ***** ^ not supported yet
  944. 527 (*%T _mthread *)
  945. 528 SetThreadOK(b AND (i >= -80H) AND (i < 80H));
  946. ***** ^ not supported yet
  947. ***** ^ not supported yet
  948. 529 (*%E *)
  949. 530 OK := b AND (i >= -80H) AND (i < 80H);
  950. ***** ^ undeclared identifier
  951. 531 RETURN SHORTINT( i );
  952. ***** ^ not supported yet
  953. 532 END RdShtInt;
  954. ***** ^ not supported yet
  955. 533
  956. 534 PROCEDURE RdInt() : INTEGER;
  957. 535 VAR
  958. 536 S : Str80;
  959. ***** ^ not supported yet
  960. 537 i : LONGINT;
  961. 538 b : BOOLEAN;
  962. 539 BEGIN
  963. 540 RdItem(S);
  964. ***** ^ undeclared identifier
  965. ***** ^ not supported yet
  966. 541 i := Str.StrToInt( S,10,b );
  967. ***** ^ not supported yet
  968. ***** ^ not supported yet
  969. ***** ^ not supported yet
  970. ***** ^ not supported yet
  971. 542 (*%T _mthread *)
  972. 543 SetThreadOK(b AND (i >= -8000H) AND (i < 8000H));
  973. ***** ^ not supported yet
  974. ***** ^ not supported yet
  975. 544 (*%E *)
  976. 545 OK := b AND (i >= -8000H) AND (i < 8000H);
  977. ***** ^ undeclared identifier
  978. 546 RETURN INTEGER(i);
  979. ***** ^ not supported yet
  980. 547 END RdInt;
  981. ***** ^ not supported yet
  982. 548
  983. 549 PROCEDURE RdLngInt() : LONGINT;
  984. 550 VAR
  985. 551 S : Str80;
  986. ***** ^ not supported yet
  987. 552 i : LONGINT;
  988. 553 b : BOOLEAN;
  989. 554 BEGIN
  990. 555 RdItem(S);
  991. ***** ^ undeclared identifier
  992. ***** ^ not supported yet
  993. 556 i := Str.StrToInt( S,10,b );
  994. ***** ^ not supported yet
  995. ***** ^ not supported yet
  996. ***** ^ not supported yet
  997. ***** ^ not supported yet
  998. 557 (*%T _mthread *)
  999. 558 SetThreadOK(b);
  1000. ***** ^ not supported yet
  1001. ***** ^ not supported yet
  1002. 559 (*%E *)
  1003. 560 OK := b;
  1004. ***** ^ undeclared identifier
  1005. 561 RETURN i;
  1006. 562 END RdLngInt;
  1007. ***** ^ not supported yet
  1008. 563
  1009. 564 PROCEDURE RdShtCard() : SHORTCARD;
  1010. 565 VAR
  1011. 566 S : Str80;
  1012. ***** ^ not supported yet
  1013. 567 i : LONGCARD;
  1014. ***** ^ undeclared identifier
  1015. 568 b : BOOLEAN;
  1016. 569 BEGIN
  1017. 570 RdItem(S);
  1018. ***** ^ undeclared identifier
  1019. ***** ^ not supported yet
  1020. 571 i := Str.StrToCard( S,10,b );
  1021. ***** ^ not supported yet
  1022. ***** ^ not supported yet
  1023. ***** ^ not supported yet
  1024. ***** ^ not supported yet
  1025. ***** ^ not supported yet
  1026. 572 (*%T _mthread *)
  1027. 573 SetThreadOK(b AND (i < 100H));
  1028. ***** ^ not supported yet
  1029. ***** ^ not supported yet
  1030. ***** ^ not supported yet
  1031. 574 (*%E *)
  1032. 575 OK := b AND (i < 100H);
  1033. ***** ^ undeclared identifier
  1034. ***** ^ not supported yet
  1035. 576 RETURN SHORTCARD( i );
  1036. ***** ^ not supported yet
  1037. 577 END RdShtCard;
  1038. ***** ^ not supported yet
  1039. 578
  1040. 579 PROCEDURE RdShtHex() : SHORTCARD;
  1041. 580 VAR
  1042. 581 S : Str80;
  1043. ***** ^ not supported yet
  1044. 582 i : LONGCARD;
  1045. ***** ^ undeclared identifier
  1046. 583 b : BOOLEAN;
  1047. 584 BEGIN
  1048. 585 RdItem(S);
  1049. ***** ^ undeclared identifier
  1050. ***** ^ not supported yet
  1051. 586 i := Str.StrToCard( S,16,b );
  1052. ***** ^ not supported yet
  1053. ***** ^ not supported yet
  1054. ***** ^ not supported yet
  1055. ***** ^ not supported yet
  1056. ***** ^ not supported yet
  1057. 587 (*%T _mthread *)
  1058. 588 SetThreadOK(b AND (i < 100H));
  1059. ***** ^ not supported yet
  1060. ***** ^ not supported yet
  1061. ***** ^ not supported yet
  1062. 589 (*%E *)
  1063. 590 OK := b AND (i < 100H);
  1064. ***** ^ undeclared identifier
  1065. ***** ^ not supported yet
  1066. 591 RETURN SHORTCARD( i );
  1067. ***** ^ not supported yet
  1068. 592 END RdShtHex;
  1069. ***** ^ not supported yet
  1070. 593
  1071. 594 PROCEDURE RdCard() : CARDINAL;
  1072. 595 VAR
  1073. 596 S : Str80;
  1074. ***** ^ not supported yet
  1075. 597 i : LONGCARD;
  1076. ***** ^ undeclared identifier
  1077. 598 b : BOOLEAN;
  1078. 599 BEGIN
  1079. 600 RdItem(S);
  1080. ***** ^ undeclared identifier
  1081. ***** ^ not supported yet
  1082. 601 i := Str.StrToCard( S,10,b );
  1083. ***** ^ not supported yet
  1084. ***** ^ not supported yet
  1085. ***** ^ not supported yet
  1086. ***** ^ not supported yet
  1087. ***** ^ not supported yet
  1088. 602 (*%T _mthread *)
  1089. 603 SetThreadOK(b AND (i < 10000H));
  1090. ***** ^ not supported yet
  1091. ***** ^ not supported yet
  1092. ***** ^ not supported yet
  1093. 604 (*%E *)
  1094. 605 OK := b AND (i < 10000H);
  1095. ***** ^ undeclared identifier
  1096. ***** ^ not supported yet
  1097. 606 RETURN CARDINAL( i );
  1098. ***** ^ not supported yet
  1099. 607 END RdCard;
  1100. ***** ^ not supported yet
  1101. 608
  1102. 609 PROCEDURE RdHex() : CARDINAL;
  1103. 610 VAR
  1104. 611 S : Str80;
  1105. ***** ^ not supported yet
  1106. 612 i : LONGCARD;
  1107. ***** ^ undeclared identifier
  1108. 613 b : BOOLEAN;
  1109. 614 BEGIN
  1110. 615 RdItem(S);
  1111. ***** ^ undeclared identifier
  1112. ***** ^ not supported yet
  1113. 616 i := Str.StrToCard( S,16,b );
  1114. ***** ^ not supported yet
  1115. ***** ^ not supported yet
  1116. ***** ^ not supported yet
  1117. ***** ^ not supported yet
  1118. ***** ^ not supported yet
  1119. 617 (*%T _mthread *)
  1120. 618 SetThreadOK(b AND (i < 10000H));
  1121. ***** ^ not supported yet
  1122. ***** ^ not supported yet
  1123. ***** ^ not supported yet
  1124. 619 (*%E *)
  1125. 620 OK := b AND (i < 10000H);
  1126. ***** ^ undeclared identifier
  1127. ***** ^ not supported yet
  1128. 621 RETURN CARDINAL( i );
  1129. ***** ^ not supported yet
  1130. 622 END RdHex;
  1131. ***** ^ not supported yet
  1132. 623
  1133. 624 PROCEDURE RdLngCard() : LONGCARD;
  1134. ***** ^ undeclared identifier
  1135. 625 VAR
  1136. 626 S : Str80;
  1137. ***** ^ not supported yet
  1138. 627 i : LONGCARD;
  1139. ***** ^ undeclared identifier
  1140. 628 b : BOOLEAN;
  1141. 629 BEGIN
  1142. 630 RdItem(S);
  1143. ***** ^ undeclared identifier
  1144. ***** ^ not supported yet
  1145. 631 i := Str.StrToCard( S,10,b );
  1146. ***** ^ not supported yet
  1147. ***** ^ not supported yet
  1148. ***** ^ not supported yet
  1149. ***** ^ not supported yet
  1150. ***** ^ not supported yet
  1151. 632 (*%T _mthread *)
  1152. 633 SetThreadOK(b);
  1153. ***** ^ not supported yet
  1154. ***** ^ not supported yet
  1155. 634 (*%E *)
  1156. 635 OK := b;
  1157. ***** ^ undeclared identifier
  1158. 636 RETURN i;
  1159. ***** ^ not supported yet
  1160. 637 END RdLngCard;
  1161. ***** ^ not supported yet
  1162. 638
  1163. 639 PROCEDURE RdLngHex() : LONGCARD;
  1164. ***** ^ undeclared identifier
  1165. 640 VAR
  1166. 641 S : Str80;
  1167. ***** ^ not supported yet
  1168. 642 i : LONGCARD;
  1169. ***** ^ undeclared identifier
  1170. 643 b : BOOLEAN;
  1171. 644 BEGIN
  1172. 645 RdItem(S);
  1173. ***** ^ undeclared identifier
  1174. ***** ^ not supported yet
  1175. 646 i := Str.StrToCard( S,16,b );
  1176. ***** ^ not supported yet
  1177. ***** ^ not supported yet
  1178. ***** ^ not supported yet
  1179. ***** ^ not supported yet
  1180. ***** ^ not supported yet
  1181. 647 (*%T _mthread *)
  1182. 648 SetThreadOK(b);
  1183. ***** ^ not supported yet
  1184. ***** ^ not supported yet
  1185. 649 (*%E *)
  1186. 650 OK := b;
  1187. ***** ^ undeclared identifier
  1188. 651 RETURN i;
  1189. ***** ^ not supported yet
  1190. 652 END RdLngHex ;
  1191. ***** ^ not supported yet
  1192. 653
  1193. 654 PROCEDURE RdReal() : REAL;
  1194. 655 VAR
  1195. 656 S : Str80;
  1196. ***** ^ not supported yet
  1197. 657 r : LONGREAL;
  1198. 658 b : BOOLEAN;
  1199. 659 BEGIN
  1200. 660 RdItem(S );
  1201. ***** ^ undeclared identifier
  1202. ***** ^ not supported yet
  1203. 661 r := Str.StrToReal( S,b);
  1204. ***** ^ not supported yet
  1205. ***** ^ not supported yet
  1206. ***** ^ not supported yet
  1207. ***** ^ not supported yet
  1208. 662 (*%T _mthread *)
  1209. 663 SetThreadOK(b AND (ABS(r) <= 3.4E38 ));
  1210. ***** ^ not supported yet
  1211. ***** ^ undeclared identifier
  1212. ***** ^ not supported yet
  1213. ***** ^ not supported yet
  1214. 664 (*%E *)
  1215. 665 OK := b AND (ABS(r) <= 3.4E38 );
  1216. ***** ^ undeclared identifier
  1217. ***** ^ undeclared identifier
  1218. ***** ^ not supported yet
  1219. 666 RETURN REAL ( r );
  1220. ***** ^ not supported yet
  1221. 667 END RdReal;
  1222. ***** ^ not supported yet
  1223. 668
  1224. 669 PROCEDURE RdLngReal() : LONGREAL;
  1225. 670 VAR
  1226. 671 S : Str80;
  1227. ***** ^ not supported yet
  1228. 672 r : LONGREAL;
  1229. 673 b : BOOLEAN;
  1230. 674 BEGIN
  1231. 675 RdItem(S);
  1232. ***** ^ undeclared identifier
  1233. ***** ^ not supported yet
  1234. 676 r := Str.StrToReal( S,b);
  1235. ***** ^ not supported yet
  1236. ***** ^ not supported yet
  1237. ***** ^ not supported yet
  1238. ***** ^ not supported yet
  1239. 677 (*%T _mthread *)
  1240. 678 SetThreadOK(b);
  1241. ***** ^ not supported yet
  1242. ***** ^ not supported yet
  1243. 679 (*%E *)
  1244. 680 OK := b;
  1245. ***** ^ undeclared identifier
  1246. 681 RETURN r;
  1247. 682 END RdLngReal;
  1248. ***** ^ not supported yet
  1249. 683
  1250. 684
  1251. 685 PROCEDURE RdLn;
  1252. 686 BEGIN
  1253. 687 s:=e;
  1254. 688 END RdLn;
  1255. ***** ^ not supported yet
  1256. 689
  1257. 690 PROCEDURE EndOfRd(Skip: BOOLEAN) : BOOLEAN;
  1258. 691 BEGIN
  1259. 692 IF Skip THEN
  1260. 693 WHILE (s < e) AND (Buffer[s] IN Separators) DO INC(s) END;
  1261. ***** ^ not supported yet
  1262. ***** ^ not supported yet
  1263. ***** ^ undeclared identifier
  1264. ***** ^ undeclared identifier
  1265. ***** ^ not supported yet
  1266. 694 END;
  1267. 695 RETURN s = e;
  1268. 696 END EndOfRd;
  1269. ***** ^ not supported yet
  1270. 697
  1271. 698 PROCEDURE RdItem(VAR V: ARRAY OF CHAR);
  1272. ***** ^ not supported yet
  1273. 699 VAR L,i : CARDINAL;
  1274. 700 BEGIN
  1275. 701 OK := TRUE;
  1276. ***** ^ undeclared identifier
  1277. 702 (*%T _mthread *)
  1278. 703 SetThreadOK(TRUE);
  1279. ***** ^ not supported yet
  1280. ***** ^ not supported yet
  1281. 704 (*%E *)
  1282. 705 L := HIGH(V);
  1283. ***** ^ undeclared identifier
  1284. ***** ^ not supported yet
  1285. 706 REPEAT
  1286. 707 IF s=e THEN RdBuff(); END;
  1287. ***** ^ not supported yet
  1288. ***** ^ not supported yet
  1289. 708 WHILE (s<e) AND ( Buffer[s] IN Separators ) DO INC(s); END;
  1290. ***** ^ not supported yet
  1291. ***** ^ not supported yet
  1292. ***** ^ undeclared identifier
  1293. ***** ^ undeclared identifier
  1294. ***** ^ not supported yet
  1295. 709 i := 0;
  1296. 710 WHILE (s<e) AND (i<=L) AND NOT ( Buffer[s] IN Separators ) DO
  1297. ***** ^ not supported yet
  1298. ***** ^ not supported yet
  1299. ***** ^ undeclared identifier
  1300. 711 V[i] := Buffer[s];
  1301. ***** ^ not supported yet
  1302. ***** ^ not supported yet
  1303. ***** ^ not supported yet
  1304. ***** ^ not supported yet
  1305. 712 INC(s);
  1306. ***** ^ undeclared identifier
  1307. ***** ^ not supported yet
  1308. 713 INC(i);
  1309. ***** ^ undeclared identifier
  1310. ***** ^ not supported yet
  1311. 714 END;
  1312. 715 IF i <= L THEN V[i] := CHR(0); END;
  1313. ***** ^ not supported yet
  1314. ***** ^ not supported yet
  1315. ***** ^ undeclared identifier
  1316. ***** ^ not supported yet
  1317. 716 UNTIL V[0] # CHR(0);
  1318. ***** ^ not supported yet
  1319. ***** ^ not supported yet
  1320. ***** ^ undeclared identifier
  1321. ***** ^ not supported yet
  1322. 717 END RdItem;
  1323. ***** ^ not supported yet
  1324. 718
  1325. 719 PROCEDURE RdChar() : CHAR;
  1326. 720 VAR
  1327. 721 c : CHAR;
  1328. 722 t : BOOLEAN;
  1329. 723 BEGIN
  1330. 724 IF s >= e THEN RdBuff; END;
  1331. ***** ^ not supported yet
  1332. 725 INC (s);
  1333. ***** ^ undeclared identifier
  1334. ***** ^ not supported yet
  1335. 726 RETURN Buffer[s-1];
  1336. ***** ^ not supported yet
  1337. ***** ^ not supported yet
  1338. 727 END RdChar;
  1339. ***** ^ not supported yet
  1340. 728
  1341. 729 (*%F _OS2 *)
  1342. 730 PROCEDURE RedirectInput(FileName: ARRAY OF CHAR);
  1343. 731 VAR c : CARDINAL;
  1344. 732 r : SYSTEM.Registers;
  1345. 733 fn: PathStr;
  1346. 734 BEGIN
  1347. 735 GetName(FileName,fn);
  1348. 736 WITH r DO
  1349. 737 BX := 0;
  1350. 738 AH := 3EH; (* close file *)
  1351. 739 Lib.Dos(r);
  1352. 740 DS := Seg(fn);
  1353. 741 DX := Ofs(fn);
  1354. 742 CX := 0;
  1355. 743 AX := 3D00H; (* open for read *)
  1356. 744 Lib.Dos(r);
  1357. 745 END;
  1358. 746 InputRedirected := (Str.Compare(fn,ConStr) # 0);
  1359. 747 END RedirectInput;
  1360. 748
  1361. 749 PROCEDURE RedirectOutput(FileName: ARRAY OF CHAR);
  1362. 750 VAR c : CARDINAL;
  1363. 751 r : SYSTEM.Registers;
  1364. 752 fn: PathStr;
  1365. 753 BEGIN
  1366. 754 GetName(FileName,fn);
  1367. 755 WITH r DO
  1368. 756 BX := 1;
  1369. 757 AH := 3EH; (* close file *)
  1370. 758 Lib.Dos(r);
  1371. 759 DS := Seg(fn);
  1372. 760 DX := Ofs(fn);
  1373. 761 CX := 0;
  1374. 762 AX := 3C00H; (* Create *)
  1375. 763 Lib.Dos(r);
  1376. 764 END ;
  1377. 765 OutputRedirected := (Str.Compare(fn,ConStr) # 0);
  1378. 766 END RedirectOutput;
  1379. 767 (*%E *)
  1380. 768
  1381. 769 (*%T _OS2 *)
  1382. 770 PROCEDURE RedirectInput(FileName: ARRAY OF CHAR);
  1383. ***** ^ not supported yet
  1384. 771 VAR
  1385. 772 InputHandle, NewHandle: CARDINAL;
  1386. 773 ErrMsg: ARRAY [0..99] OF CHAR;
  1387. ***** ^ not supported yet
  1388. ***** ^ not supported yet
  1389. 774 fn: PathStr;
  1390. ***** ^ not supported yet
  1391. 775 BEGIN
  1392. 776 GetName(FileName,fn);
  1393. ***** ^ not supported yet
  1394. ***** ^ not supported yet
  1395. ***** ^ not supported yet
  1396. 777 InputHandle := 0;
  1397. 778 NewHandle := CoreIO._os2_open(fn, CARDINAL(CoreIO.O_RDONLY), 1, 1);
  1398. ***** ^ not supported yet
  1399. ***** ^ not supported yet
  1400. ***** ^ not supported yet
  1401. ***** ^ not supported yet
  1402. ***** ^ not supported yet
  1403. ***** ^ not supported yet
  1404. 779 IF NewHandle = MAX(CARDINAL) THEN
  1405. ***** ^ undeclared identifier
  1406. ***** ^ not supported yet
  1407. 780 Str.Concat(ErrMsg,'RedirectInput: ',fn);
  1408. ***** ^ not supported yet
  1409. ***** ^ not supported yet
  1410. ***** ^ not supported yet
  1411. ***** ^ not supported yet
  1412. ***** ^ not supported yet
  1413. 781 Lib.RunTimeError(CoreSig._FatalErrorPos(), 0BEH, ErrMsg);
  1414. ***** ^ not supported yet
  1415. ***** ^ not supported yet
  1416. ***** ^ not supported yet
  1417. ***** ^ not supported yet
  1418. ***** ^ not supported yet
  1419. ***** ^ not supported yet
  1420. 782 END;
  1421. 783 Dos.DupHandle(NewHandle, InputHandle);
  1422. ***** ^ not supported yet
  1423. ***** ^ not supported yet
  1424. ***** ^ not supported yet
  1425. 784 Dos.Close(NewHandle);
  1426. ***** ^ not supported yet
  1427. ***** ^ not supported yet
  1428. ***** ^ not supported yet
  1429. 785 InputRedirected := (Str.Compare(fn,ConStr) # 0);
  1430. ***** ^ undeclared identifier
  1431. ***** ^ not supported yet
  1432. ***** ^ not supported yet
  1433. ***** ^ not supported yet
  1434. ***** ^ not supported yet
  1435. 786 END RedirectInput;
  1436. ***** ^ not supported yet
  1437. 787
  1438. 788 PROCEDURE RedirectOutput(FileName: ARRAY OF CHAR);
  1439. ***** ^ not supported yet
  1440. 789 VAR
  1441. 790 OutputHandle, NewHandle: CARDINAL;
  1442. 791 ErrMsg: ARRAY [0..99] OF CHAR;
  1443. ***** ^ not supported yet
  1444. ***** ^ not supported yet
  1445. 792 fn: PathStr;
  1446. ***** ^ not supported yet
  1447. 793 BEGIN
  1448. 794 GetName(FileName,fn);
  1449. ***** ^ not supported yet
  1450. ***** ^ not supported yet
  1451. ***** ^ not supported yet
  1452. 795 OutputHandle := 1;
  1453. 796 NewHandle := CoreIO._os2_open(FileName, CARDINAL(CoreIO.O_RDWR), 0, 12H);
  1454. ***** ^ not supported yet
  1455. ***** ^ not supported yet
  1456. ***** ^ not supported yet
  1457. ***** ^ not supported yet
  1458. ***** ^ not supported yet
  1459. ***** ^ not supported yet
  1460. 797 IF NewHandle = MAX(CARDINAL) THEN
  1461. ***** ^ undeclared identifier
  1462. ***** ^ not supported yet
  1463. 798 Str.Concat(ErrMsg,'RedirectOutput: ',fn);
  1464. ***** ^ not supported yet
  1465. ***** ^ not supported yet
  1466. ***** ^ not supported yet
  1467. ***** ^ not supported yet
  1468. ***** ^ not supported yet
  1469. 799 Lib.RunTimeError(CoreSig._FatalErrorPos(), 0BFH, ErrMsg);
  1470. ***** ^ not supported yet
  1471. ***** ^ not supported yet
  1472. ***** ^ not supported yet
  1473. ***** ^ not supported yet
  1474. ***** ^ not supported yet
  1475. ***** ^ not supported yet
  1476. 800 END;
  1477. 801 Dos.DupHandle(NewHandle, OutputHandle);
  1478. ***** ^ not supported yet
  1479. ***** ^ not supported yet
  1480. ***** ^ not supported yet
  1481. 802 Dos.Close(NewHandle);
  1482. ***** ^ not supported yet
  1483. ***** ^ not supported yet
  1484. ***** ^ not supported yet
  1485. 803 OutputRedirected := (Str.Compare(fn,ConStr) # 0);
  1486. ***** ^ undeclared identifier
  1487. ***** ^ not supported yet
  1488. ***** ^ not supported yet
  1489. ***** ^ not supported yet
  1490. ***** ^ not supported yet
  1491. 804 END RedirectOutput;
  1492. ***** ^ not supported yet
  1493. 805 (*%E *)
  1494. 806
  1495. 807 PROCEDURE ThreadOK(): BOOLEAN;
  1496. 808
  1497. 809 BEGIN
  1498. 810 (*%T _mthread *)
  1499. 811 RETURN OKTable[CoreProc._getTID()];
  1500. ***** ^ not supported yet
  1501. ***** ^ not supported yet
  1502. ***** ^ not supported yet
  1503. ***** ^ not supported yet
  1504. 812 (*%E *)
  1505. 813 (*%F _mthread *)
  1506. 814 RETURN OK;
  1507. 815 (*%E *)
  1508. 816 END ThreadOK;
  1509. ***** ^ not supported yet
  1510. 817
  1511. 818 (*%T _mthread *)
  1512. 819 VAR
  1513. 820 n : [1..Process.MaxProcess];
  1514. ***** ^ not supported yet
  1515. ***** ^ not supported yet
  1516. 821 (*%E *)
  1517. 822 BEGIN
  1518. 823 (*%T _mthread *)
  1519. 824 n := 1;
  1520. ***** ^ not supported yet
  1521. 825 WHILE n <= Process.MaxProcess DO
  1522. ***** ^ not supported yet
  1523. ***** ^ not supported yet
  1524. ***** ^ not supported yet
  1525. 826 OKTable[n] := TRUE;
  1526. ***** ^ not supported yet
  1527. ***** ^ not supported yet
  1528. 827 INC(n);
  1529. ***** ^ undeclared identifier
  1530. ***** ^ not supported yet
  1531. 828 END;
  1532. 829 (*%E *)
  1533. 830 (*%F _OS2 *)
  1534. 831 Prompt := TRUE;
  1535. 832 RdLnOnWr := FALSE;
  1536. 833 WrStrRedirect := TerminalWrStr;
  1537. 834 RdStrRedirect := TerminalRdStr;
  1538. 835 s := e;
  1539. 836 OK := TRUE;
  1540. 837 ChopOff := FALSE;
  1541. 838 Separators := CHARSET{CHR(9),CHR(10),CHR(13),CHR(26),' '};
  1542. 839 Eng := FALSE;
  1543. 840 LWW := FALSE;
  1544. 841 InputRedirected := FALSE;
  1545. 842 OutputRedirected := FALSE;
  1546. 843 PrefixChar := ' ';
  1547. 844 SuffixChar := ' ';
  1548. 845 (*%E *)
  1549. 846
  1550. 847 (*%T _OS2 *)
  1551. 848 Prompt := FALSE;
  1552. ***** ^ undeclared identifier
  1553. 849 RdLnOnWr := FALSE;
  1554. ***** ^ undeclared identifier
  1555. 850 VIOoutput := FALSE;
  1556. 851 InputRedirected := FALSE;
  1557. ***** ^ undeclared identifier
  1558. 852 OutputRedirected := FALSE;
  1559. ***** ^ undeclared identifier
  1560. 853 WrStrRedirect := TerminalWrStr;
  1561. ***** ^ undeclared identifier
  1562. ***** ^ not supported yet
  1563. 854 RdStrRedirect := TerminalRdStr;
  1564. ***** ^ undeclared identifier
  1565. ***** ^ not supported yet
  1566. 855 s := e;
  1567. 856 OK := TRUE;
  1568. ***** ^ undeclared identifier
  1569. 857 ChopOff := FALSE;
  1570. ***** ^ undeclared identifier
  1571. 858 Separators := CHARSET{CHR(9),CHR(10),CHR(13),CHR(26),' '};
  1572. ***** ^ undeclared identifier
  1573. ***** ^ undeclared identifier
  1574. 859 Eng := FALSE;
  1575. 860 LWW := FALSE;
  1576. 861 tchar := 0C;
  1577. 862 InputRedirected := FALSE;
  1578. 863 OutputRedirected := FALSE;
  1579. 864 PrefixChar := ' ';
  1580. 865 SuffixChar := ' ';
  1581. 866 (*%E *)
  1582. 867 END IO.
  1583. 714 errors