home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
153.img
/
TELES.ZIP
/
LOCAL.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-06-22
|
947b
|
40 lines
procedure local_input1(var i:astr; ml:integer; tf:boolean);
var cp:integer;
cc:char;
r:real;
begin
cp:=1;
repeat
cc:=readkey;
if not tf then cc:=upcase(cc);
if (cc>=' ') and (cc<chr(127)) then
if cp<=ml then begin
i[cp]:=cc;
cp:=cp+1;
write(cc);
end else else case ord(cc) of
8:if cp>1 then begin
cc:=chr(8);
write(cc);write(' '); write(cc);
cp:=cp-1;
end;
21,24:while cp<>1 do begin
cp:=cp-1;
write(#8);write(' ');write(#8);
end;
end;
until (cc=#13) or (cc=#14);
i[0]:=chr(cp-1);
writeln;
end;
procedure local_input(var i:astr; ml:integer); (* Input uppercase only *)
begin
local_input1(i,ml,false);
end;
procedure local_inputl(var i:astr; ml:integer); (* Input lower & upper case *)
begin
local_input1(i,ml,true);
end;