home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-386-Vol-2of3.iso
/
c
/
ctkit11.zip
/
CTDEMO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-02-25
|
2KB
|
56 lines
Program CrunchtermDemo;
{ This program demonstrates some of the basic procedures of a Crunchterm-
supporting program. Just compile it and install it on your BBS just like
you would Crunch League Football. Or just run it locally. }
uses
BBSEndU;
var
maxgd, maxgm: word;
ch: char;
begin
Initialize;
cton := testresp; { always do this, don't ask me why... }
{cton HAS to be true in order for CT commands to do anything}
if cton then { check whether Crunchterm is present on the remote end}
begin { automatically true if you're running local only. }
GrInfo (maxgd,maxgm); { find highest available video mode }
if maxgd = 0 then begin {i.e., no graphics-you can use this instead of ANSI}
ClearScr;
SetCol(15,1);
DoText(30,12,'Sorry, no graphics available.');
SetCol(7,0);
DoText(1,20,'Bye!');
SendLine('');
end else begin
LoadPic(1,2496,166,'MAIN.CT');
{ note- LoadPic has no error checking. If the remote computer doesn't
have the requested file, it'll abort. If the local computer doesn't
have it, it doesn't do anything. You might want to add more
intelligent error checking if you're at all less lazy than me. }
InitGr(1,4); {CGA mode.. could be EGA (i.e., gd=3)}
SendLine('Hi, '+Pname+'!'); {note that this works in text and graphics modes}
DoText(120,90,'This is the Crunchterm Programming Kit Demo!');
DoRect (100,83,492,105,1); {Wow! Nifty graphics stuff!...}
FillStyle(5,1);
FillBar(170,105,422,110);
FillBar(170,78,422,83);
PutPic(1,30,130,0);
DoCircle (55,140,50,1);
DoText(0,180,'Brought to you by Crunchware! ');
end;
SendLine('Press a key.'); {primitive pause}
ch := waitforchar;
InitGr(0,0); { this won't do anything if you're not in graphics mode }
{ except send 5 extraneous bytes over the modem. big deal. }
SendLine('Goodbye to CT!');
LeaveCt; {this only effects a remote computer}
SendLine('Wow! That was a big deal, wasn''t it?');
end;
ExitProg; { don't forget to do this at the end of every CT program! }
end.