home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
turbopas
/
tp4menu1.arc
/
PPS_USR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-11-07
|
3KB
|
123 lines
{
Copyright (c) 1988 BittWare Computing, ALL RIGHTS RESERVED
}
unit pps_usr;
{$v-}
interface
uses
pps_glob,
menuvars,
menucode,
pps_init,
beepkey4,
crt,
inp_var;
procedure user1;
procedure user2;
procedure user3;
procedure user4;
implementation
procedure user1;
var
ta :byte;
ts :string[30];
begin
{open io window and write executing user procedure 1...}
IoList^.title := 'User Procedure #1...';
OpenIoWindow(IOList);
ta := TextAttr;
writeln('By the way, there is an "Auto Mode" variable in the data');
writeln('entry menu which determines if "confirm" pops up');
writeln('To Toggle: Go to Data-Entry Menu, select Auto and hit <Enter>');
writeln;
writeln('Your programs can use the global variables set in other menus...');
writeln;
write(' The current file selected = ');
TextColor(VarInpFg);
TextBackground(VarInpBg);
if flname <> '' then
writeln(flname)
else writeln('No File Currently Selected');
TextAttr := ta;
write(' RealVar #1 = ');
TextColor(VarInpFg);
TextBackground(VarInpBg);
writeln(realvar1);
TextAttr := ta;
write('and when formatted for output = ');
TextColor(VarInpFg);
TextBackground(VarInpBg);
ts := Real2Str(RealVar1,10,2);
writeln(ts);
TextAttr := ta;
writeln;
writeln('Change Values in Data Entry, and come Back, Please!');
TextColor(VarInpFg + blink);
TextBackground(VarInpBg);
writeln;
write('Hit <Esc> to Continue');
TextAttr := ta;
InEsc;
CloseIoWindow(IOList);
end;
procedure user2;
var
NewString :string[5];
OldString :string[5];
w :byte;
rc :byte;
ta :byte;
begin
{open io window and write executing user procedure 1...}
IoList^.title := 'User Procedure #2...';
OpenIoWindow(IOList);
writeln('Your Programs can also enter vars from here');
writeln;
writeln('My procedure integer WAS = ',user2int);
write('My procedure needs an integer: ');
{Data Entry from menus is only one statement...
this is just an example of how it COULD be done}
ta := TextAttr;
w := 5;
str(User2Int,OldString);
UnHideCurs;
TextColor(VarInpFg);
TextBackground(VarInpBg);
InputString(OldString,w,NewString,rc);
if rc = InputOk then begin
ConvertString(NewString,w,IntCode,rc,@User2Int);
if rc <> InputOk then begin
ErrorNum := InvalidInput;
ErrorMessage;
end;
end
else writeln('What? No input?');
HideCurs;
TextAttr := ta;
writeln;
writeln('My procedure integer NOW = ',user2int);
writeln;
writeln('Hit <Esc> to Continue');
InEsc;
CloseIoWindow(IOList);
end;
procedure user3;
begin
good_beep;
end;
procedure user4;
begin
bad_beep;
end;
end.