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 >
Pascal/Delphi Source File  |  1992-02-25  |  2KB  |  56 lines

  1. Program CrunchtermDemo;
  2.  
  3. { This program demonstrates some of the basic procedures of a Crunchterm-
  4.   supporting program.  Just compile it and install it on your BBS just like
  5.   you would Crunch League Football.  Or just run it locally.               }
  6.  
  7. uses
  8.    BBSEndU;
  9.  
  10. var
  11.    maxgd, maxgm: word;
  12.    ch: char;
  13.  
  14. begin
  15. Initialize;
  16. cton := testresp; { always do this, don't ask me why... }
  17.                   {cton HAS to be true in order for CT commands to do anything}
  18. if cton then  { check whether Crunchterm is present on the remote end}
  19.    begin          { automatically true if you're running local only. }
  20.    GrInfo (maxgd,maxgm);  { find highest available video mode }
  21.    if maxgd = 0 then begin {i.e., no graphics-you can use this instead of ANSI}
  22.       ClearScr;
  23.       SetCol(15,1);
  24.       DoText(30,12,'Sorry, no graphics available.');
  25.       SetCol(7,0);
  26.       DoText(1,20,'Bye!');
  27.       SendLine('');
  28.       end else begin
  29.       LoadPic(1,2496,166,'MAIN.CT');
  30.        { note- LoadPic has no error checking.  If the remote computer doesn't
  31.          have the requested file, it'll abort.  If the local computer doesn't
  32.          have it, it doesn't do anything.  You might want to add more
  33.          intelligent error checking if you're at all less lazy than me.     }
  34.       InitGr(1,4);   {CGA mode.. could be EGA (i.e., gd=3)}
  35.       SendLine('Hi, '+Pname+'!'); {note that this works in text and graphics modes}
  36.       DoText(120,90,'This is the Crunchterm Programming Kit Demo!');
  37.       DoRect (100,83,492,105,1); {Wow!  Nifty graphics stuff!...}
  38.       FillStyle(5,1);
  39.       FillBar(170,105,422,110);
  40.       FillBar(170,78,422,83);
  41.       PutPic(1,30,130,0);
  42.       DoCircle (55,140,50,1);
  43.       DoText(0,180,'Brought to you by Crunchware!  ');
  44.       end;
  45.    SendLine('Press a key.');  {primitive pause}
  46.    ch := waitforchar;
  47.    InitGr(0,0); { this won't do anything if you're not in graphics mode     }
  48.                 { except send 5 extraneous bytes over the modem.  big deal. }
  49.    SendLine('Goodbye to CT!');
  50.    LeaveCt; {this only effects a remote computer}
  51.    SendLine('Wow!  That was a big deal, wasn''t it?');
  52.    end;
  53. ExitProg;  { don't forget to do this at the end of every CT program! }
  54. end.
  55.  
  56.