home *** CD-ROM | disk | FTP | other *** search
- program example_using_TriDoor;
-
- {**************************************************************************
-
- TEST.PAS/.EXE
-
- This odd little program uses the unregistered TriDoor unit and the
- QuickBBS support file DORINFO1.DEF (included in this package) to
- demonstrate some of the TriDoor features and commands.
-
- It also shows how very simple it is to write a basic on-line door
- using this unit- it took me about 30 minutes at 2:00 in the morning
- to write this program.
-
- This program is compilable and will run on-line as well as locally!
-
- **************************************************************************}
-
- uses
- dos, { these units are not necessary for }
- crt, { all programs }
-
- tridr55u; { change u to p or c for registered }
- { private or commercial copies }
-
- {* * * * * * * * * *}
-
- procedure example_showfile;
-
- var
- filename : string;
- waitkey : char;
-
- begin
-
- clearcom;
- print('This is a demonstration of the showfile() procedure. It will also||');
- print('use the getinput() function, the aysure() function and the CAPS||');
- print('boolean variable that forces capitalized input at the getinput()||');
- print('function.||');
- print('------------------------------------------------------------------||||||');
-
- repeat
-
- print('||||Enter a filename to be displayed : ');
- caps := true;
- filename := getinput(40);
- print('||');
-
- until (showfile(filename,21)) or (not aysure('File not found. Try again',No))
- or (offline) or (quit);
-
- print('||Press any key to continue : ');
- waitkey := getkey;
-
- end;
-
- {* * * * * * * * * *}
-
- procedure example_getinput;
-
- var
- workstrg1,
- workstrg2 : string;
- waitkey : char;
-
- begin
-
- clearcom;
- print('This is a series of examples using the getinput() function. It will||');
- print('demonstrate all of it''s features and abilities.||');
- print('-------------------------------------------------------------------||||||');
-
- print('Here is an example of limited character input : ||');
- print('Enter your name (10 chars max ) : ');
- workstrg1 := getinput(10);
- print('||||');
-
- print('Here is an example of coded input : ||');
- print('Enter a password to use on this system (8 chars max) : ');
- code := true;
- workstrg2 := getinput(8);
- print('||You entered the password '+ucase(workstrg2)+'.||||||');
-
- print('Here is an example of capitalized input : ||');
- print('Enter a file name to download : ');
- caps := true;
- workstrg2 := getinput(12);
- print('||||||');
-
- print('Press any key to continue : ');
- waitkey := getkey;
-
- end;
-
- {* * * * * * * * * *}
-
- procedure example_ansi;
-
- var
- ch : char;
-
- begin
-
- clearcom;
-
- if stats.ansi then
- begin
-
- ancolor(0,0,CYAN,BLACK);
- print('This ');
- ancolor(0,0,RED,BLACK);
- print('is ');
- ancolor(0,INTENSITY,BLUE,BLACK);
- print('an ');
- ancolor(0,INTENSITY,CYAN,BLACK);
- print('example ');
- ancolor(0,INTENSITY,MAGENTA,BLACK);
- print('of ');
- ancolor(0,0,GREEN,BLACK);
- print('color');
- ancolor(BLINK,INTENSITY,YELLOW,BLACK);
- print('!');
-
- ancolor(0,0,CYAN,BLACK);
- angotoxy(10,10);
- print('Color and ANSI screen controls');
- angotoxy(12,12);
- ancolor(BLINK,INTENSITY,WHITE,BLUE);
- print('CAN BE FUN!!!');
- ancolor(0,0,WHITE,BLACK);
-
- angotoxy(1,17);
-
- end
- else
- begin
- print('This portion of the program uses ANSI support and it has detected||');
- print('that you do not use ANSI screen commands.||||');
- end;
-
- print('Press any key to continue : ');
- ch := getkey;
-
- end;
-
- {* * * * * * * * * *}
-
- procedure wrapup;
-
- var
- ch : char;
-
- begin
- clearcom;
-
- print('||||||');
- print(' Well, that is the end of our VERY basic demonstration.||||');
- print(' The problem with this sort of thing is that there are SO||');
- print(' MANY different types of things that you can created with||');
- print(' TriDoor that in order to cover them all I would be sitting||');
- print(' here for thirty years or so.||||');
- print(' The best way to get your hands on some useful examples is||');
- print(' to call our BBS. We will be making and putting up such things||');
- print(' in our free time.||||');
- print(' Once again, the number for Triumph BBS is (508)263-4247.||||||');
-
- print('Press any key to return to DOS : ');
- ch := getkey;
-
- end;
-
- {* * * * * * * * * *}
-
- begin
- if readquick then { readquick for QuickBBS or make your }
- begin { own support procedure - see docs }
-
- setup;
-
- example_getinput;
- example_showfile;
- example_ansi;
-
- wrapup;
-
- clearcom;
- print('Bye from the TriDoor example program!');
-
- end
- else
- begin
- clrscr;
- writeln;
- writeln('File DORINFO1.DEF not found!',chr(7));
- end;
-
- end.