USEPASU.PAS 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116
  1. { VERSION of USEPASU.PAS:
  2. ====== 1.50 ======
  3. accords only to TURBO.TPL with time " 01:50" (or later)
  4. REVISIONS:
  5. Since version 1.46 , 25-mar-1991 :
  6. The "USEs units" (all but DEFINE) directive is ported from
  7. interface part to implementation part; TURBO.TPL is changed !
  8. Since version 1.47 , 8-apr-1991 :
  9. DEFINE DOSCRT appeared and disappeared for some cases.
  10. DEFINE SDLBL appeared for some SDL cases.
  11. Since version 1.50 , 8-apr-1991 :
  12. No more define/undefine options.
  13. Since version 2.0 #CALL_PAS(46 , 45) return their argument to
  14. the interpreter.
  15. Since version 2.03 #CALL_PAS( 35,36,37,38 ) present,
  16. New scaner ( unit SCAN ) is added to implementation part.
  17. Since version 2.06 #CALL_PAS(73 74 75) present
  18. Since version 2.08 #CALL_PAS(76 77) present
  19. Since version 2.09 Conditional compilation $DLL for USE_PAS(76 77)
  20. present
  21. Since version 2.12 #CALL_PAS(78 $N) used to restrict PRINT depth
  22. Since version 2.14
  23. #CALL_PAS(80 SIGN $R1 $R2) used for operations
  24. with #FATOM atoms and real numbers
  25. #CALL_PAS(81 APPL TOPIC) used for Window start up
  26. #CALL_PAS(82 MESS_TITLE MESS [code] ) used for the message boxes
  27. #CALL_PAS(83 QUESTION [ Standard_value ] ) used for the input boxes
  28. #CALL_PAS(84 Modenum ModeVal) modifies CRT Window sizes before first output
  29. [ 1,2 WindowOrg (Pix);3,4 Windowsize (pix);5,6 SeceenSize (symbols) ]
  30. Since version 2.15
  31. #CALL_PAS(85 TEXT)- Uppercase
  32. #CALL_PAS(86 TEXT) - Lowercase
  33. #CALL_PAS(87 TEXT V1 [V2]) - Substr(TEXT,V1,V2)
  34. #CALL_PAS(88 TEXT1 TEXT2) - Position of text1 in text2
  35. HOW TO USE :
  36. USEr's private functions are 101,102...
  37. Change "implementation" part only!
  38. HOW TO RECOMPILE :
  39. Rigal compiler refers to USEPasu.pas file
  40. if such file exist in current directory,
  41. otherwise copies it from distributive directory.
  42. Interpreter refers to USEPasu.pas in source directory only,
  43. if you haven't source code, then you can't change the interpreter.
  44. ERRORS : If Turbo Pascal compiler said "Unit version mismatch",
  45. it means you have old USEPASU.PAS in your directory, or
  46. you changed the interface part. Don't change it ! It is
  47. fixed yet in TURBO.TPL units. This interface part and TURBO.TPL
  48. must be of the same version.
  49. If you start work with NEW Rigal version - remove old USEPASU.PAS
  50. from YOUR directory !!!
  51. Of'course, USEPASU.TPU is not included in TURBO.TPL.
  52. COMPATIBILITY : All old options are working the same way as they
  53. appeared, except No.26 (Window) changed its format.
  54. Your own-written options compatibility is not supported if
  55. you had USEd version 1.44 or earlier !!!
  56. CONTACT : (0132)226997, Vadim Engelson,
  57. SU-226250,LUMII,Rainis b.29,Riga.
  58. e-mail vadim@lumii.lat.su
  59. If you have problems, learn UNITS
  60. and UNIT LIBRARIES in Borland's guide
  61. and then tell me:
  62. date,time,size of TURBO.TPL you USE and
  63. version of USEPASU.PAS
  64. *****************************************************
  65. *****************************************************
  66. ***** DON'T CHANGE TEXT HERE ! ***************}
  67. Unit USEpasu;
  68. interface USEs Define;
  69. {Procedure USE_X( COMPILER OR INTERPRETER ACCESS
  70. p1,p2,p3:a; arguments
  71. var rez:a);}
  72. Procedure USE_1(p1,p2,p3:a;var rez:a);
  73. Procedure USE_2(p1,p2,p3:a;var rez:a);
  74. Procedure USE_3(p1,p2,p3:a;var rez:a);
  75. Procedure USE_4(p1,p2,p3:a;var rez:a);
  76. Procedure USE_5(p1,p2,p3:a;var rez:a);
  77. Procedure USE_6(p1,p2,p3:a;var rez:a);
  78. Procedure USE_7(p1,p2,p3:a;var rez:a);
  79. Procedure USE_8(p1,p2,p3:a;var rez:a);
  80. Procedure USE_9(p1,p2,p3:a;var rez:a);
  81. Procedure USE_10(p1,p2,p3:a;var rez:a);
  82. Procedure USE_11(p1,p2,p3:a;var rez:a);
  83. Procedure USE_12(p1,p2,p3:a;var rez:a);
  84. Procedure USE_13(p1,p2,p3:a;var rez:a);
  85. Procedure USE_14(p1,p2,p3:a;var rez:a);
  86. Procedure USE_15(p1,p2,p3:a;var rez:a);
  87. Procedure USE_16(p1,p2,p3:a;var rez:a);
  88. Procedure USE_17(p1,p2,p3:a;var rez:a);
  89. Procedure USE_18(p1,p2,p3:a;var rez:a);
  90. Procedure USE_19(p1,p2,p3:a;var rez:a);
  91. Procedure USE_20(p1,p2,p3:a;var rez:a);
  92. Procedure USE_21(p1,p2,p3:a;var rez:a);
  93. Procedure USE_22(p1,p2,p3:a;var rez:a);
  94. Procedure USE_23(p1,p2,p3:a;var rez:a);
  95. Procedure USE_24(p1,p2,p3:a;var rez:a);
  96. Procedure USE_25(p1,p2,p3:a;var rez:a);
  97. Procedure USE_26(p1,p2,p3:a;var rez:a);
  98. Procedure USE_27(p1,p2,p3:a;var rez:a);
  99. Procedure USE_28(p1,p2,p3:a;var rez:a);
  100. Procedure USE_29(p1,p2,p3:a;var rez:a);
  101. Procedure USE_30(p1,p2,p3:a;var rez:a);
  102. Procedure USE_31(p1,p2,p3:a;var rez:a);
  103. Procedure USE_32(p1,p2,p3:a;var rez:a);
  104. Procedure USE_33(p1,p2,p3:a;var rez:a);
  105. Procedure USE_34(p1,p2,p3:a;var rez:a);
  106. Procedure USE_35(p1,p2,p3:a;var rez:a);
  107. Procedure USE_36(p1,p2,p3:a;var rez:a);
  108. Procedure USE_37(p1,p2,p3:a;var rez:a);
  109. Procedure USE_38(p1,p2,p3:a;var rez:a);
  110. Procedure USE_39(p1,p2,p3:a;var rez:a);
  111. Procedure USE_40(p1,p2,p3:a;var rez:a);
  112. Procedure USE_41(p1,p2,p3:a;var rez:a);
  113. Procedure USE_42(p1,p2,p3:a;var rez:a);
  114. Procedure USE_43(p1,p2,p3:a;var rez:a);
  115. Procedure USE_44(p1,p2,p3:a;var rez:a);
  116. Procedure USE_45(p1,p2,p3:a;var rez:a);
  117. Procedure USE_46(p1,p2,p3:a;var rez:a);
  118. Procedure USE_47(p1,p2,p3:a;var rez:a);
  119. Procedure USE_48(p1,p2,p3:a;var rez:a);
  120. Procedure USE_49(p1,p2,p3:a;var rez:a);
  121. Procedure USE_50(p1,p2,p3:a;var rez:a);
  122. Procedure USE_51(p1,p2,p3:a;var rez:a);
  123. Procedure USE_52(p1,p2,p3:a;var rez:a);
  124. Procedure USE_53(p1,p2,p3:a;var rez:a);
  125. Procedure USE_54(p1,p2,p3:a;var rez:a);
  126. Procedure USE_55(p1,p2,p3:a;var rez:a);
  127. Procedure USE_56(p1,p2,p3:a;var rez:a);
  128. Procedure USE_57(p1,p2,p3:a;var rez:a);
  129. Procedure USE_58(p1,p2,p3:a;var rez:a);
  130. Procedure USE_59(p1,p2,p3:a;var rez:a);
  131. Procedure USE_60(p1,p2,p3:a;var rez:a);
  132. Procedure USE_61(p1,p2,p3:a;var rez:a);
  133. Procedure USE_62(p1,p2,p3:a;var rez:a);
  134. Procedure USE_63(p1,p2,p3:a;var rez:a);
  135. Procedure USE_64(p1,p2,p3:a;var rez:a);
  136. Procedure USE_65(p1,p2,p3:a;var rez:a);
  137. Procedure USE_66(p1,p2,p3:a;var rez:a);
  138. Procedure USE_67(p1,p2,p3:a;var rez:a);
  139. Procedure USE_68(p1,p2,p3:a;var rez:a);
  140. Procedure USE_69(p1,p2,p3:a;var rez:a);
  141. Procedure USE_70(p1,p2,p3:a;var rez:a);
  142. Procedure USE_71(p1,p2,p3:a;var rez:a);
  143. Procedure USE_72(p1,p2,p3:a;var rez:a);
  144. Procedure USE_73(p1,p2,p3:a;var rez:a);
  145. Procedure USE_74(p1,p2,p3:a;var rez:a);
  146. Procedure USE_75(p1,p2,p3:a;var rez:a);
  147. Procedure USE_76(p1,p2,p3:a;var rez:a);
  148. Procedure USE_77(p1,p2,p3:a;var rez:a);
  149. Procedure USE_78(p1,p2,p3:a;var rez:a);
  150. Procedure USE_79(p1,p2,p3:a;var rez:a);
  151. Procedure USE_80(p1,p2,p3:a;var rez:a);
  152. Procedure USE_81(p1,p2,p3:a;var rez:a);
  153. Procedure USE_82(p1,p2,p3:a;var rez:a);
  154. Procedure USE_83(p1,p2,p3:a;var rez:a);
  155. Procedure USE_84(p1,p2,p3:a;var rez:a);
  156. Procedure USE_85(p1,p2,p3:a;var rez:a);
  157. Procedure USE_86(p1,p2,p3:a;var rez:a);
  158. Procedure USE_87(p1,p2,p3:a;var rez:a);
  159. Procedure USE_88(p1,p2,p3:a;var rez:a);
  160. Procedure USE_89(p1,p2,p3:a;var rez:a);
  161. Procedure USE_90(p1,p2,p3:a;var rez:a);
  162. Procedure USE_91(p1,p2,p3:a;var rez:a);
  163. Procedure USE_92(p1,p2,p3:a;var rez:a);
  164. Procedure USE_93(p1,p2,p3:a;var rez:a);
  165. Procedure USE_94(p1,p2,p3:a;var rez:a);
  166. Procedure USE_95(p1,p2,p3:a;var rez:a);
  167. Procedure USE_96(p1,p2,p3:a;var rez:a);
  168. Procedure USE_97(p1,p2,p3:a;var rez:a);
  169. Procedure USE_98(p1,p2,p3:a;var rez:a);
  170. Procedure USE_99(p1,p2,p3:a;var rez:a);
  171. Procedure USE_100(p1,p2,p3:a;var rez:a);
  172. Procedure USE_101(p1,p2,p3:a;var rez:a);
  173. Procedure USE_102(p1,p2,p3:a;var rez:a);
  174. Procedure USE_103(p1,p2,p3:a;var rez:a);
  175. Procedure USE_104(p1,p2,p3:a;var rez:a);
  176. Procedure USE_105(p1,p2,p3:a;var rez:a);
  177. Procedure USE_106(p1,p2,p3:a;var rez:a);
  178. Procedure USE_107(p1,p2,p3:a;var rez:a);
  179. Procedure USE_108(p1,p2,p3:a;var rez:a);
  180. Procedure USE_109(p1,p2,p3:a;var rez:a);
  181. Procedure USE_110(p1,p2,p3:a;var rez:a);
  182. Procedure USE_111(p1,p2,p3:a;var rez:a);
  183. Procedure USE_112(p1,p2,p3:a;var rez:a);
  184. Procedure USE_113(p1,p2,p3:a;var rez:a);
  185. Procedure USE_114(p1,p2,p3:a;var rez:a);
  186. Procedure USE_115(p1,p2,p3:a;var rez:a);
  187. Procedure USE_116(p1,p2,p3:a;var rez:a);
  188. Procedure USE_117(p1,p2,p3:a;var rez:a);
  189. Procedure USE_118(p1,p2,p3:a;var rez:a);
  190. Procedure USE_119(p1,p2,p3:a;var rez:a);
  191. Procedure USE_120(p1,p2,p3:a;var rez:a);
  192. Procedure USE_121(p1,p2,p3:a;var rez:a);
  193. Procedure USE_122(p1,p2,p3:a;var rez:a);
  194. Procedure USE_123(p1,p2,p3:a;var rez:a);
  195. Procedure USE_124(p1,p2,p3:a;var rez:a);
  196. Procedure USE_125(p1,p2,p3:a;var rez:a);
  197. Procedure USE_126(p1,p2,p3:a;var rez:a);
  198. Procedure USE_127(p1,p2,p3:a;var rez:a);
  199. Procedure USE_128(p1,p2,p3:a;var rez:a);
  200. Procedure USE_129(p1,p2,p3:a;var rez:a);
  201. Procedure USE_130(p1,p2,p3:a;var rez:a);
  202. Procedure USE_131(p1,p2,p3:a;var rez:a);
  203. Procedure USE_132(p1,p2,p3:a;var rez:a);
  204. Procedure USE_133(p1,p2,p3:a;var rez:a);
  205. Procedure USE_134(p1,p2,p3:a;var rez:a);
  206. Procedure USE_135(p1,p2,p3:a;var rez:a);
  207. Procedure USE_136(p1,p2,p3:a;var rez:a);
  208. Procedure USE_137(p1,p2,p3:a;var rez:a);
  209. Procedure USE_138(p1,p2,p3:a;var rez:a);
  210. Procedure USE_139(p1,p2,p3:a;var rez:a);
  211. Procedure USE_140(p1,p2,p3:a;var rez:a);
  212. Procedure USE_141(p1,p2,p3:a;var rez:a);
  213. Procedure USE_142(p1,p2,p3:a;var rez:a);
  214. Procedure USE_143(p1,p2,p3:a;var rez:a);
  215. Procedure USE_144(p1,p2,p3:a;var rez:a);
  216. Procedure USE_145(p1,p2,p3:a;var rez:a);
  217. Procedure USE_146(p1,p2,p3:a;var rez:a);
  218. Procedure USE_147(p1,p2,p3:a;var rez:a);
  219. Procedure USE_148(p1,p2,p3:a;var rez:a);
  220. Procedure USE_149(p1,p2,p3:a;var rez:a);
  221. Procedure USE_150(p1,p2,p3:a;var rez:a);
  222. Procedure USEPAS {INTERPRETER ACCESS}
  223. ( N : integer;{ Number of option }
  224. VAR PL:PTR; { Pointer to argument list }
  225. VAR rez:A );{ Result }
  226. var start_name:string80;
  227. (* filled by interpreter in INT.PAS,
  228. by compiler in C3.PAS/PROLOG,
  229. used in CALL_PAS(105) *)
  230. {*****************************************************}
  231. {*****************************************************}
  232. implementation
  233. {****************************************************}
  234. {****** CHANGE FOLLOWING TEXT ! *****************}
  235. USEs
  236. Defpage,Stlev,
  237. Leyer, Leder,
  238. TabUSE, Ruscode,
  239. Doutu, Poutlexu,
  240. {$IFDEF WIN}
  241. WinCrt,WinDos,RigDDE,RIF,USEIBOX,
  242. WinProcs,wintypes,strings,wexeclu,
  243. {$IFDEF DLL} rigimpo, {$ENDIF} { see USE_76, USE_77 }
  244. {$ELSE}
  245. Crt,Dos,
  246. {$ENDIF}
  247. Nef,Scan,Scanmif;
  248. {$I USINTER.PAS}
  249. var X:MPD;
  250. Function PLSTR(p0:a; { input - S-address}
  251. var STRVAL:bl80;{ output: array }
  252. var LENVAL:integer; { length of atom }
  253. STRINGFLAG:boolean; { need stringval ? }
  254. var STRINGVAL:string) { String }
  255. :boolean;
  256. { Returns array of letters of atom if it is list parameter; }
  257. { Stringval with the same contest returned only
  258. if required by StringFlag }
  259. Var ATM:AA; I:integer;
  260. begin
  261. STRINGVAL[0]:=char(0);
  262. if P0=NULL then PLSTR:=FALSE
  263. else begin
  264. POINTR(P0,x.SA);(* access to atom in memory *)
  265. if NOT (x.sad^.dtype IN ([ATOM..FATOM]-[NUMBER])) then PLSTR:=FALSE
  266. else begin
  267. ATM:=x.sad^.NAME;(* access to A-address *)
  268. POINTA(ATM,STRVAL,LENVAL);(* reads value to STR variable *)
  269. STRVAL[LENVAL+1]:=#0;
  270. if STRINGFLAG then begin
  271. STRINGVAL[0]:=char(LENVAL);
  272. FOR I:=1 TO LENVAL do STRINGVAL[I]:=STRVAL[I];
  273. (* and to StringVal variable *)
  274. end;
  275. PLSTR:=true;
  276. end;
  277. end;
  278. end; { PLSTR }
  279. Function BC(a:byte):char;
  280. begin if a>=10 then bc:=char(65+a-10)
  281. else bc:=char(48+a);
  282. end;
  283. Procedure Dump(adr:a;sad:a); { Physical address }
  284. type reftype=^byte;
  285. type refadr =^a;
  286. var p1:reftype;i,j:byte;p2:refadr;
  287. begin
  288. Writeln;
  289. Writeln(' S-Address=',sad,' Physical=',adr);
  290. for i:=0 to 9 do begin
  291. for j:=0 to 3 do begin
  292. p1:=reftype(longint(adr)+i*4+j);
  293. write(bc(p1^ shr 4),bc(p1^ and $0F));
  294. end;
  295. write(' ');
  296. for j:=0 to 3 do begin
  297. p1:=reftype(longint(adr)+i*4+j);
  298. if p1^>=32 then write(chr(p1^)) else write('.');
  299. end;
  300. p2:=refadr(longint(adr)+i*4);
  301. writeln(' ',refadr(p2)^);
  302. end;
  303. end;
  304. {==========================================================================}
  305. {==========================================================================}
  306. {===========================================================================}
  307. {===========================================================================}
  308. {-$DEFINE TABLES}
  309. {$DEFINE NOTABLES}
  310. LABEL 66,101,102,200;
  311. VAR A1,ATM : A;
  312. I,J,L,I1:INTEGER;
  313. error_rec_USE:error_rec_type;
  314. DT : DESCRIPTORTYPE;
  315. workfile:file;
  316. C:CHAR;
  317. ID:BOOLEAN;
  318. SV1,SV2,SVAR: string;
  319. STR : bl80;(*For POINTA & PUTATM*)
  320. IM: array[1..5] of longint;
  321. {$IFDEF TABLES}
  322. Procedure USE_59(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(59,P1,P2,P3,rez);end;
  323. Procedure USE_60(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(60,P1,P2,P3,rez);end;
  324. Procedure USE_61(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(61,P1,P2,P3,rez);end;
  325. Procedure USE_62(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(62,P1,P2,P3,rez);end;
  326. Procedure USE_63(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(63,P1,P2,P3,rez);end;
  327. Procedure USE_64(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(64,P1,P2,P3,rez);end;
  328. Procedure USE_65(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(65,P1,P2,P3,rez);end;
  329. Procedure USE_66(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(66,P1,P2,P3,rez);end;
  330. Procedure USE_67(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(67,P1,P2,P3,rez);end;
  331. Procedure USE_68(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(68,P1,P2,P3,rez);end;
  332. Procedure USE_69(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(69,P1,P2,P3,rez);end;
  333. Procedure USE_70(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(70,P1,P2,P3,rez);end;
  334. Procedure USE_71(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(71,P1,P2,P3,rez);end;
  335. Procedure USE_72(p1,p2,p3:a;var rez:a);begin rez:=NULL;TABDISP(72,P1,P2,P3,rez);end;
  336. {$ENDIF}
  337. {$IFDEF NOTABLES}
  338. Procedure USE_59(p1,p2,p3:a;var rez:a);begin end;
  339. Procedure USE_60(p1,p2,p3:a;var rez:a);begin end;
  340. Procedure USE_61(p1,p2,p3:a;var rez:a);begin end;
  341. Procedure USE_62(p1,p2,p3:a;var rez:a);begin end;
  342. Procedure USE_63(p1,p2,p3:a;var rez:a);begin end;
  343. Procedure USE_64(p1,p2,p3:a;var rez:a);begin end;
  344. Procedure USE_65(p1,p2,p3:a;var rez:a);begin end;
  345. Procedure USE_66(p1,p2,p3:a;var rez:a);begin end;
  346. Procedure USE_67(p1,p2,p3:a;var rez:a);begin end;
  347. Procedure USE_68(p1,p2,p3:a;var rez:a);begin end;
  348. Procedure USE_69(p1,p2,p3:a;var rez:a);begin end;
  349. Procedure USE_70(p1,p2,p3:a;var rez:a);begin end;
  350. Procedure USE_71(p1,p2,p3:a;var rez:a);begin end;
  351. Procedure USE_72(p1,p2,p3:a;var rez:a);begin end;
  352. {$endif}
  353. Procedure USE_105(p1,p2,p3:a;var rez:a);
  354. (* HOMEDIR *)
  355. var i:integer;
  356. {$IFDEF WIN}
  357. var pch,pchbig:pchar;
  358. begin
  359. GetMem(pch,80);
  360. GetMem(pchbig,80);
  361. StrPCopy(pch,start_name);
  362. FileExpand(pchbig,pch);
  363. start_name:=StrPas(pchbig);
  364. FreeMem(pch,80);
  365. FreeMem(pchbig,80);
  366. {$ELSE}
  367. begin
  368. start_name:=Fexpand(start_name);
  369. {$ENDIF}
  370. i:=Length(start_name);
  371. while (i<>1)and(start_name[i]<>'\') do dec(i);
  372. rez:=Str_to_textatom(Copy(start_name,1,i)); (* Changed in version 2.41 3-FEB-93 *)
  373. end;
  374. Procedure USE_42(p1,p2,p3:a;var rez:a);
  375. (* returns current PAGE (very USEful for big algorythms) *)
  376. begin
  377. GETS1(rez,x.SA);
  378. with x.snd^ do begin dtype:=NUMBER;cord:=0;
  379. VAL:=(rez+1)div(256*256*256);
  380. if VAL<0 then VAL:=256+VAL;
  381. end;
  382. end;
  383. Procedure USE_43(p1,p2,p3:a;var rez:a);
  384. (* returns #CALL_PAS(42) if current disk in USE,
  385. 0 otherwise. *)
  386. begin
  387. GETS1(rez,x.SA);
  388. with x.snd^ do begin dtype:=NUMBER;cord:=0;
  389. VOLS(IM[1],IM[2],VAL);
  390. end;
  391. end;
  392. Procedure USE_30(p1,p2,p3:a;var rez:a);
  393. begin
  394. rez:=NULL;
  395. (*Write atom or number*)
  396. if PLSTR(P1,STR,L,true,SV1) then write(SV1)
  397. else
  398. if PLNUM(P1,IM[1]) then write(IM[1]);
  399. end;
  400. Procedure USE_31(p1,p2,p3:a;var rez:a);
  401. begin
  402. (*Write atom or number with adding spaces after it or rupping the end*)
  403. rez:=0;
  404. if not PLSTR(P1,STR,L,true,SV1) then
  405. if not PLNUM(P1,IM[2]) then exit
  406. else system.STR(IM[2],SV1);
  407. if PLNUM(P2,IM[1]) then
  408. begin
  409. if IM[1]>Length(SV1) then
  410. for i:=Length(sv1)+1 to IM[1] do SV1[i]:=' ';
  411. sv1[0]:=chr(IM[1]);
  412. end;
  413. write(SV1);
  414. end;
  415. Procedure USE_5(p1,p2,p3:a;var rez:a);
  416. begin (* russian->english SDL coding *)
  417. rez:=P1;
  418. if PLSTR(P1,STR,L,false,SV1) then begin
  419. if not SDL_CODING(STR,rez,L,X)
  420. { here X is Global in USEpasu ! }
  421. then rez:=p1;
  422. end;
  423. end ;
  424. Procedure USE_1(p1,p2,p3:a;var rez:a);
  425. begin
  426. rez:=0;
  427. { Puts an atom (or NULL) to screen.
  428. USEr's answer (atom, identifier or number ) is returned }
  429. if PLSTR(P1,STR,L,true,SV1) then Write(SV1);
  430. READLN(SVAR);(* Enters from screen *)
  431. rez:=Str_to_atom(SVAR);
  432. end;
  433. Procedure USE_2(p1,p2,p3:a;var rez:a);
  434. { SDL/PASCAL Lexical analyser }
  435. begin rez:=0;
  436. if PLSTR(P1,STR,L,true,SV1) then LED(SV1,rez);end;
  437. Procedure USE_3(p1,p2,p3:a;var rez:a);
  438. { SDL/PASCAL Lexical analyser }
  439. begin rez:=0;
  440. if PLSTR(P1,STR,L,true,SV1) then LED(SV1,rez);end;
  441. {RIGAL Lexical analyser }
  442. Procedure USE_14(p1,p2,p3:a;var rez:a);
  443. begin rez:=0;
  444. if PLSTR(P1,STR,L,true,SV1) then LEY(SV1,rez,FALSE,error_rec_USE);
  445. end;
  446. Procedure USE_15(p1,p2,p3:a;var rez:a);
  447. begin rez:=0;
  448. if PLSTR(P1,STR,L,true,SV1) then LEY(SV1,rez,TRUE,error_rec_USE);
  449. end;
  450. Procedure USE_16(p1,p2,p3:a;var rez:a);
  451. begin rez:=0;
  452. if PLSTR(P1,STR,L,true,SV1) then begin
  453. Assign (INFILE[1], SV1);
  454. {$I-}
  455. Reset(INFILE[1]);
  456. If IOresult<>0 then exit;
  457. Rez:=NULL;
  458. While not(eof(INFILE[1])) do begin
  459. READLN(INFILE[1],SVAR);(* Enters from screen *)
  460. A1:=Str_to_textatom(SVAR); (* Changed in version 2.41 3-FEB-93 *)
  461. {$IFDEF OLD}
  462. A1:=NULL;
  463. Val(SVAR,IM[1],L);
  464. if L=0 then begin
  465. GETS1(A1,x.SA);
  466. with x.snd^ do begin dtype:=NUMBER;cord:=0;VAL:=IM[1]; end;
  467. end
  468. else
  469. begin
  470. if length(SVAR)<>0 then begin
  471. ID := SVAR[1] in LETTER;
  472. For i:=1 to length(SVAR) do
  473. ID := ID AND ( SVAR[i] IN SYMBOLS ) ;
  474. I:=length(SVAR);
  475. PUTATM(SVAR[1],I,ATM); (* makes A-Address *)
  476. GETS1(A1,x.SA); (* makes S-Address *)
  477. with x.sad^ do begin (* fills descriptor *)
  478. if ID then dtype:=IDATOM else dtype:=ATOM;
  479. NAME:=ATM;
  480. end; { with }
  481. end; {<>0}
  482. end; {else}
  483. {$ENDIF}
  484. LCONC(REZ,A1);
  485. end; {while eof}
  486. Close(INFILE[1]);
  487. end;
  488. end;
  489. Procedure USE_4(p1,p2,p3:a;var rez:a);
  490. begin rez:=0;
  491. (* finds coordinate of atom *)
  492. if P1<>0 then begin
  493. POINTR(P1,x.SA);
  494. if x.sad^.dtype IN [ATOM..FATOM]-[NUMBER] then A1:=x.sad^.cord
  495. else if x.snd^.dtype=NUMBER then A1:=x.snd^.cord
  496. else A1:=0;
  497. (* make numerical atom *)
  498. GETS1(rez,x.SA);
  499. with x.snd^ do begin (* fill descriptor *)
  500. dtype:=NUMBER;cord:=0;
  501. VAL:=A1;
  502. end;
  503. end;
  504. end;
  505. Procedure USE_6(p1,p2,p3:a;var rez:a);
  506. begin
  507. rez:=P1;
  508. if PLSTR(P1,STR,L,false,SV1) then begin
  509. FOR I:=2 TO L do begin
  510. if ((STR[I]='_')and(STR[I-1]='_')) then
  511. begin rez:=NULL;exit;end;
  512. end;
  513. end;
  514. end;
  515. Procedure USE_7(p1,p2,p3:a;var rez:a);
  516. begin
  517. rez:=0;
  518. if PLSTR(P1,STR,L,true,SV1) then begin
  519. if PLSTR(P2,STR,L,true,SV2) then begin
  520. Assign(workfile,sv1);
  521. {$I-} RENAME(workfile,SV2);
  522. IM[1]:=IOresult; {$I+}
  523. GETS1(rez,x.SA);with x.snd^ do begin dtype:=NUMBER;cord:=0;VAL:=IM[1];end;
  524. end;end;end;
  525. Procedure USE_8(p1,p2,p3:a;var rez:a);
  526. (* DELETEFILE *)
  527. begin rez:=0;
  528. if PLSTR(P1,STR,L,true,SV1) then begin
  529. Assign(workfile,sv1);
  530. {$I-} ERASE(workfile);
  531. IM[1]:=IOresult; {$I+}
  532. GETS1(rez,x.SA);with x.snd^ do begin dtype:=NUMBER;cord:=0;VAL:=IM[1];end;
  533. end;
  534. end;
  535. Procedure USE_10(p1,p2,p3:a;var rez:a);
  536. (* DUMP *)
  537. begin rez:=0;
  538. if P1<>0 then begin
  539. A1:=P1;
  540. REPEAT
  541. POINTR(A1,x.SA);
  542. Dump(x.sa,a1);
  543. Write(' Another address=');Readln(A1);
  544. UNTIL A1=0;
  545. end; end;
  546. Procedure USE_13(p1,p2,p3:a;var rez:a);
  547. begin
  548. (* Nice PRINT *)
  549. rez:=0;
  550. if P1<>0 then begin
  551. WRITELN; doUT(P1); end;end;
  552. Procedure USE_12(p1,p2,p3:a;var rez:a);
  553. begin rez:=0;
  554. (* Nice PRINT *)
  555. if P1<>0 then begin
  556. WRITELN(out); doUT2(P1);writeln(out); end;end;
  557. Procedure USE_19(p1,p2,p3:a;var rez:a);
  558. begin rez:=0; Randomize;end;
  559. Procedure USE_20(p1,p2,p3:a;var rez:a);
  560. (*RANDOM*)
  561. begin rez:=0;
  562. if PLNUM(P1,IM[1]) then rez:=Long_to_atom(Random(IM[1]));
  563. end;
  564. Procedure USE_21(p1,p2,p3:a;var rez:a);
  565. (* ATOM->NUMBER, others->NULL *)
  566. begin rez:=0;
  567. if PLSTR(P1,STR,L,true,SV1) then begin
  568. IF (SV1[L]='l') or (SV1[L]='L') then SV1:=Copy(SV1,1,L-1);
  569. Val(SV1,IM[1],L);
  570. if L=0 then rez:=Long_to_atom(IM[1]);
  571. { in v.2.20 returns NULL if not numeric value }
  572. end; end;
  573. var Erlist:a; { used to leave error message list in USEPAS after Scaner
  574. return it to another USEPAS call later - when it will
  575. be retrieved }
  576. Procedure USE_35(p1,p2,p3:a; var rez:a);
  577. { Scaner receives data from file }
  578. { Format #CALL_PAS(35 $DOS_FILENAME [ $OPTIONS ]) }
  579. { Returns NULL if file does not exist }
  580. begin
  581. rez:=0;
  582. if PLSTR(P1,STR,L,true,SV1) then begin { File name }
  583. if not PLSTR(P2,STR,L,true,SV2) then SV2:=''; { Options }
  584. INITIALIZE_SCAN_VARIABLES;
  585. Scaner (1,SV1,SV2,rez,erlist,NULL,0,0);
  586. end;end;
  587. Procedure USE_121(p1,p2,p3:a; var rez:a);
  588. { Scaner receives data from MIF file }
  589. { Format #CALL_PAS(121 $DOS_MIF_FILENAME [ $OPTIONS ]) }
  590. { Returns NULL if file does not exist }
  591. begin
  592. rez:=0;
  593. if PLSTR(P1,STR,L,true,SV1) then begin { File name }
  594. if not PLSTR(P2,STR,L,true,SV2) then SV2:=''; { Options }
  595. INITIALIZE_SCAN_VARIABLES_mif;
  596. Scaner_mif (1,SV1,SV2,rez,erlist,NULL,0,0);
  597. end;end;
  598. Procedure USE_36(p1,p2,p3:a; var rez:a);
  599. { Scaner receives data from list of strings,
  600. numbers and complex structures in the input list are ignored }
  601. { Format #CALL_PAS(36 $LIST [$OPTIONS] ) }
  602. begin
  603. rez:=0;
  604. if not PLSTR(P2,STR,L,true,SV2) then SV2:=''; { Options }
  605. INITIALIZE_SCAN_VARIABLES;
  606. Scaner (2,'',SV2,rez,erlist,p1,0,0);
  607. end;
  608. Procedure USE_37(p1,p2,p3:a; var rez:a);
  609. { Scaner receives data from absolute address, segment and offset are
  610. given , and memory is analysed until EOLN EOF EOLN characters;
  611. First character also must be EOLN;
  612. This EOLN must appear every 126 bytes or more often. }
  613. { Format #CALL_PAS(37 $SEGMENT $OFFSET [ $OPTIONS ] ) }
  614. begin
  615. rez:=0;
  616. if PLNUM(P1,IM[1]) then
  617. if PLNUM(P2,IM[2]) then begin
  618. if not PLSTR(P3,STR,L,true,SV2) then SV2:=''; { Options }
  619. INITIALIZE_SCAN_VARIABLES;
  620. Scaner (3,'',SV2,rez,erlist,NULL,IM[1],IM[2]);
  621. end;end;
  622. Procedure USE_38(p1,p2,p3:a; var rez:a);
  623. { returns error message list,
  624. produced after last call of "Scaner" }
  625. begin
  626. rez:=erlist;
  627. end;
  628. Procedure USE_40(p1,p2,p3:a;var rez:a);
  629. (* ANY -> S-address *)
  630. begin
  631. GETS1(rez,x.SA);
  632. with x.snd^ do begin dtype:=NUMBER;cord:=0;VAL:=P1; end;
  633. end;
  634. Procedure USE_41(p1,p2,p3:a;var rez:a);
  635. (* returns current S-address *)
  636. begin
  637. GETS1(rez,x.SA);
  638. with x.snd^ do begin dtype:=NUMBER;cord:=0;VAL:=rez; end;
  639. end;
  640. Procedure USE_44(p1,p2,p3:a;var rez:a);
  641. (* sets coordinate to atom *)
  642. begin rez:=0;
  643. if not PLNUM(P2,IM[1]) then exit;
  644. if P1<>0 then begin
  645. rez:=P1;
  646. A1:=P1;
  647. POINTS(A1,x.SA);
  648. if x.sad^.dtype IN [ATOM..FATOM]-[NUMBER] then x.sad^.cord:=IM[1]
  649. else if x.snd^.dtype=NUMBER then x.snd^.cord:=IM[1];
  650. end;
  651. end;
  652. Procedure USE_45(p1,p2,p3:a;var rez:a);
  653. begin
  654. REOPEN(rez,P1);
  655. { Removes all S-Space saving only this P1 value in result;
  656. All variables after that moment will have wrong values }
  657. { This not allowed in interpreter ! }
  658. end;
  659. Procedure USE_46(p1,p2,p3:a;var rez:a);
  660. begin rez:=NULL; end; { Returns null if we are in compiler }
  661. Procedure USE_47(p1,p2,p3:a;var rez:a);
  662. { Returns ATOM (Expanded form of file specification )
  663. if file exist }
  664. {$IFDEF WIN}
  665. var pch,pchbig:pchar;
  666. begin
  667. GetMem(pch,80);
  668. GetMem(pchbig,80);
  669. if PLSTR(P1,STR,L,true,SV1) then
  670. StrPCopy(pch,SV1) else StrCopy(pch,'');
  671. FileExpand(pchbig,pch);
  672. rez:=Str_to_textatom(StrPas(pchbig));
  673. FreeMem(pch,80);
  674. FreeMem(pchbig,80);
  675. end;
  676. {$ELSE}
  677. begin rez:=0;
  678. if PLSTR(P1,STR,L,true,SV1) then SV1:=Fexpand(SV1)
  679. else SV1:=Fexpand('');
  680. rez:=Str_to_textatom(SV1);
  681. end;
  682. {$ENDIF}
  683. Procedure USE_48(p1,p2,p3:a;var rez:a);
  684. { The argument if such file exists }
  685. begin
  686. rez:=0;
  687. if PLSTR(P1,STR,L,true,SV1) then
  688. if ExistFile(SV1) then rez:=p1;
  689. end;
  690. {*****************************************}
  691. {***** PLACE FOR USER'S FUNCTIONS *******}
  692. Procedure USE_9(p1,p2,p3:a;var rez:a);begin rez:=0; end;
  693. {$I USECRT.PAS}
  694. {$I USEDDE.PAS}
  695. {$I USEDLL.PAS}
  696. {$I USE132.PAS}
  697. Procedure USE_78(p1,p2,p3:a;var rez:a);
  698. begin
  699. if PLNUM(P1,IM[1]) then max_printlevel:=IM[1];
  700. end;
  701. Procedure USE_79(p1,p2,p3:a;var rez:a);
  702. var is_tree:boolean;AP:PTR;elnum:longint;
  703. label 22;
  704. begin
  705. rez:=NULL;
  706. first(p1,AP);
  707. is_tree:=(AP.PTRTYPE=PTRTREE);
  708. elnum:=0;
  709. while AP.NEL<>0 do begin
  710. inc(elnum);
  711. if EqAtoms(AP.cel,p2) then goto 22;
  712. next(AP);
  713. end;
  714. exit;
  715. 22:
  716. if is_tree then begin
  717. GETS1(rez,x.SA); (* makes S-Address *)
  718. with x.sad^ do begin (* fills descriptor *)
  719. dtype:=IDATOM;NAME:=AP.ARC;
  720. end; { with }
  721. end
  722. else rez:=long_to_atom(elnum);
  723. end;
  724. Procedure USE_91(p1,p2,p3:a;var rez:a);
  725. (* For LISTS - modifies list descriptor and
  726. makes it 1 element shorter by deleting ladst element ;
  727. Returns the argument.
  728. If length of list is 1 or 0 then this function returns NULL,
  729. but list descriptor is not modified (!!!)
  730. If argument is not list then returns NULL.
  731. E.g.
  732. $A:=(.A.)
  733. #CALL_PAS(91 $A) returns NULL , but $A retain (.A.)
  734. $A:=(.A B.)
  735. #CALL_PAS(91 $A) returns (.A.), and $A is (.A.)
  736. *)
  737. var is_tree:boolean;AP:PTR;elnum:longint;len:longint;
  738. label 22;
  739. begin
  740. REZ:=NULL;
  741. POINTS(P1,X.sa);
  742. if X.SMLD^.DTYPE<>LISTMAIN then Exit;
  743. len:= X.SMLD^.TOTALELNUM;
  744. if (len=1) or (len=0) then Exit;
  745. first(p1,AP);
  746. for i:=1 to len-2 do Next(AP);
  747. (* WE are standing on the last element of future list *)
  748. (* The next elements (or descriptor) are to cut off,
  749. we split to 4 cases main/fragm element/descriptor *)
  750. REZ:=P1;
  751. POINTS(AP.CURFRAGMENT,X.SA);
  752. if X.SMLD^.DTYPE=LISTMAIN
  753. then
  754. begin
  755. if AP.NEL=MAINLISTELNUM
  756. then
  757. begin X.SMLD^.NEXT:=NULL ;
  758. X.SMLD^.LASTFRAGM:=AP.CURFRAGMENT;
  759. (* Correction 8-APR-1993 *)
  760. end
  761. else DEC(X.SMLD^.ELNUM);
  762. DEC(X.SMLD^.TOTALELNUM);
  763. end
  764. else
  765. begin
  766. if AP.NEL=FRAGMLISTELNUM
  767. then begin
  768. X.SFLD^.NEXT:=NULL;
  769. POINTS(P1,X.SA);
  770. X.SMLD^.LASTFRAGM:=AP.CURFRAGMENT;
  771. (* Correction 8-APR-1993 *)
  772. end
  773. else DEC(X.SFLD^.ELNUM);
  774. POINTS(P1,X.SA);
  775. DEC(X.SMLD^.TOTALELNUM);
  776. end;
  777. end;
  778. Function SELECTION(tree,arc:a):a;
  779. var AP:PTR;
  780. begin
  781. SELECTION:=NULL;
  782. First(tree,AP);
  783. if AP.PTRTYPE<>PTRTREE then Exit;
  784. while (AP.NEL<>NULL)and(AP.ARC<>arc) do Next(AP);
  785. if AP.ARC=arc then SELECTION:=AP.CEL;
  786. end;
  787. Function INDEXING(list:a;index:longint):a;
  788. var AP:PTR;maxind:longint;
  789. begin
  790. INDEXING:=NULL;
  791. First(list,AP);
  792. if AP.PTRTYPE<>PTRLIST then Exit;
  793. POINTR(list,X.SA);
  794. maxind:=X.SMLD^.TOTALELNUM;
  795. if (index<-maxind)or(index=0)or(index>maxind) then exit;
  796. if index<0 then index:=maxind+index+1;
  797. for i:=1 to index-1 do Next(AP);
  798. INDEXING:=AP.CEL;
  799. end;
  800. Procedure USE_92(p1,p2,p3:a;var rez:a);
  801. (* Traverses list "p1".
  802. if element is a number then INDEX is applied to "p2"
  803. if element is an atom the SELECTION ia applied to "p2" *)
  804. var AP:PTR;
  805. begin
  806. REZ:=P2;
  807. First(p1,AP);
  808. if AP.PTRTYPE<>PTRLIST then begin rez:=NULL;Exit;end;
  809. while AP.NEL<>NULL do begin
  810. POINTR(AP.CEL,X.SA);
  811. if X.SND^.DTYPE=NUMBER then rez:=INDEXING(rez,X.SND^.VAL)
  812. else if X.SAD^.DTYPE=IDATOM then rez:=SELECTION(rez,X.SAD^.NAME)
  813. else rez:=NULL;
  814. if rez=NULL then Exit;
  815. Next(AP);
  816. end;
  817. end;
  818. Procedure USE_93(p1,p2,p3:a;var rez:a);
  819. begin
  820. (* returns stack size*)
  821. rez:=Long_to_atom(Sptr);
  822. end;
  823. Procedure USE_108(p1,p2,p3:a;var rez:a);
  824. { Get Environment variable ;
  825. Requires Variable name(string)
  826. Returns NULL if absent
  827. or value (converted to number if possible) }
  828. {$IFDEF WIN}
  829. var pc,pc2:pchar;
  830. {$ENDIF}
  831. begin
  832. rez:=0;
  833. {$IFDEF WIN}
  834. if PLSTR(P1,STR,L,false,SV1) then
  835. begin
  836. GetMem(pc,255);
  837. GetMem(pc2,255);
  838. StrPCopy(pc2,STR);
  839. pc2:=GetEnvVar(pc2);
  840. if pc2<>nil then
  841. begin
  842. StrCopy(pc,pc2);
  843. rez:=str_to_atom(StrPas(pc));
  844. end;
  845. end;
  846. {$ELSE}
  847. if PLSTR(P1,STR,L,true,SV1) then
  848. SV1:=GetEnv(SV1);
  849. if SV1<>'' then rez:=str_to_atom(SV1);
  850. {$ENDIF}
  851. end;
  852. Procedure USE_110(p1,p2,p3:a;var rez:a);
  853. (* SQRT *)
  854. begin rez:=0;
  855. if PLNUM(P1,IM[1]) then
  856. rez:=Long_to_atom(trunc(sqrt(IM[1])));
  857. end;
  858. Procedure USE_111(p1,p2,p3:a;var rez:a);
  859. (* SQRT(p1*p1+p2*p2) *)
  860. begin rez:=0;
  861. if PLNUM(P1,IM[1]) then
  862. IF plnum(p2,im[2]) THEN
  863. rez:=Long_to_atom(trunc(sqrt(iM[1]*im[1]+iM[2]*im[2])));
  864. end;
  865. Procedure USE_112(p1,p2,p3:a;var rez:a);
  866. (* SAVES S-CODE TO HANDLE IN GLOBAL MEMORY *)
  867. (* Returns handle value *)
  868. var DUMMYFILE:filespecification;
  869. begin
  870. rez:=NULL;
  871. if p1=NULL then Exit;
  872. {$IFDEF WIN}
  873. DEFPAGE.TMEMFLAG:=true;
  874. DEFPAGE.SAVES(DUMMYFILE,p1);
  875. (* WRITES usinng standard SAVES, a little modified *)
  876. DEFPAGE.TMEMFLAG:=false;
  877. rez:=long_to_atom(DEFPAGE.TMEMHANDLE);
  878. {$ENDIF}
  879. end;
  880. Procedure USE_113(p1,p2,p3:a;var rez:a);
  881. (* LOADS S-CODE FROM HANDLE IN GLOBAL MEMORY and
  882. INVALIDATES the handle *)
  883. var DUMMYFILE:filespecification;
  884. begin
  885. rez:=NULL;
  886. {$IFDEF WIN}
  887. if not PLNUM(p1,IM[1]) then Exit;
  888. if IM[1]=0 then Exit;
  889. DEFPAGE.TMEMHANDLE:=IM[1]; (* valid handle *)
  890. DEFPAGE.TMEMFLAG:=true;
  891. DEFPAGE.LOADS(DUMMYFILE,rez);
  892. (* READS using standard LOADS,a little modified*)
  893. DEFPAGE.TMEMFLAG:=false;
  894. {$ENDIF}
  895. end;
  896. Procedure USE_114(p1,p2,p3:a; var rez:a);
  897. { Scaner receives data from global memory chain.
  898. The global memory handle of the first chain element
  899. is given. Optional parameters of scanning can be given.
  900. The handle is stream-memory special handle, can
  901. be received from GRAD.DLL GetLDT function.
  902. Format #CALL_PAS(114 $HANDLE [ $OPTIONS ] ) }
  903. begin
  904. rez:=0;
  905. if PLNUM(P1,IM[1]) then
  906. if IM[1]<>0 then
  907. begin
  908. if not PLSTR(P2,STR,L,true,SV2) then SV2:=''; { Options }
  909. INITIALIZE_SCAN_VARIABLES;
  910. Scaner (4,'',SV2,rez,erlist,NULL,IM[1],0);
  911. end;
  912. end;
  913. Procedure USE_116(p1,p2,p3:a;var rez:a);
  914. { Returns C-string value 'a"bc\n' -> '"abc\\m\"' }
  915. begin
  916. rez:=0;
  917. if not PLSTR(P1,STR,L,true,SV1) then exit;
  918. sv2:='"';
  919. for i:=1 to L do begin
  920. if sv1[i] in ['"','\'] then sv2:=sv2+'\';
  921. sv2:=sv2+sv1[i];
  922. end;
  923. sv2:=sv2+'"';
  924. rez:=str_to_textatom(SV2);
  925. end;
  926. Procedure USE_119(p1,p2,p3:a; var rez:a);
  927. { Returns amount of available memory for windows }
  928. begin
  929. {$IFDEF WIN}
  930. rez:=NULL;
  931. lconc(rez,long_to_atom(memavail));
  932. lconc(rez,long_to_atom(GlobalCompact(32000)));
  933. {$ENDIF}
  934. end;
  935. {$IFDEF WIN}
  936. var srec:TSearchrec;
  937. {$ELSE}
  938. var srec:Searchrec;
  939. {$ENDIF}
  940. Procedure USE_120(p1,p2,p3:a; var rez:a);
  941. var attr:longint;
  942. pc:array[0..80]of char;
  943. { Calls FindFirst (PATH ATTR)
  944. or FindNext (),
  945. returns NULL or ( NAME SIZE TIME ATTR ) }
  946. begin
  947. rez:=NULL;
  948. if plstr(P1,STR,L,true,SV2) then begin end;
  949. if not plnum(P2,attr) then attr:=32;
  950. if p1<>NULL then
  951. begin
  952. {$IFDEF WIN}
  953. StrPcopy(pc,SV2);
  954. FindFirst(pc,attr,srec);
  955. {$ELSE}
  956. FindFirst(SV2,attr,srec);
  957. {$ENDIF}
  958. end
  959. else FindNext(srec);
  960. if DosError<>0 then begin rez:=NULL;exit;end;
  961. {$IFDEF WIN}
  962. lconc(rez,str_to_textatom(StrPas(srec.name) (* Changed in version 2.41 3-FEB-93 *)
  963. ));
  964. {$ELSE}
  965. lconc(rez,str_to_textatom(srec.name)); (* Changed in version 2.41 3-FEB-93 *)
  966. {$ENDIF}
  967. lconc(rez,long_to_atom(srec.size));
  968. lconc(rez,long_to_atom(srec.time));
  969. lconc(rez,long_to_atom(srec.attr));
  970. end;
  971. Procedure USE_122(p1,p2,p3:a; var rez:a);
  972. { Returns amount of available pages for windows }
  973. var busy_pages,allocated_pages,available_pages:longint;
  974. begin
  975. {$IFDEF WIN}
  976. vols(busy_pages,allocated_pages,available_pages);
  977. rez:=NULL;
  978. lconc(rez,long_to_atom(busy_pages));
  979. lconc(rez,long_to_atom(allocated_pages));
  980. lconc(rez,long_to_atom(available_pages));
  981. {$ENDIF}
  982. end;
  983. {$I USE80.PAS}
  984. {$I USERCALL.PAS}
  985. {*****************************************}
  986. begin
  987. ERLIST:=NULL;
  988. end.