TERMINAL.LST 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. Listing:
  2. 1 (* Release 3.10 *)
  3. 2 (*-------------------------------------------------------------------------*
  4. 3 * *
  5. 4 * TERMINAL.MOD - Terminal i/o (core library) *
  6. 5 * *
  7. 6 * COPYRIGHT (C) 1987..1992 Clarion Software Corporation. *
  8. 7 * All Rights Reserved *
  9. 8 * *
  10. 9 *--------------------------------------------------------------------------*)
  11. 10
  12. 11 (*$V-*)
  13. 12 IMPLEMENTATION MODULE Terminal ;
  14. 13
  15. 14 (* Core library interface *)
  16. 15
  17. 16 IMPORT Str,IO,ASCII ;
  18. 17
  19. 18 VAR
  20. 19 CharBuffered : BOOLEAN ;
  21. 20 SaveChar : CHAR ;
  22. 21
  23. 22 PROCEDURE Read ( VAR v : CHAR ) ;
  24. 23 BEGIN
  25. 24 IF CharBuffered THEN
  26. 25 v := SaveChar ;
  27. 26 CharBuffered := FALSE ;
  28. 27 ELSE
  29. 28 SaveChar := IO.RdKey() ;
  30. ***** ^ not supported yet
  31. ***** ^ not supported yet
  32. ***** ^ not supported yet
  33. 29 v := SaveChar ;
  34. 30 END ;
  35. 31 END Read ;
  36. ***** ^ not supported yet
  37. 32
  38. 33
  39. 34 PROCEDURE ReadAgain ;
  40. 35 BEGIN
  41. 36 CharBuffered := TRUE ;
  42. 37 END ReadAgain ;
  43. ***** ^ not supported yet
  44. 38
  45. 39
  46. 40 PROCEDURE ReadString ( VAR v : ARRAY OF CHAR ) ;
  47. ***** ^ not supported yet
  48. 41 VAR
  49. 42 c : CHAR ;
  50. 43 line : ARRAY[0..255] OF CHAR ;
  51. ***** ^ not supported yet
  52. ***** ^ not supported yet
  53. 44 p : CARDINAL ;
  54. 45 BEGIN
  55. 46 p := 0 ;
  56. 47 REPEAT Read(c) UNTIL c<>' ' ;
  57. ***** ^ not supported yet
  58. ***** ^ not supported yet
  59. 48 LOOP
  60. 49 IF (c=ASCII.bs)OR(c=ASCII.del) THEN
  61. ***** ^ not supported yet
  62. ***** ^ not supported yet
  63. ***** ^ not supported yet
  64. ***** ^ not supported yet
  65. 50 IF p>0 THEN
  66. 51 DEC(p) ;
  67. ***** ^ undeclared identifier
  68. ***** ^ not supported yet
  69. 52 Write(ASCII.bs);
  70. ***** ^ undeclared identifier
  71. ***** ^ not supported yet
  72. ***** ^ not supported yet
  73. 53 Write(' ');
  74. ***** ^ undeclared identifier
  75. ***** ^ not supported yet
  76. 54 Write(ASCII.bs);
  77. ***** ^ undeclared identifier
  78. ***** ^ not supported yet
  79. ***** ^ not supported yet
  80. 55 END ;
  81. 56 ELSIF (c>' ')AND(c<CHR(80H)) THEN
  82. ***** ^ undeclared identifier
  83. ***** ^ not supported yet
  84. 57 Write(c) ;
  85. ***** ^ undeclared identifier
  86. ***** ^ not supported yet
  87. 58 IF p<SIZE(line) THEN
  88. ***** ^ undeclared identifier
  89. ***** ^ not supported yet
  90. 59 line[p] := c ;
  91. ***** ^ not supported yet
  92. ***** ^ not supported yet
  93. 60 INC(p) ;
  94. ***** ^ undeclared identifier
  95. ***** ^ not supported yet
  96. 61 END ;
  97. 62 ELSE EXIT ;
  98. 63 END ;
  99. 64 Read(c) ;
  100. ***** ^ not supported yet
  101. ***** ^ not supported yet
  102. 65 END ;
  103. 66 termCH := c ;
  104. ***** ^ undeclared identifier
  105. 67 IF p<SIZE(line) THEN line[p] := CHR(0) END ;
  106. ***** ^ undeclared identifier
  107. ***** ^ not supported yet
  108. ***** ^ not supported yet
  109. ***** ^ not supported yet
  110. ***** ^ undeclared identifier
  111. ***** ^ not supported yet
  112. 68 Str.Copy(v,line) ;
  113. ***** ^ not supported yet
  114. ***** ^ not supported yet
  115. ***** ^ not supported yet
  116. ***** ^ not supported yet
  117. 69 END ReadString ;
  118. ***** ^ not supported yet
  119. 70
  120. 71
  121. 72 PROCEDURE Write ( v : CHAR ) ;
  122. 73 BEGIN
  123. 74 IO.WrChar(v) ;
  124. ***** ^ not supported yet
  125. ***** ^ not supported yet
  126. ***** ^ not supported yet
  127. 75 END Write ;
  128. ***** ^ not supported yet
  129. 76
  130. 77 PROCEDURE WriteLn ;
  131. 78 BEGIN
  132. 79 IO.WrLn ;
  133. ***** ^ not supported yet
  134. ***** ^ not supported yet
  135. 80 END WriteLn ;
  136. ***** ^ not supported yet
  137. 81
  138. 82 PROCEDURE WriteString ( s : ARRAY OF CHAR ) ;
  139. ***** ^ not supported yet
  140. 83 BEGIN
  141. 84 IO.WrStr(s) ;
  142. ***** ^ not supported yet
  143. ***** ^ not supported yet
  144. ***** ^ not supported yet
  145. 85 END WriteString ;
  146. ***** ^ not supported yet
  147. 86
  148. 87 BEGIN
  149. 88 CharBuffered := FALSE ;
  150. 89 SaveChar := CHR(0) ;
  151. ***** ^ undeclared identifier
  152. ***** ^ not supported yet
  153. 90 END Terminal.
  154. ***** ^ not supported yet
  155. 91
  156. 63 errors