home *** CD-ROM | disk | FTP | other *** search
- program TestInField; { You won't be able to compile this, since you }
- { need QWIK.TPU, with the additional routines }
- Uses Crt, qwik, Infield; { of QBorder and WindFrame. However, you may }
- { get QWIK.TPU and either delete or replace }
- var TestStrg : Strng80; { those routines with your own. }
- Choice : char; { This progam is just intended for reference. }
-
- procedure OutputStuff; { Outputs all relevant variables. }
- var Temp : Strng80;
- begin
- TextAttr := (Magenta shl 4) + White;
- WindFrame( 2, 45, 8, 70, TextAttr, TextAttr, 7);
- QWrite( 3, 46, TextAttr, '<<<<<<<<<<<<<<<<<<<<<<<<');
- TextAttr := (Blue shl 4) + White;
- QWrite( 3, 46, TextAttr, TestStrg);
-
- TextAttr := (Magenta shl 4) + White;
- QWrite( 5, 46, TextAttr, 'IExit:');
-
- TextAttr := (Blue shl 4) + White;
- if IExit = true then QWrite( 5, 53, TextAttr, 'TRUE ') else
- QWrite( 5, 53, TextAttr, 'FALSE');
-
- TextAttr := (Magenta shl 4) + White;
- QWrite( 7, 46, TextAttr, 'FKey:');
-
- TextAttr := (Blue shl 4) + White;
- Str(Fkey, Temp);
- QWrite( 7, 52, TextAttr, Temp);
- end;
-
-
- begin
- QBorder(1); { This routine was written by myself and was added to }
- { the Qwik unit. }
- CursorOn; { I must restore the cur- }
- CheckBreak := False; { sor and border at exit. }
- TextAttr := (Blue shl 4) + White; { Set the main text color }
- Qfill ( 1, 1, 25, 80, TextAttr, ' '); { Clear the screen }
- QWrite ( 2, 1, TextAttr, 'Standard Input: '); { Normal input, nothing }
- TestStrg := 'This is passed text'; { special. Pass some }
- Data_In( 2, 18, 20, TestStrg, TextAttr); { test text. (say THAT }
- OutputStuff; { ten times fast!) }
-
- Qwrite ( 4, 1, TextAttr, 'Keyclick on: '); { Demo of keyclick. You }
- TextAttr := (Red shl 4) + White; { may note that I never }
- Kclk := true; { demonstrated the sound }
- TestStrg := 'This is passed text'; { off mode. }
- TAttr := (Blue shl 4) + White; { Demos using an empty }
- UseTemp := True; StCh := '>'; EnCh := 'N'; { template to change the }
- Template := rep(20, 32); { start & end char color. }
- Data_In( 4, 18, 20, TestStrg, TextAttr); { Run the 'Biggie.' }
- Kclk := false; UseTemp := False; { Turn off the features. }
- StCh := '['; EnCh := ']'; { Restore start & end chr }
- OutputStuff; { Output everything. }
-
- TextAttr := (Blue shl 4) + White; { Main screen color. }
- QWrite ( 6, 1, TextAttr, 'Strip on Exit: '); { Demo of stripping the }
- SOE := true; CapsOnly := true; { string of spaces. I }
- TextAttr := (Cyan shl 4) + White; { didn't implement a just }
- TestStrg := 'This is passed text'; { leading or trailing }
- Data_In( 6, 18, 20, TestStrg, TextAttr); { spaces strip, because }
- SOE := false; CapsOnly := false; { I'm too lazy. Also }
- OutputStuff; { demos the capital }
- { letters only mode. }
- TextAttr := (Blue shl 4) + White; { }
- QWrite ( 8, 1, TextAttr, 'Clear on Entry: '); { Demos the COE mode. }
- COE := true; { This feature clears the }
- TextAttr := (Magenta shl 4) + White; { string automatically }
- TestStrg := 'This is passed text'; { when you call data_in. }
- Data_In( 8, 18, 20, TestStrg, TextAttr); { I use this feature }
- COE := false; { quite a bit. }
- OutputStuff; { (Is the shadow REAL?) }
-
- TextAttr := (Blue shl 4) + White; { Just press return on }
- QWrite (10, 1, TextAttr, 'ESC on Blank: '); { a blank line here, and }
- COE := true; EOB := true; { notice that IExit will }
- TextAttr := (Green shl 4) + White; { be set to TRUE. I use }
- TestStrg := ''; { this quite a bit, also. }
- StCh := '{'; EnCh := '}'; { I also demonstrate }
- Data_In(10, 18, 20, TestStrg, TextAttr); { different starting and }
- COE := false; EOB := false; { ending characters here. }
- OutputStuff; { Show yer stuff. . . }
-
- TextAttr := (Blue shl 4) + White; { Reset screen attribute. }
- QWrite (12, 1, TextAttr, 'Exit on Arrow: '); { Press any arrow key }
- EOA := true; { here and note that }
- TextAttr := (Red shl 4) + White; { IExit = TRUE and that }
- StCh := 'N'; EnCh := 'N'; { Fkey is set to the }
- TestStrg := 'This is passed text'; { proper key #. Also }
- Data_In(12, 18, 20, TestStrg, TextAttr); { demos no leading or }
- EOA := false; StCh := '['; EnCh := ']'; { ending char. }
- OutputStuff; { }
-
- TextAttr := (Blue shl 4) + White; { First demo of template }
- QWrite (14, 1, TextAttr, 'Template 1: '); { use. Normal entry, }
- QWrite (14, 40, TextAttr, 'Standard template entry.');
- UseTemp := true; TAttr := (LightGray shl 4) + White;
- Template := ' / - + - . '; { nothing fancy. Note }
- TextAttr := (LightGray shl 4) + Black; { what happens when you }
- TestStrg := ''; { insert and delete text. }
- Data_In(14, 14, 20, TestStrg, TextAttr); { Also try any function }
- OutputStuff; { key, Ctrl, Shift or Alt }
-
- TextAttr := (Blue shl 4) + White; { Uses the Move On Key }
- QWrite (16, 1, TextAttr, 'Template 2: '); { function. Note that }
- Qwrite (16, 40, TextAttr, 'Try pressing a key in the template ("+")');
- UseTemp := true; TAttr := (Magenta shl 4) + LightGray;
- Template := ' / - + - . '; MOK := true;
- TextAttr := (Magenta shl 4) + White; { there are two dashes in }
- TestStrg := ''; { the template, but it }
- Data_In(16, 14, 20, TestStrg, TextAttr); { always goes to the one }
- MOK := false; { immediately to the }
- OutputStuff; { right of the cursor. }
-
- TextAttr := (Blue shl 4) + White; { This feature returns }
- QWrite (18, 1, TextAttr, 'Template 3: '); { the template in the }
- QWrite (18, 40, TextAttr, 'Keeps the template in the string');
- UseTemp := true; TAttr := (Brown shl 4) + LightCyan;
- KeepTemp := true; { string. Useful if the }
- Template := ' / - + - . '; { following code needs }
- TextAttr := (Brown shl 4) + White; { a reference point in }
- TestStrg := ''; { the string. For ex., }
- Data_In(18, 14, 20, TestStrg, TextAttr); { you could leave the '/' }
- KeepTemp := false; { in a date template to }
- OutputStuff; { help break it down. }
-
- TextAttr := (Blue shl 4) + White; { Does pretty much }
- QWrite (20, 1, TextAttr, 'Template 4: '); { everything. Note that }
- QWrite (20, 40, TextAttr, 'Both keeps the template & moves on a key.');
- UseTemp := true; TAttr := (Black shl 4) + LightGray;
- KeepTemp := true; MOK := true; { this passes text, which }
- Template := ' / - + - . '; { is, of course, put into }
- TextAttr := (Black shl 4) + White; { the template auto- }
- TestStrg := '001AB1024RLL3352XT'; { matically. }
- Data_In(20, 14, 20, TestStrg, TextAttr); { Call the function again }
- KeepTemp := false; MOK := false; { Set switches back to }
- OutputStuff; { normal. }
-
- TextAttr := (Blue shl 4) + White; { Well, that's it. I }
- QWrite(22, 1, TextAttr, 'Press any key to exit . . .');
- CursorOn; { could add more, but I }
- GotoRC(22, 29); { like smaller units. I }
- Choice := Readkey; { left all of the data }
- TextAttr := (Black shl 4) + LightGray; { handling to the }
- QBorder(0); { programmer, which I }
- ClrScr; { feel is an advantage. Besides, I could use a break . . . }
- end.
-
-