-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlspkeybd.pas
68 lines (51 loc) · 1.53 KB
/
lspkeybd.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
(*----------------------------------------------------------------------------*)
(* Author: Joachim Pimiskern, 1994-2004 *)
(*----------------------------------------------------------------------------*)
unit lspkeybd;
{$O+,F+,E+,N+}
interface
uses
sysutils,
lspglobl, linestrm;
type
tTastaturInputObjekt = object(tLS_obj)
constructor Init;
destructor Done; virtual;
procedure fOpen(filename: ShortString); virtual;
procedure fClose; virtual;
function getLine: ShortString; virtual;
end;
pTastaturInputObjekt = ^tTastaturInputObjekt;
var
Klammerebene: integer;
implementation
uses
lsppredi, lsperr, lspbasic, strng,
dialogs;
(*--- Eingabe per Tastatur ermoeglichen ------------------------------------*)
constructor tTastaturInputObjekt.Init;
begin
EndOfFile := false;
Klammerebene := 0;
end;
destructor tTastaturInputObjekt.Done;
begin
end;
procedure tTastaturInputObjekt.fOpen(filename: ShortString);
begin
end;
procedure tTastaturInputObjekt.fClose;
begin
end;
function tTastaturInputObjekt.getLine: ShortString;
var s: ShortString;
begin
if (Klammerebene <> 0) then
write(IntToStr(Klammerebene));
write('> ');
readln(s);
inc(Klammerebene,CharCount('(',s)-CharCount(')',s));
getline := s + ' ' + chr(10);
end;
end.