home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-01-25 | 112.0 KB | 6,403 lines |
-
-
-
-
-
-
- This file contains an abridged version of the user manual. The only
- reason for not including the full manual on the disk is that it takes
- too much space and it is formatted for a typeset printer, not an ascii
- file.
-
- If you use the product, please register your copy. One of the benefits
- of full registration is a top quality bound manual.
-
- Enjoy
-
-
-
- Bob "Technojock" Ainsbury
-
- P.S. The abridged version is 97 pages long!!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- C H A P T E R
-
-
- 1
-
-
- USING THE TOOLKIT
-
-
-
- INTRODUCTION
-
- TechnoJocks Turbo Toolkit is a collection of procedures and functions
- for Turbo Pascal programmers. It will reduce the time taken to write
- applications and is designed for novice and expert programmer alike.
-
- The real purpose of the Toolkit is to provide easy-to-implement
- procedures that free the programmer from the more tedious and
- repetitive programming chores, such as windows, menus, user input,
- string formatting, directory listing etc. The programmer (or software
- engineer if you are from California!) can concentrate on the real
- purpose of the program.
-
- The Toolkit is designed specifically to operate with Turbo Pascal v4.0
- from Borland International. (Contact TechnoJock for versions that work
- with other compilers.) The full source code for all of the Toolkit is
- included so that the code may be reviewed and modified.
-
- The quickest way of gaining an appreciation of the capabilities of the
- Toolkit is to execute the program DemoTTT.exe. This program
- demonstrates most of the procedures and functions available. The demo
- itself was, of course, written with the Toolkit. If you haven't run it
- yet, run it now!
-
-
-
- DISTRIBUTION DISK
-
- Listed below are the files contained on the distribution disk:
-
- FastTTT.pas source code for screen writing unit
- FastTTT.tpu screen writing unit
- FastTTT.asm assembler source code for screen writing unit
- FastTTT.obj assembler object code for screen writing unit
-
- WinTTT.pas source code for window unit
- WinTTT.tpu window unit
- WinTTT.asm assembler source code for window unit
- WinTTT.obj assembler object code for window unit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- KeyTTT.pas source code for keyboard/mouse unit
- KeyTTT.tpu keyboard/mouse unit
-
- MenuTTT.pas source code for menu unit
- MenuTTT.tpu menu unit
-
- PullTTT.pas source code for pulldown menu unit
- PullTTT.tpu pulldown menu unit
-
- DirTTT.pas source code for directory lister unit
- DirTTT.tpu directory lister unit
-
- StrngTTT.pas source code for string unit
- StrngTTT.tpu string unit
-
- IOTTT.pas source code for screen input unit
- IOTTT.tpu screen input unit
-
- MiscTTT.pas source code for miscellaneous unit
- MiscTTT.tpu miscellaneous unit
-
- ReadTTT.pas source code for single line input unit
- ReadTTT.tpu single line input unit
-
- DemoTTT.pas source code for flagship demonstration program
- DemoTTT.exe executable demonstration program
-
- In addition to the above files, there are a number of demonstration
- files that are designed to illustrate how to use unit. Each
- demonstration filename is of the format ?????dem.pas.
-
-
-
- INSTALLING THE TOOLKIT
-
- All you need to do to install the Toolkit is copy the unit files
- (i.e.'*.TPU') from the distribution disk to the directory where the
- Turbo Pascal units (such as CRT.TPU) are stored.
-
- If you are not sure which directory the units are stored in, copy them
- into the directory where you execute Turbo. You can check your default
- directories by executing the Turbo integrated environment (Turbo.exe)
- and selecting the DIRECTORIES pick from the OPTIONS menu - refer to
- the Turbo Pascal Owners Handbook, page 163.
-
- In addition, you could copy all the other files to your working Turbo
- directory, but this is only necessary if you wish to modify the source
- code or execute the demo programs.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- HOW THE TOOLKIT WORKS
-
- Basics -- Turbo Pascal allows libraries of constants, data types,
- variables, procedures and functions to be grouped together into UNITS.
- The Toolkit provides a variety of different units ready to use in your
- programs. Each unit (a file with an extension of '.TPU') is already
- debugged and fully functional, all you have to do is indicate in your
- program which units you want to use and then all the power of the unit
- is available. Refer to Chapter 4 (page 61) of the Turbo Pascal Owners
- Handbook for a much more eloquent and detailed explanation of units.
-
- You do not need to understand the internal workings of any of the
- Toolkit units in order to use them - all you need to know is how to
- call the procedures and functions.
-
-
- Example 1
-
- The technique is best illustrated with an example. In the unit FastTTT
- there is a procedure for drawing boxes called BOX. A somewhat
- primitive program to draw a box on the screen would be as follows:
-
-
- PROGRAM TOOLKIT_DEMO;
- USES FASTTTT;
-
- BEGIN
- BOX(1,1,80,25,15,4,1);
- END.
-
-
- All you need to know is the unit that contains the procedure Box and
- the syntax of the Box procedure. (If you must, take a peek at page 10
- to see the detailed documentation for the BOX procedure!) That's all
- there is to it - no need to worry about drawing horizontal and
- vertical lines, or what the ascii codes are for the box corners etc.
-
-
- Example 2
-
- The above example is useful to illustrate the most basic concept of
- the toolkit but it is unlikely that you will always be writing five
- line programs! More typically, you will want to use procedures and
- functions from a variety of the Toolkit units. All you need to do is
- "use" all the units that contain the procedures you want to call. For
- example, let's say we want to expand the above program to draw a
- filled box and write the date in a neat (!) format at the top of the
- screen:
-
-
-
-
- PROGRAM IMPROVED_TOOLKIT_DEMO;
- USES FASTTTT, DOS, MISCTTT;
-
-
-
-
-
-
-
-
-
-
-
-
-
- BEGIN
- FBOX(1,1,80,25,15,4,1);
- WRITECENTER(2,14,4,DATE);
- END.
-
-
- The FBox and WriteCenter procedures are in the FastTTT unit and the
- Date function is in the MiscTTT unit. But, the MiscTTT unit itself
- needs to use the DOS unit (OK, take a quick look at page 115 and see
- the documentation for DATE!). The order of the units declared in the
- USES statement is important but the Toolkit documentation clearly
- indicates which units must be declared and in what order. As a habit,
- I recommend that the first unit in the uses statement should be CRT -
- this is the screen handler unit distributed with the compiler and
- includes commonly used procedures and functions such as ClrScr.
-
- Refer to page 65 of the Turbo Pascal Owners Handbook for further
- information about the uses clause.
-
- The ?????DEM.pas files on the distribution disk are designed to
- further illustrate the basic use of the Toolkit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Attr FastTTT
-
-
-
- Purpose To combine foreground and background colors as a single
- attribute byte.
-
- Result type byte;
-
- Declaration Attr(F,B:byte):byte;
-
- F is the foreground color (0..15)
- B is the background color (0..15)
-
- Uses FastTTT.
-
- Remarks The video memory for an 80 by 25 character screen is
- composed of 2000 bytes of data. There is an attribute byte
- and a character byte for each of the 1000 character
- positions on the screen. This simple function will combine a
- foreground color (F) with a background color (B) to form a
- single attribute byte.
-
- The valid color ranges are 0 to 15. (Refer to Appendix B for
- a color table.)
-
- If a background color is set greater than 7 then "flashing"
- characters will result.
-
- See also Fastwrit, PlainWrite.
-
- Example
-
-
- USES FASTTTT;
- VAR MSG_COL : BYTE;
- BEGIN
- MSG_COL := ATTR(15,4);
- END.
-
-
- The color attribute MSG_COL would be set to white on a red background.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Box FastTTT
-
-
-
- Purpose To draw a rectangle or box on the screen.
-
- Declaration Box(X1,Y1,X2,Y2,F,B,Boxtype: byte);
-
- X1 is the top left X coordinate (1..79)
- Y1 is the top left Y coordinate (1..24)
- X2 is lower right X coordinate (2..80)
- Y2 is lower right Y coordinate (2..25)
- F is the foreground color (0..15)
- B is the background color (0..15)
- Boxtype is the box line type (see remarks)
-
- Uses FastTTT.
-
- Remarks The area inside the box is not cleared.
-
- The normal values for the Boxtype are:
- 1 Single line
- 2 Double line
- 3 Single top/bottom, double sides
- 4 Double top/bottom, single sides
-
- If a BoxType of 0 is passed the the procedure will use a
- space (' ') as the box character. If any other number (i.e.
- 5..256) is used, the box is drawn using the ascii character
- represented by the number. Refer to the Turbo Pascal Owner's
- Handbook page 568 to see the ascii table.
-
- See also FBox, GrowFBox.
-
- Example
-
-
- USES CRT, FASTTTT;
- BEGIN
- CLRSCR;
- BOX(1,1,80,12,WHITE,RED,1);
- BOX(1,13,80,25,BLUE,LIGHTGRAY,2);
- END.
-
-
- The screen would be cleared, a single lined box would be drawn on the
- top half of the screen, and a double lined box in the lower half. Note
- that the CRT unit was also USED - this allowed the use of ClrScr, and
- the colors could be referred to by name rather than their numeric
- code.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ClearLine FastTTT
-
-
-
- Purpose To clear all text on a specific line of the screen.
-
- Declaration ClearLine(Y,F,B:integer);
-
- Y is the line number on the screen to be cleared (1..25)
- F is the foreground color of the blank line (0..15)
- B is the background color of the blank line (0..15)
-
- Uses FastTTT.
-
- Remarks The actual display color of the line will be set to B. The
- only reason for setting the foreground color is to change
- the attribute byte, for subsequent writes.
-
- See also ClearText.
-
- Example
-
-
- USES FASTTTT;
- BEGIN
- CLEARLINE(25,15,0);
- END.
-
-
- The 25th line of the screen is cleared with a black background.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ClearText FastTTT
-
-
-
- Purpose To clear all text on a rectangular section of the screen.
-
- Declaration ClearText(X1,Y1,X2,Y2,F,B:integer);
-
- X1 is the top left X coordinate (1..79)
- Y1 is the top left Y coordinate (1..24)
- X2 is lower right X coordinate (2..80)
- Y2 is lower right Y coordinate (2..25)
-
- F is the foreground color of the blank line (0..15)
- B is the background color of the blank line (0..15)
-
- Uses FastTTT.
-
- Remarks The actual display color of the area will be set to B. The
- only reason for setting the foreground color is to change
- the attribute byte, for subsequent writes.
-
- See also ClearLine, PlainWrite.
-
- Example
-
-
- USES FASTTTT;
- BEGIN
- CLEARTEXT(1,1,40,25,15,0);
- END.
-
-
- The lefthand side of the screen is cleared with a black background.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CurrentDisplay FastTTT
-
-
-
- Purpose Used internally to determine the current type of videocard.
-
- Result DisplayType;
-
- Declaration CurrentDisplay: DisplayType;
-
- The DisplayType is Monochrome, CGA, EGA, MCGA, or VGA
-
- Uses FastTTT.
-
- Remarks This function is used internally.
-
- See also ReinitFastwrite
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Fastwrite FastTTT
-
-
-
- Purpose The core procedure of the unit for fast screen writes.
-
- Declaration Fastwrit(Col, Row, Attr:byte; St: string);external
-
- Col is the X coord of first char. in string (1..80)
- Row is the Y coord of string (1..25)
- Attr is the color attribute
- St is the string or text to be displayed
-
- Uses FastTTT.
-
- Remarks This procedure is external and the source code is actually
- in assembly language. (See the file FastTTT.asm on the
- distribution disk, if you're interested.) I recommend you
- use the WriteAT procedure in preference to Fastwrit, because
- it can pass foreground and background colors rather then the
- combined color attribute. If the text is too long to fit on
- the screen, it will be wrapped onto the next line.
-
- See also Attr, WriteAT, PlainWrite, WriteVert.
-
- Example
-
-
- USES FASTTTT
- BEGIN
- FASTWRITE(1,1,14,'TOP LEFT OF SCREEN');
- FASTWRITE(59,25,ATTR(14,4),'BOTTOM RIGHT OF SCREEN;);
- END;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FBox FastTTT
-
-
-
- Purpose To draw a box and clear the screen inside the box.
-
- Declaration FBox(X1,Y1,X2,Y2,F,B,Boxtype:integer);
-
- X1 is the top left X coordinate (1..79)
- Y1 is the top left Y coordinate (1..24)
- X2 is lower right X coordinate (2..80)
- Y2 is lower right Y coordinate (2..25)
- F is the foreground color (0..15)
- B is the background color (0..15)
- Boxtype is the box line type (see remarks)
-
- Uses FastTTT.
-
- Remarks The normal values for the Boxtype are:
- 1 Single line
- 2 Double line
- 3 Single top/bottom, double sides
- 4 Double top/bottom, single sides
-
- If a BoxType of 0 is passed, the procedure will use a space
- (' ') as the box character. If any other number (i.e.
- 5..256) is used, the box is drawn using the ascii character
- represented by the number. Refer to page 568 of the Turbo
- Pascal Owner's Handbook to see the ascii table.
-
- See also Box, GrowFBox.
-
- Example
-
-
- USES CRT, FASTTTT;
- BEGIN
- FBOX(1,1,80,12,WHITE,RED,1);
- FBOX(1,13,80,25,BLUE,LIGHTGRAY,2);
- END.
-
-
- A single lined box would be drawn on the top half of the screen and
- the area inside the box would be cleared to a red background. A double
- lined box would be drawn in the lower half, and the area inside the
- box would be cleared to lightgray. Note that the CRT unit was also
- USED, so the colors could be refered to by name rather than their
- numeric code.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- GrowFBox FastTTT
-
-
-
- Purpose To draw a box and clear the screen inside the box. This
- procedure is the functional equivalent to FBox, but the box
- grows (or explodes!) on the screen for a fancy visual
- effect.
-
- Declaration GrowFBox(X1,Y1,X2,Y2,F,B,Boxtype:integer);
-
- X1 is the top left X coordinate (1..79)
- Y1 is the top left Y coordinate (1..24)
- X2 is lower right X coordinate (2..80)
- Y2 is lower right Y coordinate (2..25)
- F is the foreground color (0..15)
- B is the background color (0..15)
- Boxtype is the box line type (see remarks)
-
- Uses FastTTT.
-
- Remarks The normal values for the Boxtype are:
- 1 Single line
- 2 Double line
- 3 Single top/bottom, double sides
- 4 Double top/bottom, single sides
-
- If a BoxType of 0 is passed the the procedure will use a
- space (' ') as the box character. If any other number (i.e.
- 5..256) is used the box is drawn using the ascii character
- represented by the number. Refer to page 568 of the Turbo
- Pascal Owner's Handbook to see the ascii table.
-
- If the box grows too quickly or too slowly, alter the global
- variable Speed. The default value is 200; increase the value
- to slow the speed down (ugh!) or decrease it to speed the
- box up.
-
-
-
- See also Box, FBox.
-
- Example
-
-
- USES CRT, FASTTTT;
- BEGIN
- SPEED := 400;
- GROWFBOX(1,1,80,12,WHITE,RED,1);
- GROWFBOX(1,13,80,25,BLUE,LIGHTGRAY,2);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- HorizLine FastTTT
-
-
-
- Purpose To draw a horizontal line on the screen.
-
- Declaration HorizLine(X1,X2,Y,F,B,LineType: integer);
-
- X1 is the left X coordinate (1..79)
- X2 is the right X coordinate (2..80)
- Y is the Y coordinate (1..25)
- F is the foreground color (0..15)
- B is the background color (0..15)
- Linetype is the line type (see remarks)
-
- Uses FastTTT.
-
- Remarks The normal values for the Linetype are:
- 1 Single line
- 2 Double line
-
- X2 may be larger than X1.
-
- See also VertLine
-
- Example
-
-
- USES CRT,FASTTTT;
- BEGIN
- HORIZTLINE(10,17,13,LIGHTCYAN,BLUE,1);
- END.
-
-
- Draws a single horizontal line across the center of the screen.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PlainWrite FastTTT
-
-
-
- Purpose To write text to the screen very quickly in the default
- color attribute.
-
- Declaration PlainWrite(Col, Row: byte; St: string); external;
-
- Col is the X coord of first char. in string (1..80)
- Row is the Y coord of string (1..25)
- St is the string or text to be displayed
-
- Uses FastTTT.
-
- Remarks This procedure is external and the source code is actually
- in assembly language (see the file FastTTT.asm on the
- distribution disk, if you're interested). This procedure is
- very similar to Fastwrite but it uses the current color
- attribute for each character. It is even faster than
- Fastwrite!
-
- See also WriteAT, FastWrite, WriteVert.
-
- Example
-
-
- USES CRT, FASTTTT
- BEGIN
- CLEARTEXT(1,1,80,25,WHITE,BLACK);
- PLAINWRITE(1,1,'TOP LEFT OF SCREEN');
- PLAINWRITE(59,25,'BOTTOM RIGHT OF SCREEN;);
- END;
-
-
- The screen is cleared to a black background with a white foreground,
- and the two phrases are written to the screen in white letters.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ReInitFastWrite FastTTT
-
-
-
- Purpose To initialize variables referenced internally by Fastwrite.
-
- Declaration ReinitFastWrite;external;
-
- Uses FastTTT.
-
- Remarks This procedure is automatically called at the commencement
- of any program that uses the FastTTT unit. (Refer to page 64
- of the Turbo Pascal Owner's Handbook for a further
- explanation of initialized procedures.) It would not
- normally be necessary to call this procedure.
-
- This procedure is external and the source code is actually
- in assembly language. (See the file FastTTT.asm on the
- distribution disk, if you're interested.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Replicate FastTTT
-
-
-
- Purpose To construct a string of repeated characters
-
- Declaration (N:byte; C:Char): string;
-
- Uses FastTTT.
-
- Result type String
-
- Remarks This function uses memory moves and is much faster than a
- "for" loop.
-
- Example
-
-
- USES FASTTTT;
- VAR TXT:STRING;
- BEGIN
- TXT := REPLICATE(80,'+');
- FASTWRITE(1,1,14,TXT);
- END.
-
-
- The variable Txt is set to an 80 character string composed of +'s i.e.
- '++++++++++....+++++++++'. The string is then written to the first
- line of the screen in yellow. Note that these two procedures could be
- combined to form a single statement:
- FastWrite(1,1,14,Replicate(80,'+'));
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- VertLine FastTTT
-
-
-
- Purpose To draw a vertical line on the screen.
-
- Declaration VertLine(X,Y1,Y2,F,B,LineType: integer);
-
- X is the X coordinate (1..80)
- Y1 is the upper Y coordinate (1..24)
- Y2 is the lower Y coordinate (2..25)
- F is the foreground color (0..15)
- B is the background color (0..15)
- Linetype is the line type (see remarks)
-
- Uses FastTTT.
-
- Remarks The normal values for the Linetype are:
- 1 Single line
- 2 Double line
-
- Y2 may be larger than Y1.
-
- See also HorizLine
-
- Example
-
-
- USES CRT,FASTTTT;
- BEGIN
- VERTLINE(40,1,25,LIGHTCYAN,BLUE,2);
- END.
-
-
- Draws a double vertical line down the center of the screen.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WriteAT FastTTT
-
-
-
- Purpose To writes directly to the screen el quicko in specified
- colors.
-
- Declaration WriteAT(X,Y,F,B: integer; St: string);
-
- X is the X coord of first character in the string (1..80)
- Y is Y coord of string
- F is the foreground color (0..15)
- B is the background color (0..15)
- St is the text string
-
- Uses FastTTT.
-
- Remarks This is the most frequently used procedure in the Toolkit.
- It is preferrable to Fastwrite (for most of us), because you
- can specify the foreground and background colors separately.
-
- This procedure cannot be used to write integers or reals -
- first convert the number to a string using the Int_to_Str
- function in the StrngTTT unit.
-
- See also Fastwrit, PlainWrit, WriteVert.
-
- Example
-
-
- USES CRT,FASTTTT;
- CONST
- HEADING = 'TOOLKIT';
- VAR
- NAME: STRING;
- BEGIN
- NAME := 'BOB ''TECHNOJOCK'' AINSBURY';
- WRITEAT(1,25,YELLOW,RED,'PRESS F1 FOR HELP');
- WRITEAT(36,1,LIGHTGREEN,BLACK,HEADING);
- WRITEAT(1,5,LIGHTCYAN,BLACK,NAME);
- WRITEAT(60,20,WHITE,BLACK,'HELLO '+'THERE!');
- END.
-
-
- The example writes various strings to the screen, and illustrates that
- string constants/variables and concatenated strings are valid.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WriteBetween FastTTT
-
-
-
- Purpose To write text centered between two points.
-
- Declaration WriteBetween(X1,X2,Y,F,B: integer; ST: string);
-
- X1 is the left most X coord (1..79)
- X2 is the right most X Coord (2..80)
- Y is the Y coord or line number (1..25)
- F is the foreground (0..15)
- B is the background (0..15)
- ST is the string or text to be displayed
-
- Uses FastTTT.
-
- Remarks If the length of the string is greater than the distance
- between the X coordinates, the string will simply be written
- commencing at X1.
-
- See also WriteCenter, WriteAT.
-
- Example
-
-
- USES FASTTTT;
- BEGIN
- WRITEBETWEEN(1,40,15,0,'LEFT SIDE');
- WRITEBETWEEN(41,80,14,0,'RIGHT SIDE');
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WriteCenter FastTTT
-
-
-
- Purpose To write text on the center of a line
-
- Declaration WriteCenter(Y,F,B: integer; ST: string);
-
- Y is the Y coord or line number (1..25)
- F is the foreground color (0..15)
- B is the background color (0..15)
- ST is the string or text to be displayed
-
- Uses FastTTT.
-
- Remarks The same rules apply as for WriteAT e.g. no reals/integers,
- strings may be concatenated etc.
-
- See also WriteAT, WriteBetween.
-
- Example
-
-
- USES FASTTTT;
- BEGIN
- WRITECENTER(1,13,0,'MAJOR HEADING');
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WriteVert FastTTT
-
-
-
- Purpose To write a string vertically.
-
- Declaration WriteVert(X,Y,F,B: integer; ST: string);
-
- X is X coord of first character in string (1..25)
- Y is Y coord of first character in string (1..80)
- F is the foreground color
- B is the background color
- ST is the string or text to be displayed
-
- Uses FastTTT.
-
- Remarks This odd little procedure will write a string down the
- screen rather than across the screen. If the string is too
- long to fit on the screen, it will be truncated.
-
- Example
-
-
- Uses FastTTT;
- begin
- WriteVert(10,5,15,0,'Y Axis');
- end.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Attrib WinTTT
-
-
-
- Purpose To change the display color (attribute) for part or all of
- the screen.
-
- Declaration Attrib(X1,Y1,X2,Y2,F,B:integer);
-
- X1 is the top left X coordinate (1..80)
- Y1 is the top left Y coordinate (1..25)
- X2 is the lower X coordinate (1..80)
- Y2 is the lower Y coordinate (1..25)
- F is the foreground color (0..15)
- B is the background color (0..15)
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks The characters themselves are not changed, only their
- display color.
-
- See also ClearText.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- ATTRIB(1,13,80,35,LIGHTGRAY,BLACK);
- END.
-
-
- The lower half of the screen display is changed to light gray
- characters on a black background.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CopyScreenBlock WinTTT
-
-
-
- Purpose To copy one part of the screen to another area of the
- display.
-
- Declaration CopyScreenBlock(X1,Y1,X2,Y2,X,Y:integer);
-
- X1 is the top left X coordinate (1..80)
- Y1 is the top left Y coordinate (1..25)
- X2 is the lower X coordinate (1..80)
- Y2 is the lower Y coordinate (1..25)
- X is the top left X coord of the target location (1..80)
- Y is the top left Y coord of the target location (1..25)
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks The data is copied or duplicated to another location on the
- screen. Use the procedure MoveScreenBlock if you want to
- physically move the information whilst blanking the source
- area. The copy operation actually occurs one line at a time,
- so unexpected results may occur if the source and target
- zones overlap.
-
- See Also MoveScreenBlock.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- COPYSCREENBLOCK(1,1,80,2,1,24);
- END.
-
-
- The top two lines of the screen are copied to the bottom two lines of
- the screen.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DisposeScreen WinTTT
-
-
-
- Purpose To free heap space that was allocated to store a screen
- image.
-
- Declaration DisposeScreen(Page: byte);
-
- Page is the number of the screen that was saved with save
- screen.
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks If you have restored a screen using RestoreScreen and you no
- longer need the saved screen image, call this procedure to
- trash the saved image and free the heap space for re-use by
- the program
-
- The Toolkit uses the Turbo Pascal procedures Getmem and
- Freemem. You should not use the conflicting Mark and Release
- heap management procedures anywhere in your program.
-
- See also SaveScreen, RestoreScreen.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- SAVESCREEN(1);
- ....
- . . . {SOME OTHER PROCEDURES THAT CHANGE THE SCREEN}
- ....
- RESTORESCREEN(1);
- DISPOSESCREEN(1);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FillScreen WinTTT
-
-
-
- Purpose To fill part or all of the screen with a specific character.
-
- Declaration FillScreen(X1,Y1,X2,Y2,F,B:integer; C:char);
-
- X1 is the top left X coordinate (1..80)
- Y1 is the top left Y coordinate (1..25)
- X2 is the lower X coordinate (1..80)
- Y2 is the lower Y coordinate (1..25)
- F is the foreground color (0..15)
- B is the background color (0..15)
- C is the character (any displayable ASCII character)
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks This procedure provides a very fast way of filling the
- screen with a specific character. It is useful for creating
- interesting backgrounds for menus and the like.
-
- Use the procedure ClearText to clear a portion of the
- screen.
-
- See also ClearText
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- FILLSCREEN(1,1,80,25,CYAN,BLACK,CHR(177);
- END.
-
-
- The whole screen is filled with the ASCII character 177. It gives a
- blocked stipple effect. See the MenuDem.pas program on the
- distribution disk for a visual example.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FindCursor WinTTT
-
-
-
- Purpose To return the location and size of the cursor.
-
- Declaration FindCursor(var X,Y,ScanTop,ScanBot: byte);
-
- X is the X coord of the cursor (1..80)
- Y is the Y coord of the cursor (1..25)
- Scantop is the top scan line of the cursor
- ScanBot is the bottom scan line of the cursor
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks. This procedure is called by many of the screen saving
- procedures.
-
- The four parameters must be variables, and they are returned
- with the cursor details.
-
- The scan codes refer to the actual location of the top and
- bottom of the cursor within a character field, where zero is
- the top of the field (such as the top stroke of the letter T
- -- got it?), and either 13 or 7 is the bottom of the field
- on monochrome or color machines respectively.
-
- See also SizeCursor, OnCursor, OffCursor, HalfCursor, FullCursor.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT
- VAR ROW,COL,TOP,BOT: BYTE;
- BEGIN
- FINDCURSOR(COL,ROW,TOP,BOT);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FullCursor WinTTT
-
-
-
- Purpose To change the text cursor to a full block.
-
- Declaration FullCursor;
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks This procedure automatically sets the cursor on monochrome
- and color systems.
-
- See also SizeCursor, HalfCursor, Oncursor, Offcursor.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- FULLCURSOR;
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- GrowMkWin WinTTT
-
-
-
- Purpose To create a text window on the screen and saves the screen
- contents that has been overlayed. This procedure is the
- functional equivalent of MkWin, except that the window box
- explodes onto the screen.
-
- Declaration GrowMkWin(X1,Y1,X2,Y2,F,B,Boxtype: integer);
-
- X1 is the top left X coordinate (1..80)
- Y1 is the top left Y coordinate (1..25)
- X2 is the lower X coordinate (1..80)
- Y2 is the lower Y coordinate (1..25)
- F is the foreground color (0..15)
- B is the background color (0..15)
- BoxType is the window box line type (see remarks)
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks The specifications are the same as for GrowFBox.
-
- The normal values for the Boxtype are:
- 1 Single line
- 2 Double line
- 3 Single top/bottom, double sides
- 4 Double top/bottom, single sides
-
- If a BoxType of 0 is passed, the procedure will use a space
- (' ') as the box character. If any other number (i.e.
- 5..256) is used, the box is drawn using the ascii character
- represented by the number. Refer to page 568 of the Turbo
- Pascal Owner's Handbook to see the ascii table.
-
- If the box grows too quickly or too slowly, alter the global
- variable Speed. The default value is 200; increase the value
- to slow the speed down, or decrease it to speed the box up.
-
- See also Mkwin, RmWin
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- SPEED := 400;
- GROWMKWIN(1,1,80,12,WHITE,RED,1);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- HalfCursor WinTTT
-
-
-
- Purpose To make the text cursor into a half block.
-
- Declaration HalfCursor;
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks This procedure automatically sets the cursor on monochrome
- and color systems.
-
- See also SizeCursor, FullCursor, Oncursor, Offcursor.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- HALFCURSOR;
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MkWin WinTTT
-
-
-
- Purpose To create a text window on the screen and save the screen
- contents that has been overlayed.
-
- Declaration MkWin(X1,Y1,X2,Y2,F,B,Boxtype: integer);
-
- X1 is the top left X coordinate (1..80)
- Y1 is the top left Y coordinate (1..25)
- X2 is the lower X coordinate (1..80)
- Y2 is the lower Y coordinate (1..25)
- F is the foreground color (0..15)
- B is the background color (0..15)
- BoxType is the window box line type (see remarks)
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks The specifications are the same as for FBox.
-
- The normal values for the Boxtype are:
- 1 Single line
- 2 Double line
- 3 Single top/bottom, double sides
- 4 Double top/bottom, single sides
-
- If a BoxType of 0 is passed, the procedure will use a space
- (' ') as the box character. If any other number (i.e.
- 5..256) is used the box is drawn using the ascii character
- represented by the number. Refer to page 568 of the Turbo
- Pascal Owner's Handbook to see the ascii table.
-
- If the box grows too quickly or too slowly, alter the global
- variable Speed. The default value is 200; increase the value
- to slow the speed down, or decrease it to speed the box up.
-
- See also GrowMkWin, RmWin
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- SPEED := 400;
- MKWIN(1,1,80,12,WHITE,RED,1);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MoveScreenBlock WinTTT
-
-
-
- Purpose To move one part of the screen to another area of the
- display.
-
- Declaration MoveScreenBlock(X1,Y1,X2,Y2,X,Y:integer);
-
- X1 is the top left X coordinate (1..80)
- Y1 is the top left Y coordinate (1..25)
- X2 is the lower X coordinate (1..80)
- Y2 is the lower Y coordinate (1..25)
- X is the top left X coord of the target location (1..80)
- Y is the top left Y coord of the target location (1..25)
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks The data is moved to another location on the screen and the
- original source area is blanked out. Use CopyScreenBlock to
- leave the source area in tact.
-
- See Also CopyScreenBlock.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- COPYSCREENBLOCK(1,1,40,25,41,1);
- END.
-
-
- The left half of the screen is moved over to the right side.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- OffCursor WinTTT
-
-
-
- Purpose To make the text cursor disappear.
-
- Declaration OffCursor;
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks This procedure automatically hides the cursor on monochrome
- and color systems.
-
- See also SizeCursor, HalfCursor, Oncursor, Fullcursor.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- OFFCURSOR;
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- OnCursor WinTTT
-
-
-
- Purpose To make the text cursor appear in the normal DOS shape.
-
- Declaration OnCursor;
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks This procedure automatically displays the cursor on
- monochrome and color systems.
-
- See also SizeCursor, HalfCursor, Offursor, Fullcursor.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- ONCURSOR;
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PartRestore WinTTT
-
-
-
- Purpose To transfer data from a variable to a screen location.
-
- Declaration PartRestore(X1,Y1,X2,Y2: byte;var Source);
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks This procedure is used internally by the Toolkit.
-
- See also PartRestoreScreen, RestoreScreen, PartSave.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PartRestoreScreen WinTTT
-
-
-
- Purpose To restore a portion of a saved screen to the display.
-
- Declaration PartRestoreScreen(Page,X1,Y1,X2,Y2,X,Y: integer);
-
- Page is the number of the saved screen
- X1 is the top left X coord of saved screen (1..80)
- Y1 is the top left Y coord of saved screen (1..25)
- X2 is the lower X coord of saved screen (1..80)
- Y2 is the lower Y coord of saved screen (1..25)
- X is the top left X coord of the target location (1..80)
- Y is the top left Y coord of the target location (1..25)
-
- Uses CRT, FastTTT, DOS, WinTTT.
-
- Remarks The procedure is used to restore part of a screen that was
- previously saved with SaveScreen. The first four coord.
- parameters indicate which part of the saved screen should be
- restored, and the last pair of coords indicate the position
- on the screen where the top left corner of the restored data
- is located.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- SAVESCREEN(1);
- .....
- .. {SCREEN MODIFYING PROCEDURES}
- .....
- PARTRESTORESCREEN(1,1,1,80,12,1,13);
- DISPOSESCREEN(1);
- END.
-
-
- In this example, the screen is saved (let's assume there was something
- meaningful on the screen at that point), then some other procedures
- modify the screen display. The top half of the saved screen is then
- restored to the lower half of the screen display.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PartSave WinTTT
-
-
-
- Purpose To transfer data from the screen to a variable.
-
- Declaration PartSave(X1,Y1,X2,Y2: byte;var Dest);
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks This procedure is used internally by the Toolkit.
-
- See also SaveScreen.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- RestoreScreen WinTTT
-
-
-
- Purpose To restore a previously saved screen.
-
- Declaration RestoreScreen(Page: byte);
-
- Page is the number of the previously saved screen
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks Only use a page number of a screen that was specified with a
- previous SaveScreen, otherwise unpredictable results will
- occur e.g. flashing happy faces.
-
- RestoreScreen will return the cursor to the position it was
- at immediately prior to the corresponding SaveScreen.
-
- See also SaveScreen, DisposeScreen, SlideRestoreScreen.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- SAVESCREEN(1);
- .....
- .. {SCREEN MODIFYING PROCEDURES}
- .....
- RESTORESCREEN(1);
- DISPOSESCREEN(1);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- RmWin WinTTT
-
-
-
- Purpose To remove a window and restore the original screen contents.
-
- Declaration RmWin;
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks The RmWin procedure removes the last displayed window.
- Successive RmWin statements will remove the earlier
- displayed windows. If RmWin is called when there are no
- windows, the procedure simplr returns i.e. no problem.
-
- The windows are always removed in reverse order e.g. you
- cannot create 3 windows in succession and then try to remove
- the second window without first removing the third one.
-
- See also MkWin.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- VAR CH : CHAR;
- BEGIN
- MKWIN(25,20,65,25,WHITE,RED,1);
- WRITEBETWEEN(25,65,23,WHITE,RED,'DO YOU WANT TO EXIT
- (Y/N)?');
- CH := GETKEY;
- IF UPCASE(CH) = 'Y' THEN
- HALT
- ELSE
- RMWIN;
- END.
-
-
- The above program paints a red window with a white single line border
- on the last five lines of the screen, and displays a message in the
- center of the box. If the user responds Y then the program terminates,
- otherwise the window is removed and the program continues.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SaveScreen WinTTT
-
-
-
- Purpose To save a screen for subsequent restore.
-
- Declaration SaveScreen(Page: byte);
-
- Page is the number assigned to the saved screen
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks This procedure will save a full copy of the screen and all
- the attributes i.e. the colors. The location of the cursor
- is also saved.
-
- Multiple screens can be saved (up to Max_Screens, see
- Interface Declarations at beginning of chapter) at the same
- time. The Page number assignment can be arbitrary, but it is
- good practice to save them in ascending order starting from
- page 1. If a page is already saved to a particular Page and
- another screen is saved to that same Page, the saved screen
- will be overwritten.
-
- See also RestoreScreen, DisposeScreen, SlideRestoreScreen.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- SAVESCREEN(1);
- .....
- .. {SCREEN MODIFYING PROCEDURES}
- .....
- RESTORESCREEN(1);
- DISPOSESCREEN(1);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ScrollUp WinTTT
-
-
-
- Purpose To scroll all or part of the screen upward one line.
-
- Declaration ScrollUp(X1,Y1,X2,Y2:integer);
-
- X1 is the top left X coordinate (1..80)
- Y1 is the top left Y coordinate (1..25)
- X2 is the lower X coordinate (1..80)
- Y2 is the lower Y coordinate (1..25)
-
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks All the text is moved up one line and the lower line is
- replaced with with blanks.
-
- The characters and their color attributes are scrolled.
-
- See also CopyScreenBlock, MoveScreenBlock.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- SCROLLUP(10,1,70,5);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SizeCursor WinTTT
-
-
-
- Purpose To change the cursor shape/appearance.
-
- Declaration SizeCursor(ScanTop,ScanBot: byte);
-
- Scantop is the top scan line of the cursor
- ScanBot is the bottom scan line of the cursor
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks. This procedure is called by OnCursor, OffCursor, HalfCursor
- and FullCursor, and these other procedures should normally
- be used in preference to SizeCursor because they
- automatically accommodate monochrome and color systems.
-
- The scan codes refer to the actual location of the top and
- bottom of the cursor within a character field, where zero is
- the top of the field (such as the top stroke of the letter T
- -- got it?), and either 13 or 7 is the bottom of the field
- on monochrome or color machines respectively.
-
- The cursor can be hidden by setting the top scan line to 14
- -- see OffCursor.
-
- See also FindCursor, OnCursor, OffCursor, HalfCursor, FullCursor.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- IF BASEOFSCREEN = $B800 THEN
- SIZECURSOR(5,7)
- ELSE
- SIZECURSOR(9,13);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SlideRestoreScreen WinTTT
-
-
-
- Purpose To restore a previously saved screen. This procedure is the
- functional equivalent of RestoreScreen except that the text
- s..l...i...d....e.....s onto the screen
-
- Declaration SlideRestoreScreen(Page: byte; Way: direction);
-
- Page is the number of the previously saved screen
- Way is the direction to slide i.e. up, down, left or right
-
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks Only use a page number of a screen that was specified with a
- previous SaveScreen, otherwise unpredictable results will
- occur e.g. flashing happy faces.
-
- RestoreScreen will return the cursor to the position it was
- at immediately prior to the corresponding SaveScreen.
-
- See also SaveScreen, DisposeScreen, RestoreScreen.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- SAVESCREEN(1);
- .....
- .. {SCREEN MODIFYING PROCEDURES}
- .....
- SLIDERESTORESCREEN(1,DOWN);
- DISPOSESCREEN(1);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TempMessage WinTTT
-
-
-
- Purpose To display a message anywhere on the screen, wait for a
- keypress (or mouse activity), and then restore the original
- screen contents.
-
- Declaration TempMessage(X,Y,F,B: integer; St: string);
-
- X is the X coord of the first character (1..80)
- Y is the Y coordinate or display line (1..25)
- F is the foreground color (0..15)
- B is the background color (0..15)
- St is the string or message text
-
- Uses Crt, FastTTT, DOS, WinTTT.
-
- Remarks The procedure temporarily stores the line of text together
- with its color attributes. It displays the temporary
- message, and after a key is pressed (any key, or any mouse
- activity), the original text and color attributes are
- restored to the screen.
-
- Note that the procedure does not return which key was
- pressed.
-
- This is one of the most popular procedures in the Toolkit
- and is most useful when the screen is very busy and you want
- to display an error or warning message without modifying the
- display.
-
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT;
- BEGIN
- TEMPMESSAGE(1,1,YELLOW,RED,'YOU CANNOT REFORMAT THE
- NETWORK!');
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Confine_Mouse_Horiz KeyTTT
-
-
-
- Purpose To restrict the screen position of the mouse cursor
- horizontally.
-
- Declaration Confine_Mouse_Horiz(Left,Right: integer);
-
- Left is the left most X coord (1..80)
- Right is the right most X coord (1..80)
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks If the mouse is outside the confined coords when the
- restrictions are made, the mouse is repositioned inside the
- nearest boundary, as soon as any mouse activity occurs .
-
- See also Confine_Mouse_Vert.
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- BEGIN
- HIDE_MOUSE_CURSOR;
- CONFINE_MOUSE_HORIZ(20,60);
- SHOW_MOUSE_CURSOR;
- END.
-
-
- The mouse is resticted to movement between columns 20 and 60.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Confine_Mouse_Vert KeyTTT
-
-
-
- Purpose To restrict the screen position of the mouse cursor
- vertically.
-
- Declaration Confine_Mouse_Vert(Top,Bot: integer);
-
- Top is the upper most Y coord (1..25)
- Bot is the lower most Y coord (1..25)
-
- Uses CRT, DOS, KeyTTT;
-
- Remarks If the mouse is outside the confined coords, then as soon as
- any mouse activity occurs (or a mouse function is called)
- the mouse is repositioned inside the nearest boundary.
-
- See also Confine_Mouse_Horiz.
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- BEGIN
- HIDE_MOUSE_CURSOR;
- CONFINE_MOUSE_HORIZ(20,60);
- CONFINE_MOUSE_VERT(5,15);
- SHOW_MOUSE_CURSOR;
- END.
-
-
- The mouse is resticted to movement between columns 20 to 60, and
- between rows 5 to 15.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DelayKey KeyTTT
-
-
-
- Purpose To pause while user presses key or a specified time period
- elapses.
-
- Declaration DelayKey(Time: integer);
-
- Time is the maximum pause in seconds.
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks This is one of my favorites. The system pauses until a key
- is pressed or, if a key isn't pressed, until a specified
- time has elapsed.
-
- Very useful for temporarily displaying messages, copyright
- screens etc. As soon as the user presses a key (or there is
- mouse activity) the procedure ends.
-
- See also GetKey.
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- BEGIN
- DISPLAY_HELP; {SOME EARLIER DEFINED PROCEDURE}
- DELAYKEY(5);
- CLRSCR;
- END.
-
-
- A help screen is displayed for up to 5 seconds or until a key is
- pressed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- GetKey KeyTTT
-
-
-
- Purpose To read a character from the keyboard.
-
- Declaration GetKey:char;
-
- Returns Char
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks This is the main function in the KeyTTT unit and is called
- throughout the Toolkit.
-
- This is a fully functional replacement for Turbo's internal
- ReadKey command. Refer to Appendix B for a full list of all
- the character codes that are returned.
-
- See also Delay_Key.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, KEYTTT;
- VAR CH : CHAR;
- BEGIN
- WRITECENTER(25,LIGHTCYAN,BLUE,'PRESS F10 TO CONTINUE');
- CH := GETKEY;
- IF CH <> #196 THEN
- HALT;
- END.
-
-
- The code for F10 is #196, see appendix B.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Get_Mouse_Action KeyTTT
-
-
-
- Purpose Determine mouse activity i.e. movement and button presses.
-
- Declaration Get_Mouse_Action(var But:button; var Hor, Ver:
- integer);
-
- But is retuned with one of NoB, LeftB, RightB, BothB
- Hor and Ver return the horizontal and vertical movement
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks This procedure is designed for internal use and is called by
- GetKey.
-
- The Hor & Ver variables return the movement in cols and rows
- not pixels i.e. Pixel div 8. The movement is returned
- relative to the position of the mouse the last time the
- procedure was called.
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- VAR
- B : BUTTON;
- X,Y : INTEGER;
- BEGIN
- REPEAT
- GET_MOUSE_ACTION(B,X,Y);
- UNTIL B = LEFTB;
- END.
-
-
-
- This program continues looping until the left mouse button is pressed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hide_Mouse_Cursor KeyTTT
-
-
-
- Purpose To hide the mouse cursor from view!
-
- Declaration Hide_Mouse_Cursor;
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks The mouse cursor is set on with the Show_Mouse_Cursor
- procedure.
-
- The normal text Cursor is not affected by this procedure,
- and the OffCursor procedure should also be called to turn it
- off.
-
- See also Show_Mouse_Cursor.
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- BEGIN
- HIDE_MOUSE_CURSOR;
- END.
-
-
- See the file MouseDem.pas on the distribution disk for a more detailed
- example.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Mouse_Installed KeyTTT
-
-
-
- Purpose To indicate if a Microsoft compatible mouse is installed.
-
- Declaration Mouse_Installed:boolean;
-
- Returns Boolean;
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks This procedure is automatically called (if you include the
- KeyTTT unit in your program) and it updates the global
- variable Moused.
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- BEGIN
- IF NOT MOUSE_INSTALLED THEN HALT;
- END.
-
-
- See the file MouseDem.pas on the distribution disk for a more detailed
- example.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Move_Mouse KeyTTT
-
-
-
- Purpose To reposition the mouse cursor.
-
- Declaration Move_Mouse(Hor,Ver:integer);
-
- Hor is the X coordinate (1..80)
- Ver is the Y coordinate (1..25)
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks This procedure is the functional equivalent of GotoXY for
- the text cursor.
-
- See also Confine_Mouse_Horiz, Confine_Mouse_Vert.
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- BEGIN
- MOVE_MOUSE(40,13);
- END.
-
-
- The mouse cursor is moved to the center of the display. See the file
- MouseDem.pas on the distribution disk for a more detailed example.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Set_Mouse_Cursor_Style KeyTTT
-
-
-
- Purpose To change the appearance of the mouse cursor.
-
- Declaration Set_Mouse_Cursor_Style(OrdChar:integer);
-
- OrdChar is the ASCII code for the desired cursor character.
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks In text mode the shape of the mouse cursor can be any of the
- displayable ASCII characters - you can even make the cursor
- the letter 'C' if you feel so inclined!
-
- The default cursor is a small rectangle. Once the cursor
- style has been modified, it will assume the new style until
- the mouse is re-installed (usually from a reboot), or until
- this procedure changes it again.
-
- Refer to page 568 of the Turbo Pascal Owner's Handbook for a
- list of the ASCII characters and codes.
-
- See also Show_Mouse_Cursor.
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- BEGIN
- SET_MOUSE_CURSOR_STYLE(29);
- END.
-
-
- The cursor is changed to a double headed arrow.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Show_Mouse_Cursor KeyTTT
-
-
-
- Purpose To reisplay the mouse cursor.
-
- Declaration Show_Mouse_Cursor;
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks The mouse cursor is not normally displayed. Use this
- procedure to display the mouse and use Hide_Mouse_Cursor to
- turn it off again.
-
- See also Show_Mouse_Cursor, Confine_Mouse_Horiz, Confine_Mouse_Vert.
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- BEGIN
- SHOW_MOUSE_CURSOR;
- END.
-
-
- See the file MouseDem.pas on the distribution disk for a more detailed
- example.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IO_AllowEsc IOTTT
-
-
-
- Purpose To indicate if Esc key is operative
-
- Type Optional.
-
- Declaration IO_AllowEsc(OK:boolean);
-
- OK is true if you want to allow the user to ESCape.
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
-
- Remarks The default is false, i.e. Esc is in-operative.
-
- If the user does ESC the return code from IO_Edit is set to
- 1.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT, KEYTTT, IOTTT;
- BEGIN
- IO_ALLOWESC(FALSE);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IO_DefineMsg IOTTT
-
-
-
- Purpose To display a message when the user moves to the specified
- input field.
-
- Type Optional.
-
- Declaration IO_DefineMsg(ID, X, Y:byte;ST : string);
-
- ID is the ID number of the input field assigned with this
- message.
- X is the X coord of the first char of the message
- Y is the Y coord or display line of the message
- ST is the text or message
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
-
- Remarks Every input field is assigned an ID in the IO_DefineStr
- routine.
-
- You can display a message when the user moves to any input
- field. When the user exits the field, the message is removed
- and the original screen content (which was overlayed by the
- message) is restored.
-
- You can define unique messages for one, some or all of the
- input fields.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT, KEYTTT, IOTTT;
- BEGIN
- IO_DEFINEMSG(7,1,25,'INPUT THE CHEST MEASUREMENT');
- END.
-
-
- The message "Input the chest measurement" will be displayed at the
- bottom left of the screen, whenever the cursor is moved to input field
- 7.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IO_DefineStr IOTTT
-
-
-
- Purpose To define all the characteristics of a specific input field.
- This is the major procedure in the IOTTT unit.
-
- Type Mandatory
-
- Declaration IO_DefineStr(ID,
- U,D,L,R,
- X,Y: byte;
- var DefString : string;
- DefFormat : string);
-
- See Remarks.
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
-
- Remarks ID is the ID number for this input field. Every field is
- assigned an ID number, the same ID number is used by the
- IO_DefineMsg procedure. It is logical (but not mandatory) to
- start with ID number 1 and increment by one as you define
- each field.
-
- U,D,L,R are four bytes which represent the ID's of the
- fields which the cursor should move to if the up, down, left
- or right edit keys respectively are pressed, . For example,
- 5,2,5,2 would state that if the up or left keys are
- pressed, the cursor will move to field ID 5, and if the down
- or right keys are pressed, the cursor will move to field ID
- 2. Got it? Note that an ID of zero (0) indicates that the
- input session will terminate (as if the End key had been
- pressed). This is a useful tool if you want to end a session
- after the last field has been updated and the user tries to
- move forward to the next input field.
-
- X,Y simply represent the X and Y coordinates of the first
- character in the input field. This is how you tell the
- system the location of the field on the screen.
-
- DefString is a previously declared parameter of type string
- which is returned from the IO procedure with the user's
- input. If you want to provide the user with a default entry,
- then set the value of DefString to the required default
- string, otherwise set it to null i.e. ''.
-
- DefFormat which is the format of the input field (as
- discussed previously under the sub-heading FORMATTING).
-
- Example See Major example on page 64.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IO_DisplayFields IOTTT
-
-
-
- Purpose To display the input fields on the screen, prior to input.
-
- Type Optional.
-
- Declaration IO_DisplayFields;
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
-
- Remarks Normally the fields are not displayed on the screen until
- the IO_Edit procedure is called. Call this procedure if you
- want to display the input fields before allowing the user to
- edit them.
-
- This procedure must be preceded by IO_SetFields, and all the
- IO_DefineStr statements.
-
- Example See Major example on page 64
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IO_Edit IOTTT
-
-
-
- Purpose To control user input of data.
-
- Type Mandatory.
-
- Declaration IO_Edit(var Retcode: integer);
-
- Retcode must be an integer variable
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
-
- Remarks When you have declared all the parameters and defined all
- the IO procedures (including any optional procedures such as
- color changes) then you're ready to let the user input and
- update the fields. IO_Edit does this and passes control to
- the user.
-
- The procedure returns control to your program when the user
- has ended the update session, either by pressing End or Esc
- (if it is enabled) or by pressing any of the move to next
- field keys (Enter, Tab, etc.) when the next field has been
- defined as ID zero.
-
- The Retcode variable is updated with a return code for the
- edit session. The return codes are :
-
- 0 for successful completion
- 1 if user pressed Esc key
-
- Example See Major example on page 64.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IO_ResetFields IOTTT
-
-
-
- Purpose To dispose of memory used during IO process and reset the
- input variables to default values.
-
- Type Mandatory.
-
- Declaration IO_ResetFields;
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
-
- Remarks This procedure is normally the next statement after IO_Edit.
- It discards all the field definitions from the Heap and sets
- all the optional settings (such as color) back to the
- default values.
-
- Example See Major example on page 64
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IO_SetColors IOTTT
-
-
-
- Purpose To set the colors to your preferred values. Believe it or
- not, some people don't like my choice of colors!
-
- Type Optional
-
- Declaration IO_SetColors(HF,HB,LF,LB,MF,MB:byte);
-
- HF is the foreground color of the active field (0..15)
- HB is the background color of the active field (0..7)
- LF is the foreground color of the other fields (0..15)
- LB is the background color of the other fields (0..7)
- MF is the foreground color of the optional message (0..15)
- MB is the background color of the optional message (0..15)
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
-
- Remarks The Toolkit will default to one of two sets, depending on
- whether the system is monochrome or color.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT, KEYTTT, IOTTT;
- BEGIN
- IF BASEOFSCREEN = $B800 THEN
- IO_SETCOLORS(YELLOW, RED, BLACK, LIGHTGRAY,
- LIGHTCYAN, BLUE);
- ELSE
- IO_SETCOLORS(WHITE, BLACK, LIGHTGRAY, BLACK, BLACK,
- LIGHTGRAY);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IO_SetFields IOTTT
-
-
-
- Purpose Indicates the total number of input fields.
-
- Type Mandatory
-
- Declaration IO_SetFields(Tot: integer);
-
- Tot is the total number of input fields on the screen.
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
-
- Remarks This procedure must be the first IOTTT procedure. Pass the
- total number of input fields that will be defined. For
- example, IO_Setfields(5) advises the system that 5 input
- fields will be defined on the next input screen.
-
- The maximum number of fields is determined by the global
- constant MaxInputFields, see IOTTT.pas on the distribution
- disk. This constant may be changed to any desired value in
- the range 1..2000.
-
- Example See Major example on page 64
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IO_SoundBeeper IOTTT
-
-
-
- Purpose To switch the (annoying) beep on or off.
-
- Type Optional.
-
- Declaration IO_SoundBeeper(OK:boolean);
-
- OK is true if you want the system to BEEEP when the user
- presses an invalid key.
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
-
- Remarks The default is true, i.e. the system will beep.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, WINTTT, KEYTTT, IOTTT;
- BEGIN
- IO_SOUNDBEEPER(FALSE);
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IO_UserHook IOTTT
-
-
-
- NOTE This is not a procedure. IO_UserHook is declared as a pointer
- variable.
-
- Purpose To provide a way of intercepting the input and optionally
- calling a non-Toolkit procedure, i.e. a special procedure
- you have written.
-
- Type Optional
-
- Declaration IO_UserHook := @Procedure_Name
-
- Procedure_name is the actual name of the procedure which is
- to be called each time a key is pressed.
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, IOTTT.
-
- Remarks The procedure must be declared as follows:
-
-
- {$F+}
- PROCEDURE_NAME(CH:CHAR; FIELDID: INTEGER; VAR RETURNSTR:
- STRING);
- BEGIN
- ..... {STATEMENTS}
- END;
- {$F-}
-
-
- The compiler directives (F and F-) designate the procedure as
- FAR. The Procedure_Name can be any valid procedure name, and
- this procedure may call other procedures. The 3 procedure
- parameters must be defined in the order shown.
-
- Ch will be the value of the character input by the user
- ,refer to appendix B for a list of the codes. Check this
- variable immediately and EXIT the procedure if it is not one
- of the special keys you are trying to intercept.
-
- FieldID will indicate the ID of the field the user is
- currently editing.
-
- ReturnStr is passed to the procedure with the current field
- value. You may update this variable to reset the current
- value of the field.
-
- Example See IOdem.pas on the distribution disk.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ReadLine ReadTTT
-
-
-
- Purpose To provide a line input/editing facility
-
- Declaration ReadLine( X,Y,L,F,B: byte
- var Text: string;
- var Retcode: string);
-
- X is the X coord of input field (1..80)
- Y is the Y coord of input field (1..25)
- L is the length in chars of input field(1..80)
- F is the foreground color (0..15)
- B is the background color (0..7)
- Text is returned with the users input
- Retcode indicates if user Escaped.
-
- Uses CRT, FastTTT, ReadTTT.
-
- Remarks "Text" must be declared as a string variable. This variable
- is returned with the users input. If you want to provide the
- user with a default entry, set the value of Text to the
- desired default string, otherwise set it to null, i.e. ''.
-
- "Retcode" must be an integer variable and it is returned
- with the following values:
- 0 successful completion
- 1 user ESCaped
-
- Example
-
-
- USES CRT, FASTTTT, READTTT;
- VAR
- THEFILE: STRING;
- CODE : INTEGER;
- BEGIN
- THEFILE := '';
- WRITEAT(10,5,WHITE,BLACK,'ENTER THE FILENAME ===>');
- REPEAT
- READLINE(33,5,12,BLACK,LIGHTGRAY, THEFILE, CODE);
- UNTIL CODE = 0;
- END.
-
-
- A 12 character field is presented for the user to input a filename. If
- the user ESCapes, the system will re-prompt for a filename.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DisplayMenu MenuTTT
-
-
-
- Purpose To display a highly formatted menu window.
-
- Declaration Displaymenu(MenuDef: menu_record;
- Window: boolean;
- var Choice,Retcode: integer);
-
- MenuDef - the name of the menu record.
-
- Window - when true indicates the screen prior to menu
- display should be restored after menu completion.
-
- Choice is returned with the users menu selection. The
- variable should be initialized to the menu pick that should
- be highlighted when the menu is first displayed.
-
- Retcode is returned with a value of zero if the execution
- was successful, or 1 if the user pressed Esc and AllowEsc
- was enabled.
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, MenuTTT.
-
- See also Pull_menu (discussed in next chapter)
-
- Example See previous page.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Pull_Menu PullTTT
-
-
-
- Purpose To display a pulldown menu.
-
- Declaration Pull_menu(M: MenuDesc; var PickM, PickS: byte);
-
- M is the MenuDesc array containing all the topics
-
- PickM is returned with the main heading selected, this is
- set to 0 if the user pressed Esc and PM.AllowEsc is true.
-
- PickS is returned with the sub-topic selected
-
- Uses Crt, FastTTT, DOS, WinTTT, KeyTTT, PullTTT.
-
- Remarks Modify the contents of the PM record to alter display
- format.
-
- The PickM and PickS variables should be initialized to the
- default values that should be highlighted when the menu is
- first displayed. If PickS is set to 0, the submenu will not
- be initially displayed.
-
- See also DisplayMenu (discussed in previous Chapter)
-
- Example See Major Example on page 54.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PM_UserHook IOTTT
-
-
-
- NOTE This is not a procedure. PM_UserHook is declared as a pointer
- variable.
-
- Purpose The PM_UserHook provides a way of intercepting the input and
- optionally calling a non-Toolkit procedure, i.e. a special
- procedure you have written.
-
- Declaration PM_UserHook := @Procedure_Name
-
- Procedure_name is the actual name of the procedure which is
- to be called each time a key is pressed.
-
- Uses CRT, FastTTT, DOS, WinTTT, KeyTTT, PullTTT.
-
- Remarks The procedure must be declared as follows:
-
-
- {$F+}
- PROCEDURE_NAME(VAR CH:CHAR; MAIN, SUB: BYTE);
- BEGIN
- ..... {STATEMENTS}
- END;
- {$F-}
-
-
- The compiler directives (F and F-) designate the procedure as
- FAR. The Procedure_Name can be any valid procedure name, and
- this procedure may call other procedures. The 3 procedure
- parameters must be defined in the order shown.
-
- Ch will be the value of the character input by the user.
- Refer to appendix B for a list of the codes. Check this
- variable immediately and EXIT the procedure if it is not one
- of the special keys you are trying to intercept.
-
- Main is the number of the main menu currently selected
-
- Sub is the number of the sub-topic currently selected
-
-
- Example See Pulldem.pas on the distribution disk.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Display_Directory DirTTT
-
-
-
- Purpose To display a Sidekick-like directory for the user to select
- a file.
-
- Returns a string containing the selected file.
-
- Declaration Display_Directory( var PathName: string;
- FileMask: string):string;
-
- PathName is a string variable containing the directory to
- initially display.
-
- FileMask is a string containing a DOS compatible file mask.
- The ? and * symbols are supported e.g. '*.pas',
- '???willy.*'.
-
- Remarks If the D.AllowEsc variable is enabled, then the function
- returns a string of #027 if the user ESCapes.
-
- There is no facility for saving/restoring the screen
- automatically. If necessary, use the SaveScreen and
- RestoreScreen procedures included in the WinTTT unit.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, KEYTTT, WINTTT, DIRTTT;
- VAR F,P : STRING;
- BEGIN
- GETDIR(0,P);
- F := DISPLAY_DIRECTORY(P,'*.*');
- END;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ExtractWords StrngTTT
-
-
-
- Purpose To extract a number specified number of words from a string.
-
- Returns string;
-
- Declaration ExtractWords(S,N: byte; Str: string):string;
-
- S is number of the first word to extract
- N is the number of words to extract
- Str is the string to extract from
-
- Uses StrngTTT.
-
- Remarks If there are insufficient words to extract, the function
- will return as many words as possible.
-
- If there are fewer than S words in the string, the function
- returns a null string, i.e. ''.
-
- Example
-
-
- USES STRNGTTT;
- VAR LASTBIT : STRING;
- BEGIN
- LASTBIT := EXTRACTWORDS(4,3,'WHO THE HELL SAYS
- CENSORSHIP IS GOOD!');
- END.
-
-
- The string LastBit is assigned the value 'Censorship is good!'.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- First StrngTTT
-
-
-
- Purpose To return the first part of a string.
-
- Returns string;
-
- Declaration First(N: byte; Str: string):string;
-
- N is the number of characters to extract.
- Str is the string to extract them from
-
- Uses StrngTTT.
-
- See also Last
-
- Remarks If the source string is fewer than N characters long, the
- whole string is returned.
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := FIRST(25,'ALL GOOD THINGS WILL COME TO PASS!');
- END.
-
-
- The string TTT is assigned the value "All good things will come".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Int_to_Str StrngTTT
-
-
-
- Purpose To convert an integer to a string.
-
- Returns string;
-
- Declaration Int_to_Str(Number: longInt):string;
-
- Number can actually be byte, integer or longint
-
- Uses StrngTTT.
-
- See also Real_to_Str, Str_to_Int
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := INT_TO_STR(130);
- END.
-
-
- The value of TTT is set to '130'.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Last StrngTTT
-
-
-
- Purpose To return the last part of a string.
-
- Returns string
-
- Declaration Last(N: byte; Str: string):string;
-
- N is the number of characters to extract.
- Str is the string to extract them from
-
- Uses StrngTTT.
-
- See also First
-
- Remarks If the source string is fewer than N characters long, the
- whole string is returned.
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := LAST(11,'NEVER TAKE DRUGS!');
- END.
-
-
- The string TTT is assigned the value "Take Drugs!".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- LastPos StrngTTT
-
-
-
- Purpose To find the last occurence of a character in a string.
-
- Returns byte;
-
- Declaration LastPos(C:char; Str:string):byte;
-
- C is the character to search for.
- Str is the string to search
-
- Uses StrngTTT.
-
- See also Pos (Turbo internal function)
-
- Remarks If the character is not found in the string, the function
- returns 0.
-
- The search is case sensitive.
-
- Example
-
-
- USES STRNGTTT;
- VAR B : BYTE;
- BEGIN
- B := LASTPOS('J','TECHNOJOCK SOFTWARE!');
- END.
-
-
- The variable B is assigned the value 12
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Lower StrngTTT
-
-
-
- Purpose To convert a string to lower case letters.
-
- Returns String;
-
- Declaration Lower(Str:string):string;
-
- Str is the string to be converted
-
- Uses StrngTTT.
-
- See also Upper, Proper.
-
- Remarks Only the upper case alphabet (A..Z) is affected.
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := LOWER('LEARNING TO TYPE');
- END.
-
-
- The string TTT is assigned the value "learning to type".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- OverType StrngTTT
-
-
-
- Purpose To combine two overlapping strings.
-
- Returns string;
-
- Declaration OverType(N:byte; StrS,StrT:string):string;
-
- N is the character position that the StrT (target) will be
- overlayed on the StrS (source).
-
- Uses StrngTTT.
-
- Remarks If N is actually larger than the length of the source
- string, the source string is extended with spaces ' ' i.e.
- no problem.
-
- Any characters after the Nth position in StrS will be
- replaced by the characters in StrT.
-
- If N + length(StrT) is less than the original length of StrS
- then the last part of StrS will remain intact. (Phew!)
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := OVERTYPE(5, 'BOB AINSBURY', 'TECHNOJOCK'));
- END.
-
-
- The string TTT is assigned the value "Bob TechnoJock".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PadCenter StrngTTT
-
-
-
- Purpose Tp expand and center a string with a specific character.
-
- Returns String;
-
- Declaration PadCenter(Str:string; Size:byte; Pad:char):string;
-
- Str is the string to be expanded
- Size is the new string length
- Pad is the character to expand the string with
-
- Uses StrngTTT.
-
- See also PadLeft, PadRight
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := PADCENTER(' ASTERISKS ',20,'*');
- END.
-
-
- The string TTT is assigned the value "***** Asterisk *****".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PadLeft StrngTTT
-
-
-
- Purpose To expand and left justify a string with a specific
- character.
-
- Returns String;
-
- Declaration PadLeft(Str:string; Size:byte; Pad:char):string;
-
- Str is the string to be expanded
- Size is the new string length
- Pad is the character to expand the string with
-
- Uses StrngTTT.
-
- See also PadCenter, PadRight
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := PADLEFT(' ASTERISKS ',20,'*');
- END.
-
-
- The string TTT is assigned the value " Asterisk **********".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PadRight StrngTTT
-
-
-
- Purpose To expand and right justify a string with a specific
- character.
-
- Returns String;
-
- Declaration PadRight(Str:string; Size:byte; Pad:char):string;
-
- Str is the string to be expanded
- Size is the new string length
- Pad is the character to expand the string with
-
- Uses StrngTTT.
-
- See also PadCenter, PadLeft
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := PADRIGHT(' ASTERISKS ',20,'*');
- END.
-
-
- The string TTT is assigned the value "********** Asterisk ".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PosWord StrngTTT
-
-
-
- Purpose To determine the starting character position of a word.
-
- Returns byte;
-
- Declaration PosWord(WordNo:byte; Str:string):byte;
-
- WordNo is the number of the word to check
- Str is the string to be analyzed
-
- Uses StrngTTT.
-
- See also WordCnt, ExtractWords
-
- Remarks The function returns zero if the string is a null or if
- there are less than WordNo words in the string.
-
- Example
-
-
- USES STRNGTTT;
- VAR B : BYTE;
- BEGIN
- B := POSWORD(3,'THE QUICK BROWN LINEMAN');
- END.
-
-
- The variable B is assigned the value 11.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Proper StrngTTT
-
-
-
- Purpose To convert a string so that each word begins with an
- uppercase letter.
-
- Returns String;
-
- Declaration Proper(Str:string): string;
-
- Str is the string to be converted
-
- Uses StrngTTT.
-
- See also Lower, Upper.
-
- Remarks Only the alphabet (a..z) is affected.
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := PROPER('R D AINSBURY');
- END.
-
-
- The string TTT is assigned the value "R D Ainsbury".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Real_to_Str StrngTTT
-
-
-
- Purpose To convert a real number to a string with a specified number
- of decimal places.
-
- Returns string;
-
- Declaration Real_to_Str(R:real; Dec:byte):string;
-
- R is the real number
- Dec is the number of decimal places for the string
-
- Uses StrngTTT.
-
- See also Str_to_Real, Int_to_Str.
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := REAL_TO_STR(12345.789990,2);
- END.
-
-
- The string TTT is assigned the value "12345.79".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Strip StrngTTT
-
-
-
- Purpose To remove a character from a string
-
- Returns string;
-
- Declaration Strip(L,C:char; Str:string):string;
-
- L is a character indicating which part of the string to
- strip the characters (see remarks)
- C is the character to strip
- Str is the string to strip
-
- Uses StrngTTT.
-
- Remarks The valid values of L are
- 'L' strip all leading characters
- 'R' strip all trailing characters
- 'B' strip leading and trailing characters
- 'A' strip all occurences of the character
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := STRIP('B',' ',' THIS IS NEAT ');
- END.
-
-
- The string TTT is assigned the value "This is neat".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Str_to_Int StrngTTT
-
-
-
- Purpose To convert a string to an integer
-
- Returns integer;
-
- Declaration Str_to_Int(Str:string): integer;
-
- Str is the string to be converted
-
- Uses StrngTTT.
-
- Remarks If the string Str is null or the string cannot be
- successfully converted to an integer, the function returns a
- zero.
-
-
-
- See also Str_to_Real, Int_to_Str.
-
- Example
-
-
- USES STRNGTTT;
- VAR I : INTEGER;
- BEGIN
- I := STR_TO_INT('165');
- END.
-
-
- The variable I is assigned the value 165.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Str_to_Real StrngTTT
-
-
-
- Purpose To convert a string to an real.
-
- Returns real;
-
- Declaration Str_to_real(Str:string):real;
-
- Str is the string to be converted
-
- Uses StrngTTT.
-
- Remarks If the string Str is null, or the string cannot be
- successfully converted to a real , the function returns a
- zero.
-
- This procedure gets around the bug in Turbo 4 that occurs
- when trying to convert a string starting with a '.', to a
- number.
-
- See also Str_to_Int, Real_to_Str.
-
- Example
-
-
- USES STRNGTTT;
- VAR R : INTEGER;
- BEGIN
- R := STR_TO_REAL('165.787');
- END.
-
-
- The variable R is assigned the value 165.787 .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Upper StrngTTT
-
-
-
- Purpose To convert a string to upper case letters.
-
- Returns String;
-
- Declaration Upper(Str:string):string;
-
- Str is the string to be converted
-
- Uses StrngTTT.
-
- See also Lower, Proper.
-
- Remarks Only the alphabet (a..z) is affected.
-
- Example
-
-
- USES STRNGTTT;
- VAR TTT : STRING;
- BEGIN
- TTT := UPPER('SMALL LETTERS');
- END.
-
-
- The string TTT is assigned the value "SMALL LETTERS".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WordCnt StrnTTT
-
-
-
- Purpose To count the number of words in a string.
-
- Returns byte;
-
- Declaration WordCnt(Str:string):byte;
-
- Str is the string to be counted
-
- Uses StrngTTT.
-
- See also ExtractWords, PosWord.
-
- Example
-
-
- USES STRNGTTT;
- VAR B : BYTE;
- BEGIN
- B := WORDCNT('THATS ALL THE STRING FUNCTIONS, FOLKS!');
- END.
-
-
- The variable B is assigned the value 6.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Beep MiscTTT
-
-
-
- Purpose To give 'em a beep.
-
- Declaration Beep;
-
- Uses CRT, DOS, MiscTTT.
-
- Remarks This gives a more pleasant tone than ^G.
-
- Example
-
-
- USES CRT, DOS, MISCTTT;
- BEGIN
- IF ........ THEN
- BEEP;
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Date MiscTTT
-
-
-
- Purpose To display the system date nicely formatted
-
- Returns String;
-
- Declaration Date:string;
-
- Uses CRT, DOS, MiscTTT.
-
- See also Time
-
- Remarks The format of the returned string is the day followed by the
- month, day of month and year e.g.
-
- Monday February 1, 1988
-
- Example
-
-
- USES CRT, FASTTTT, DOS, MISCTTT;
- BEGIN
- CLRSCR;
- WRITECENTER(1,YELLOW,BLACK,DATE);
- END.
-
-
- The date would be written at the top center of the screen.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Exists MiscTTT
-
-
-
- Purpose To determine if a file exists
-
- Returns Boolean;
-
- Declaration Exists(Fl:string):boolean;
-
- Fl is the name of the file, including drive and path if
- necessary.
-
- Uses CRT, DOS, MiscTTT.
-
- Example
-
-
- USES CRT, DOS, MISCTTT;
- BEGIN
- IF NOT EXIST('C:\CONFIG.SYS') THEN
- BEEP;
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FlushKeyBuffer MiscTTT
-
-
-
- Purpose To remove all keystrokes from the keyboard buffer.
-
- Declaration FlushkeyBuffer;
-
- Remarks This procedure is most frequently used when you want to stop
- the type-ahead effect.
-
- Uses CRT, DOS, MiscTTT.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, MISCTTT;
- VAR ANS : CHAR;
- BEGIN
- WRITEAT(1,WHEREY+1,WHITE,RED,'ARE YOU SURE YOU WANT TO
- DELETE IT? (Y/N);
- FLUSHKEYBUFFER;
- ANS := GETKEY;
- IF UPCASE(ANS) = 'Y' THEN
- DELRECORD;
- END.
-
-
- The keyboard is flushed in case the user had previously typed a Y in
- anticipation of a different question.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Printer_Ready MiscTTT
-
-
-
- Purpose To indicate if the printer is connected and online.
-
- Returns boolean;
-
- Declaration Printer_Ready: boolean;
-
- Uses CRT, DOS, MiscTTT;
-
- Remarks This function is most useful when you want to bullet proof a
- printer option and makes sure that the printer is connected
- and on-line before trying to send it data.
-
- Example
-
-
- USES CRT, DOS, MISCTTT;
- BEGIN
- IF PRINTER_READY THEN PRINTSCREEN;
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Print_Screen MiscTTT
-
-
-
- Purpose To emulate the Print Scrn key.
-
- Declaration PrintScreen
-
- Uses CRT, DOS, MiscTTT.
-
- Example
-
-
- USES CRT, DOS, MISCTTT
- BEGIN
- PRINTSCREEN;
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Reset_Printer MiscTTT
-
-
-
- Purpose To clear a printer's settings back to the default.
-
- Declaration Reset_Printer;
-
- Uses CRT, DOS, MiscTTT.
-
- See also Printer_Ready.
-
- Remarks This procedure uses a unique technique that will reset most
- of the PC printers on the market place today. It is
- recommended that this procedure be called prior to sending
- set-up strings to a printer.
-
- Example
-
-
- USES CRT, DOS, MISCTTT
- BEGIN
- RESET_PRINTER;
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Time MiscTTT
-
-
-
- Purpose To display the system time nicely formatted
-
- Returns String;
-
- Declaration Time:string;
-
- Uses CRT, DOS, MiscTTT;
-
- See also Date.
-
- Remarks The format of the returned string is hour:min:sec a.m. or
- hour:min:sec p.m.
-
- Example
-
-
- USES CRT, FASTTTT, DOS, MISCTTT;
- BEGIN
- CLRSCR;
- WRITECENTER(1,YELLOW,BLACK,TIME);
- END.
-
-
- The time would be written at the top center of the screen.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-