MISC.LST 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. Listing:
  2. 1 IMPLEMENTATION MODULE Misc;
  3. 2 (*
  4. 3 Copyright (C) 1988,1989 Jensen & Partners International
  5. 4 *)
  6. 5
  7. 6 IMPORT Str, IO, Window;
  8. 7
  9. 8 PROCEDURE InputStr ( VAR S : ARRAY OF CHAR; MaxLen : CARDINAL ) ;
  10. ***** ^ not supported yet
  11. 9 (* Inputs a string, using Window module, allowing normal line editing *)
  12. 10 VAR
  13. 11 ins : BOOLEAN ;
  14. 12 k : CHAR ;
  15. 13 x,y,p,l,i : CARDINAL ;
  16. 14 BEGIN
  17. 15 x := Window.WhereX() ; y := Window.WhereY() ;
  18. ***** ^ not supported yet
  19. ***** ^ not supported yet
  20. ***** ^ not supported yet
  21. ***** ^ not supported yet
  22. ***** ^ not supported yet
  23. ***** ^ not supported yet
  24. 16 p := 0 ;
  25. 17 ins := TRUE ; (* Insert mode *)
  26. 18 IF (MaxLen = 0) THEN
  27. 19 l := Str.Length(S) ;
  28. ***** ^ not supported yet
  29. ***** ^ not supported yet
  30. ***** ^ not supported yet
  31. 20 ELSE
  32. 21 l := MaxLen;
  33. 22 END;
  34. 23 IO.WrCharRep(' ',l);
  35. ***** ^ not supported yet
  36. ***** ^ not supported yet
  37. ***** ^ not supported yet
  38. 24 Window.GotoXY(x,y);
  39. ***** ^ not supported yet
  40. ***** ^ not supported yet
  41. ***** ^ not supported yet
  42. 25 LOOP
  43. 26 IF p>l THEN p := l END ;
  44. 27 IO.WrStr(S) ;
  45. ***** ^ not supported yet
  46. ***** ^ not supported yet
  47. ***** ^ not supported yet
  48. 28 IF Str.Length(S) < l THEN
  49. ***** ^ not supported yet
  50. ***** ^ not supported yet
  51. ***** ^ not supported yet
  52. 29 IO.WrChar(' ');
  53. ***** ^ not supported yet
  54. ***** ^ not supported yet
  55. ***** ^ not supported yet
  56. 30 END; (* if *)
  57. 31 Window.GotoXY(x+p,y) ;
  58. ***** ^ not supported yet
  59. ***** ^ not supported yet
  60. ***** ^ not supported yet
  61. 32 k := IO.RdCharDirect() ;
  62. ***** ^ not supported yet
  63. ***** ^ not supported yet
  64. ***** ^ not supported yet
  65. 33 IF k = 0C THEN (* Extended character *)
  66. 34 CASE IO.RdCharDirect() OF
  67. ***** ^ not supported yet
  68. ***** ^ not supported yet
  69. ***** ^ not supported yet
  70. 35 | CHR(75) : k := CHR(19) ; (* LeftArr -> ^S *)
  71. ***** ^ undeclared identifier
  72. ***** ^ not supported yet
  73. ***** ^ undeclared identifier
  74. ***** ^ not supported yet
  75. 36 | CHR(77) : k := CHR(4) ; (* RightArr -> ^D *)
  76. ***** ^ undeclared identifier
  77. ***** ^ not supported yet
  78. ***** ^ undeclared identifier
  79. ***** ^ not supported yet
  80. 37 | CHR(71) : k := CHR(1) ; (* Home -> ^A *)
  81. ***** ^ undeclared identifier
  82. ***** ^ not supported yet
  83. ***** ^ undeclared identifier
  84. ***** ^ not supported yet
  85. 38 | CHR(79) : k := CHR(6) ; (* End -> ^F *)
  86. ***** ^ undeclared identifier
  87. ***** ^ not supported yet
  88. ***** ^ undeclared identifier
  89. ***** ^ not supported yet
  90. 39 | CHR(83) : k := CHR(7) ; (* Del -> ^G *)
  91. ***** ^ undeclared identifier
  92. ***** ^ not supported yet
  93. ***** ^ undeclared identifier
  94. ***** ^ not supported yet
  95. 40 | CHR(82) : k := CHR(22) ; (* Ins -> ^V *)
  96. ***** ^ undeclared identifier
  97. ***** ^ not supported yet
  98. ***** ^ undeclared identifier
  99. ***** ^ not supported yet
  100. 41 END ;
  101. 42 END ;
  102. 43 CASE k OF
  103. 44 | ' '..'~' : IF ins THEN Str.Insert(S,k,p) ;
  104. ***** ^ not supported yet
  105. ***** ^ not supported yet
  106. ***** ^ not supported yet
  107. ***** ^ not supported yet
  108. 45 ELSIF p=l THEN Str.Append(S,k) ;
  109. ***** ^ not supported yet
  110. ***** ^ not supported yet
  111. ***** ^ not supported yet
  112. ***** ^ not supported yet
  113. 46 ELSE S[p] := k ;
  114. ***** ^ not supported yet
  115. ***** ^ not supported yet
  116. 47 END ;
  117. 48 INC(p) ;
  118. ***** ^ undeclared identifier
  119. ***** ^ not supported yet
  120. 49 | CHR(1) : p := 0 ; (* Home *)
  121. ***** ^ undeclared identifier
  122. ***** ^ not supported yet
  123. 50 | CHR(6) : p := Str.Length(S) ; (* End *)
  124. ***** ^ undeclared identifier
  125. ***** ^ not supported yet
  126. ***** ^ not supported yet
  127. ***** ^ not supported yet
  128. ***** ^ not supported yet
  129. 51 | CHR(19) : IF p>0 THEN DEC(p) END ; (* Left *)
  130. ***** ^ undeclared identifier
  131. ***** ^ not supported yet
  132. ***** ^ undeclared identifier
  133. ***** ^ not supported yet
  134. 52 | CHR(4) : IF p<l THEN INC(p) END ; (* Right *)
  135. ***** ^ undeclared identifier
  136. ***** ^ not supported yet
  137. ***** ^ undeclared identifier
  138. ***** ^ not supported yet
  139. 53 | CHR(7) : IF p<l THEN (* Del *)
  140. ***** ^ undeclared identifier
  141. ***** ^ not supported yet
  142. 54 Str.Delete(S,p,1) ;
  143. ***** ^ not supported yet
  144. ***** ^ not supported yet
  145. ***** ^ not supported yet
  146. ***** ^ not supported yet
  147. 55 END ;
  148. 56 | CHR(8) : IF p>0 THEN (* BackSpace *)
  149. ***** ^ undeclared identifier
  150. ***** ^ not supported yet
  151. 57 DEC(p) ; Str.Delete(S,p,1) ;
  152. ***** ^ undeclared identifier
  153. ***** ^ not supported yet
  154. ***** ^ not supported yet
  155. ***** ^ not supported yet
  156. ***** ^ not supported yet
  157. ***** ^ not supported yet
  158. 58 END ;
  159. 59 | CHR(22) : ins := NOT ins ; (* Toggle Ins/Ovr *)
  160. ***** ^ undeclared identifier
  161. ***** ^ not supported yet
  162. 60 | CHR(27) : S[0] := 0C;
  163. ***** ^ undeclared identifier
  164. ***** ^ not supported yet
  165. ***** ^ not supported yet
  166. ***** ^ not supported yet
  167. 61 Window.GotoXY(x,y);
  168. ***** ^ not supported yet
  169. ***** ^ not supported yet
  170. ***** ^ not supported yet
  171. 62 FOR i := 1 TO l DO
  172. 63 IO.WrChar(' ');
  173. ***** ^ not supported yet
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. 64 END;
  177. 65 p := 0;
  178. 66 | CHR(13) : RETURN ; (* Enter *)
  179. ***** ^ undeclared identifier
  180. ***** ^ not supported yet
  181. 67 END ;
  182. 68 Window.GotoXY(x,y) ;
  183. ***** ^ not supported yet
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. 69 END ;
  187. 70 END InputStr ;
  188. ***** ^ not supported yet
  189. 71
  190. 72
  191. 73 END Misc.
  192. ***** ^ not supported yet
  193. 118 errors