| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- Listing:
- 1 IMPLEMENTATION MODULE Misc;
- 2 (*
- 3 Copyright (C) 1988,1989 Jensen & Partners International
- 4 *)
- 5
- 6 IMPORT Str, IO, Window;
- 7
- 8 PROCEDURE InputStr ( VAR S : ARRAY OF CHAR; MaxLen : CARDINAL ) ;
- ***** ^ not supported yet
- 9 (* Inputs a string, using Window module, allowing normal line editing *)
- 10 VAR
- 11 ins : BOOLEAN ;
- 12 k : CHAR ;
- 13 x,y,p,l,i : CARDINAL ;
- 14 BEGIN
- 15 x := Window.WhereX() ; y := Window.WhereY() ;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 16 p := 0 ;
- 17 ins := TRUE ; (* Insert mode *)
- 18 IF (MaxLen = 0) THEN
- 19 l := Str.Length(S) ;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 20 ELSE
- 21 l := MaxLen;
- 22 END;
- 23 IO.WrCharRep(' ',l);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 24 Window.GotoXY(x,y);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 25 LOOP
- 26 IF p>l THEN p := l END ;
- 27 IO.WrStr(S) ;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 28 IF Str.Length(S) < l THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 29 IO.WrChar(' ');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 30 END; (* if *)
- 31 Window.GotoXY(x+p,y) ;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 32 k := IO.RdCharDirect() ;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 33 IF k = 0C THEN (* Extended character *)
- 34 CASE IO.RdCharDirect() OF
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 35 | CHR(75) : k := CHR(19) ; (* LeftArr -> ^S *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 36 | CHR(77) : k := CHR(4) ; (* RightArr -> ^D *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 37 | CHR(71) : k := CHR(1) ; (* Home -> ^A *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 38 | CHR(79) : k := CHR(6) ; (* End -> ^F *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 39 | CHR(83) : k := CHR(7) ; (* Del -> ^G *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 40 | CHR(82) : k := CHR(22) ; (* Ins -> ^V *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 41 END ;
- 42 END ;
- 43 CASE k OF
- 44 | ' '..'~' : IF ins THEN Str.Insert(S,k,p) ;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 45 ELSIF p=l THEN Str.Append(S,k) ;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 46 ELSE S[p] := k ;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 47 END ;
- 48 INC(p) ;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 49 | CHR(1) : p := 0 ; (* Home *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 50 | CHR(6) : p := Str.Length(S) ; (* End *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 51 | CHR(19) : IF p>0 THEN DEC(p) END ; (* Left *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 52 | CHR(4) : IF p<l THEN INC(p) END ; (* Right *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 53 | CHR(7) : IF p<l THEN (* Del *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 54 Str.Delete(S,p,1) ;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 55 END ;
- 56 | CHR(8) : IF p>0 THEN (* BackSpace *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 57 DEC(p) ; Str.Delete(S,p,1) ;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 58 END ;
- 59 | CHR(22) : ins := NOT ins ; (* Toggle Ins/Ovr *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 60 | CHR(27) : S[0] := 0C;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 61 Window.GotoXY(x,y);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 62 FOR i := 1 TO l DO
- 63 IO.WrChar(' ');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 64 END;
- 65 p := 0;
- 66 | CHR(13) : RETURN ; (* Enter *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 67 END ;
- 68 Window.GotoXY(x,y) ;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 69 END ;
- 70 END InputStr ;
- ***** ^ not supported yet
- 71
- 72
- 73 END Misc.
- ***** ^ not supported yet
- 118 errors
|