RIG218.ME 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. IMPORTANT Changes in RIGAL 2.18
  2. ============ RIG218.DOK ===========
  3. CHANGES
  4. ADDITIONALS
  5. ERRORS CORRECTED
  6. 1. on ERRORS
  7. a. COPY for lists bow works correctly.
  8. b. LAST to inactive rule still can work incorrectly
  9. (error is not corrected)
  10. 2. SCANNER
  11. a. For symbolic strings which have not ending delimiter
  12. #_KEYWORD atom is produced
  13. b. Lexical Error coordinates now will appear correctly on screen
  14. 3. FATAL ERRORS
  15. a. Possible fatal errors are
  16. - Disk overflow during SAVE
  17. - Structured memory overflow (8 M, more is impossible)
  18. - Current disk overflow (DOS mode only)
  19. b. In Windows mode a MESSAGEBOX about fatal error appear
  20. 4. TURBO PASCAL FOR WINDOWS AS A SECOND PHASE
  21. a. Now we try to guarantee safety of call to MYTPW.EXE
  22. - .CFG files are generated in 1st phase every time
  23. - They are generated with correct disk and directory name
  24. - MYTPW can't save its Desktop or Configuration file
  25. - Filename.PAR is used as intermediate file instead of
  26. Filename.PAS for compilation of Filename.RIG in 2 phases.
  27. 5. STACK problems
  28. Stack limitations are set by $M directive :
  29. in Interpreter/Windows 38 K (it is maximum)
  30. Interpreter/DOS 60 K (it is maximum)
  31. in Compilation/Windows 22 K
  32. (it is maximum for GENPD.EXE,
  33. you can change it to 30-35 K for other tasks,
  34. use RIGWSRC.CFG or Options/Compiler/Memory in TPW environment)
  35. Compilation/DOS 32 K
  36. (see XCR0.BAT)
  37. Stack can not be more than 64-datasize-statics
  38. (datasize is summ of all string constants + something;
  39. it is reported at the end of Turbo Pascal command line compilation)
  40. (static is 5-10 Kb)
  41. When Stack overflows, Pascal runtime error 202 is reported
  42. 6. INTERPETER STACK
  43. Stack of INTERPETER variables is set to 1000 variables
  44. When it overflows, Rigal runtime error 1 is reported
  45. 7. HOME DIRECTORY
  46. For EXE files - directory where EXE is located.
  47. For interpreter - directory where File.RSC is located.
  48. Directory is given with ending slash (\).
  49. Call #CALL_PAS(105) to get it
  50. 8. APPEND
  51. Use
  52. OPEN XXX 'A.LST+'
  53. to append if file exists;
  54. to rewrite if file does not exist.
  55. 9. ACCESS TO DLL LIBRARIES
  56. Use
  57. #CALL_PAS(76) --to initialize buffers
  58. $HANDLE:=#CALL_PAS(101 'Lib.DLL') --to access library
  59. $PARAMETERS_or_ERRORCODE:=
  60. #CALL_PAS(102 $HANDLE $FUNCTION_NAME $PARAMETERS)
  61. -- to call function
  62. #CALL_PAS(103 $HANDLE) -- to free library
  63. IMPORTANT:
  64. 101======
  65. a. Library file name must be with full path.
  66. Otherwise Windows looks for DLL in PATH directories,
  67. then in disk "A:"
  68. You must use #CALL_PAS(105) or any PATH directory for compatibility
  69. $HANDLE>=32 is retured if OK
  70. 102======
  71. a. Function name must be exported by library.
  72. See GRAD.PAS to see correct parameter passing from/to DLL.
  73. Input and output $PARAMTERS are list of atoms (strings or numeric).
  74. For large strings (more than 80 bytes) special format
  75. (list of atoms) can be used.
  76. b. If error occur, not list, but number in 1000 .. 1020 is
  77. returned.
  78. 10. LIBRARY GRAD.DLL
  79. The following functions are allowed now to use with GRAD.DLL
  80. Function Parameters Returns
  81. -----------------------------------------------------------
  82. -- Monitor box functions (recommended for long execution)
  83. SB_CREATE (. 'title' .) -
  84. SB_NUM (. $num .) -
  85. SB_END - -
  86. -- Message Boxes with user's answer and without it
  87. R_MESSA (. 'Message' .) -
  88. R_MESSA (. 'Message' 'Title' .) -
  89. R_MESSA (. 'Message' 'Title' $nstyle .) (. $nAnswer .)
  90. -- here $nAnswer depends of $nstyle ans User's answer ----
  91. -- call DOS or Windows application
  92. R_WINEXEC (. 'c:\nc\nc.exe' .) (. $n .)
  93. -- here $n is >=32 if successful
  94. -- List box
  95. LB_INIT -
  96. LB_ADD (. $num_or_string .) (. $nFilled .)
  97. LB_ADD (. $n_or_s $n_or_s .) (. $nFilled .)
  98. -- $nFilled - how many lines are filled already
  99. -- Two paramters appear on screen separated by TAB in its line
  100. LB_GO - (. $nChosen .)
  101. -- Chosen line (starting from 1)
  102. LB_END
  103. ============ DLL.RIG ======================
  104. #S
  105. -- Test of work with DLL
  106. $E:=#CALL_PAS(76); -- Initialize all DLL access
  107. $FN:=#IMPLODE( #CALL_PAS(105) 'grad.DLL' );
  108. PRINT (. 'library is =' $FN .);
  109. $HA:=#CALL_PAS(101 $FN); -- Access to concrete DLL
  110. PRINT (. 'Library handle=' $HA .);
  111. IF $HA<32 -> PRINT (. No handle .) FI;
  112. -- Message Box function
  113. $VS:=#CALL_PAS(102 $HA 'ch' (. (.af ri ka.) 3 7 .) );
  114. -- Every function returns list of parameters or such answer as
  115. -- a number:
  116. -- 1000 #CALL_PAS(76) was not called
  117. -- 1001 1st paramter is not number
  118. -- 1002 2nd paramter is not atom
  119. -- 1003 3 handle is less than 32, Library was not opened for access
  120. -- 1004 no memory 80 bytes
  121. -- 1005 parameters are not formed in list,
  122. -- possible atom instead of list
  123. -- 1006 function not found in library
  124. -- (function must be declared as FAR and EXPORT)
  125. -- 1008 descriptor too small (see P_max_size in RIF.PAS )
  126. -- 1009 too many parameters (see P_max_cnt in RIF.PAS )
  127. -- 1010 wrong atoms in list of atoms which must represent
  128. -- super long string (only non numeric atoms allowed)
  129. -- 1011 wromg element (tree) in parameters
  130. -- Create Monitor box
  131. $VS:=#CALL_PAS(102 $HA 'SB_CREATE' (. 'Compiling CD Lagerverwaltung' .) );
  132. PRINT (. 'VS=' $VS .);
  133. LOOP
  134. $I+:=1;
  135. IF $I MOD 100=0 ->
  136. -- Modify monitor box with new number
  137. $VS:=#CALL_PAS(102 $HA 'SB_NUM' (. $I .) );
  138. FI;
  139. IF $I=1000 -> BREAK FI;
  140. END;
  141. -- remove monitor box
  142. $VS:=#CALL_PAS(102 $HA 'SB_END' );
  143. -- Call any Windows or DOS executable file
  144. IF #CALL_PAS(102 $HA 'R_MESSA' (.'Do you want NORTON ?' 'QQQ' 36.))=(.6.) ->
  145. #CALL_PAS(102 $HA 'R_MESSA' (. 'norton' .));
  146. $S:= #CALL_PAS(102 $HA R_WINEXEC (. 'C:\nc\nc' .) );
  147. PRINT (. 'S===' $S .);
  148. FI;
  149. --
  150. PRINT (. 'MB='
  151. #CALL_PAS(102 $HA 'R_MESSA'
  152. (.
  153. (. This ' ' is #CHR(13) big #CHR(13) Message ' ' box .)
  154. (. am er ika .)
  155. .) )
  156. .);
  157. -- Remove library from memory
  158. $FR:=#CALL_PAS(103 $HA);
  159. #CALL_PAS(1);
  160. ##
  161. =================== LBX.RIG ========================
  162. #LBX
  163. #CALL_PAS(76);
  164. $H:=#CALL_PAS(101 'G:\grad.dll');
  165. PRINT $H;
  166. $V:=#CALL_PAS(102 $H 'INPUT' (. afrika amerika .) );
  167. PRINT $V;
  168. $M:=#CALL_PAS(102 $H 'LB_INIT');
  169. PRINT $M;
  170. $M:=#CALL_PAS(102 $H 'LB_ADD' (. 5 YYY .) );
  171. PRINT $M;
  172. $M:=#CALL_PAS(102 $H 'LB_ADD' (. MTTT 789 .) );
  173. PRINT $M;
  174. $M:=#CALL_PAS(102 $H 'LB_ADD' (.
  175. M012345678901234567890123456789012345678901234567890
  176. K012345678901234567890123456789012345678901234567890
  177. .) );
  178. PRINT $M;
  179. $M:=#CALL_PAS(102 $H 'LB_GO' (. KOL .) );
  180. PRINT $M;
  181. #CALL_PAS(1);
  182. ##
  183.