home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pcmagazi
/
1990
/
04
/
usehelp.pas
< prev
Wrap
Pascal/Delphi Source File
|
1990-01-22
|
1KB
|
53 lines
USEHELP.PAS
PROGRAM UseHelp;
(* QuickPascal program *)
USES Crt,
help2;
VAR
H1 : HelpSet;
N : word;
Avail : LongInt;
FUNCTION RandMessage(W:Word):string;
VAR
Temp : String;
N : Byte;
BEGIN
Temp := '';
FOR N := 1 to Random(6)+2 DO
CASE Random(5) OF
0: Temp := Temp + ' HELP';
1: Temp := Temp + ' help';
2: Temp := Temp + ' assistance';
3: Temp := Temp + ' m''aidez';
4: Temp := Temp + ' socorro';
END;
RandMessage := Temp + '!';
END;
BEGIN
Randomize;
ClrScr;
WriteLn('Demonstrating "HelpSet" object');
Avail := MaxAvail;
New(H1);
H1.InitHelp(500);
N := 0;
REPEAT
Inc(N);
UNTIL NOT H1.AddMessage(RandMessage(N));
Avail := Avail - MaxAvail;
FOR N := 1 to 10 DO
BEGIN
WriteLn('#',2*N:3,' ',H1.GetMessage(2*N));
WriteLn('#',501-2*N:3,' ',H1.GetMessage(501-2*N));
END;
H1.DoneWithHelp;
Dispose(H1);
WriteLn('The object used ',Avail,' bytes.');
END.