home *** CD-ROM | disk | FTP | other *** search
- Program Example;
- {$V-} {Neccessary to use these units}
- uses dos,crt,general,inputs;
-
- var
- date1 : String[8];
- FirstName : String[15];
- LastName: String[15];
- Amountpaid : String[7];
- LatePayment : boolean;
- outcode : integer;
-
- procedure setitup;
-
- {This procedure sets up the input array}
-
- begin
- color(15,1,false,false,false);
- with input[1] do
- begin
- x := 35;
- y := 8;
- len := 15;
- up := 1;
- down := 2;
- typeof := 'A';
- Decimal := 0;
- filler := '@'
- end;
- with input[2] do
- begin
- x := 55;
- y := 8;
- len := 15;
- up := 1;
- down := 3;
- typeof := 'A';
- Decimal := 0;
- filler := '@'
- end;
- with input[3] do
- begin
- x := 35;
- y := 10;
- len := 8;
- up := 2;
- down := 4;
- typeof := 'D';
- Decimal := 0;
- filler := '@'
- end;
- with input[4] do
- begin
- x := 35;
- y := 12;
- len := 7;
- up := 3;
- down := 5;
- typeof := 'N';
- Decimal := 2;
- filler := '@'
- end;
- with input[5] do
- begin
- x := 35;
- y := 14;
- len := 1;
- up := 4;
- down := 0;
- typeof := 'L';
- Decimal := 0;
- filler := '@'
- end;
- end;
-
- Procedure setupscreen;
- begin
- clrscr;
- cursoron(false);
- center(2,'INPUT SCREEN TEST');
- center(3,'* Hit ESC to Cancel Screen Input *');
- gotoxy(2,8);
- Write('Enter your name [Last, First]:');
- gotoxy(50,8); write(',');
- gotoxy(2,10);
- write('Enter Date of Payment:');
- gotoxy(2,12);
- write('Enter Amount of Payment');
- gotoxy(2,14);
- write('Was this payment Late [Y,N]:');
- gotoxy(1,20);
- writeln('Try entering bad numbers or dates. Move around with the');
- writeln('arrow keys, back space etc.');
- end;
-
- Procedure Dumpdata;
- begin
- color(15,1,false,false,false);
- clrscr;
- trim(Firstname);
- writeln('Your Name: ',Firstname,' ',lastname);
- writeln;
- writeln('Date of payment: ',Date1);
- writeln;
- writeln('Amount paid: $',amountpaid);
- writeln;
- if latepayment then writeln('This was a latepayment!')
- else writeln('This payment was on Time');
- end;
-
-
- begin
- setitup;
- setupscreen;
- cursoron(true);
- If getinput(1,0,15) then
- begin
- Lastname := input[1].filler;
- Firstname := input[2].filler;
- Date1 := input[3].filler;
- Amountpaid := input[4].filler;
- If input[5].filler = 'Y' then
- latepayment := True
- else
- Latepayment := False;
- clrscr;
- DumpData;
- Delay(9000);
- setupscreen;
- cursoron(true);
- If getinput(1,0,15) then
- dumpdata
- else
- begin
- clrscr;
- write('Exit From Screen');
- end
- end
- else
- begin
- clrscr;
- Beep;
- Write('You Canceled the Input Screen');
- end;
- delay(4000);
- end.