|
INTRODUCTION REFERENCE
TK-ASCII |
You may want to run the TOOLKIT I Sampler program to provide a summary of the various tools' capabilities. To do this...
DO ^TKSAIf this is the first time PG&A software has been run on your system, the Sampler will first take you through a short initialization before beginning its demonstration. See Appendix A for more information on the initialization process.
Although the MUMPS community has been slow in providing a portable solution to advanced terminal handling, Patterson, Gray and Associates has been addressing these issues since 1979. The tools included in TOOLKIT I, like each member of the Toolkit line, are based on an effective methodology for providing advanced terminal features while separating application software from its environment.
The tools provided for you are:
TKASCII This lists the ASCII reference table with a simple Xecute statement that will not interfere with program development. TKMENU A full screen menu system with cursor key support, multi-level menus and security options. TKNOTE A pop-up notepad with word processing functionality in a small format for quick notes. TKPAINT A method for programmers to create and edit screen text and line drawings for inclusion into application software. TKPC A pop-up calculator that enables quick calculations while at the terminal. TKPOP A pop-up menu generator that is a quick means for creating menus or messages to be displayed on the terminal.
There are also Read Utilities that are callable subroutines which enable field oriented user input. These utilities all perform functions like screening input for invalid entries, preventing input from exceeding a defined length, allowing the user to define the terminating characters, and many more; yet each utility is designed to perform a specific function.
We hope your experience with the PG&A programming tools will be as enjoyable and profitable as ours.
TKRDF Read Field - field oriented input, as general or specific as you like TKRDL Long Field - displays a short field while allowing horizontal scrolling TKRDD Date - allows input like mm/dd/yy or T-2 (Today's date minus 2 days) TKRDT Time - allows input like hh:mm:ss or T+15 (Time right now plus 15 minutes) TKRDP Password - allows input of a password without displaying the input
| TK-ASCII
ASCII Reference Table |
| Description | TK-ASCII is a global-based ASCII reference table for programmers. Because it is executed from a global, it may be used during program development without interference (some operating systems erase temporary routines if they are not written to disk first). It may also be called by other software. |
| Routines | ^TKASCII |
| Globals | ^TKASCII |
| Preparation | The ^TKASCII global is initialized by ^TKSA during the TOOLKIT I Sampler initialization or it may be initialized directly using the following MUMPS code: DO SETUP^TKASCII |
| Use | To display a copy of the ASCII table enter... X ^TKASCII...from direct mode or from within your application. Press the "RETURN" key to resume normal operations when finished with the table. |
| TK-MENU
General Purpose Menu System |
| Description | TK-MENU provides a full screen menu system with cursor key support, multi-level menus and security options. Menu headings, selections and selection methods can all be customized to individual needs. |
| Routines | Menu Editor: ^TKMENUE, ^TKMENUE1, ^TKMENUE2 Menu Driver: ^TKMENU, ^TKMENU1 |
| Globals | ^TKMENU |
| Preparation | Preparation of the system for TK-MENU is limited to the building of the menu control global ^TKMENU with the menu editor ^TKMENUE. Once the control global has been constructed, the menu system can be invoked with the following code: DO ^TKMENUIn many MUMPS systems, the menu is tied to system security programs, or to a terminal through an operating system utility. Because TK-MENU uses the local variable ZID to track its position in the menu hierarchy, it is recommended that software be modified to preserve it. Should it be killed, TK-MENU will begin again at the top of the hierarchy. |
| Use | The system comes with the top hierarchy already defined. You cannot create another of this level but can edit the menu provided and add to it. Invoke the menu editor by entering... D ^TKMENUEOnce in the editor, a menu of options is presented. Each of the selections is discussed below. |
| Edit Menu Items | This option enables the
definition of the sitespecific menu system, one screen at a time.
Begin by selecting the screen to be edited from the list presented. Please note that the list presented shows all screens that have a lower hierarchy. Since each menu screen may have as many as nine columns of items from which to select, it is necessary to select the column to be edited as well. This is also where you add more columns if you wish to do so. For example if you select column 2 the next screen will allow item numbers from 200 through 299 only. Once the screen has been selected, select the item number to be edited, or enter a new item number to create a new entry.
NOTE: The item number accomplishes three things: it reflects the column in which the item is to appear (e.g., item 290 is in column 2, etc.); establishes the order in which the items will be displayed by the TK-MENU Driver; and of course, it is used by the TK-MENU Editor to enable selection of the item to be edited. When adding or modifying a menu item, the following fields will be edited: Item Code. The item code is a short, one, two or three character code the user can type to make a selection. In many cases, the first character of the item title is used. Item Description. This is the item description which will be displayed by the TK-MENU Driver. Item Routine. Enter the linetag, if any, and the name of the MUMPS routine to which the TK-MENU Driver is to branch (e.g., TAG^PGM or just ^PGM). Since TK-MENU can Xecute global based code as well, the routine can be the starting node of a global containing MUMPS code (e.g., ^TKASCII - be sure to turn the Xecute flag on). If the item represents a lower level menu, enter 'NX' as the routine; in this case the DO or Xecute Flag should be left blank, as a GOTO is appropriate. When an item is defined this way, it automatically appears in the list of available menus which can be edited. If the item is to be displayed, but remain unselectable, enter 'NA', as in Not Available. Item Password. Each item can be assigned its own password of up to ten characters in length. When a password has been defined, TK-MENU will request it from the user without echoing the response. Remember that TK-MENU honors upper and lower case. A password defined in upper case will not be accepted unless it is also entered in upper case. Do or Xecute Flag. Indicate here how TK-MENU should pass control to the routine defined above. MUMPS programs can be initiated with a DO or a GOTO. (The default is GOTO). Enter a 'D' is the DO option is desired. However, remember that if GOTO is selected, it is the responsibility of that program to return to TK-MENU when finished. As mentioned earlier, global based code can be executed from TK-MENU. If that is desired, and the routine name entered is that of global based code, then enter 'X' for Xecute. TK. Respond Y or N. This tells the system to save any TK variables. Select Y if the routine selected is a TK function. |
| Deleting Menu Items | When it becomes necessary to delete an item, remove the contents of each field associated with the item. The TK-MENU Editor will remove the item when finished. |
| Define Menu Title | The title entered here is used when TK-MENU displays the first menu, that is, the menu at the top of the hierarchy. It may be up to thirty characters in length. Titles for lower level menus are derived by TK-MENU. |
| Programmer's Access Code | The programmer's access code is a password which is entered after a "CTRL""P" to access direct mode. Since the manner in which direct mode is achieved varies among operating systems, it is necessary to put the system specific MUMPS code in line LCL of routine ^TKMENU1. NOTE: some operating systems do not permit mode changes at a tied terminal. |
| Logo Edit | The logo is a fifteen character field that appears in the top left corner of each menu. It is an ideal place for company or product names. |
| User's MUMPS Code | This field provides the ability to establish initialization code which is eXecuted when TK-MENU is first started. It can be used to download function keys, set video attributes, log the date and time, etc. If there is no need for it, leave it blank. |
| Using TK-MENU Driver |
The TK-MENU Driver features two selection methods:
Pointing. The Item Pointer which highlights the current item in a menu can be moved up and down using the cursor keys. In addition, the Space Bar can also be used -- it moves the pointer down to the next item. When the pointer reaches the desired item, press "RETURN" to make a selection. Code. By entering the code displayed to the left of each item, the pointer can be moved directly to the desired item. If the characters entered cannot be found, a warning bell will be issued and the pointer will not move. When two or more item codes begin with the same letter, additional letters may be required. Branching to the selected item can be immediate if Carriage Return was not made manditory in the Toolkit initialization routine, ^TKINIT. Otherwise, the "RETURN" will need to be pressed. |
| TK-NOTE
Pop-Up Note Pad |
| Description | TK-NOTE is a pop-up notepad which can be used to record and display messages by users. The notes are tied to a particular ID code so that each user will only see the notes entered on the same terminal. Each note is time and date stamped when created and can be easily flipped forward or backward through the notes showing the first screen of each note at a time. TK-NOTE is global resident MUMPS code and will not displace the current routine in the partition and can be used even while entering and editing MUMPS programs. |
| Routines | ^TKNOTE, ^TKNOTE1, ^TKNOTE2, ^TKNOTE3, ^TKNOTE4 |
| Globals | ^TKNOTE |
| Preparation | The Toolkit I Sampler will do the TK-NOTE global initialization, or you may execute: DO SETUP^TKNOTEOnce the global is initialized, you may call up the notepad by executing the following: X ^TKNOTEWhen TK-NOTE is first used at a new terminal location, the software will ask that you enter or modify device parameters for TK-NOTE. (Some terminal types are already defined in the software can be loaded for you automatically). See Appendix A for information concerning the use of these utilities. |
| Use | After the initialization of TK-NOTE, it can be started by typing X ^TKNOTEThis can be done from the direct mode or from an application program. (TK-NOTE uses only local variables starting with TK). You will first be asked to enter an identifier. This is an ID code from 1 to 15 characters which may be your name, department code, or whatever identifier you wish. All notes are segregated by identifier, so if you want private notes, use a private identifier, if you want to create and display public notes, use an identifier that is shared among others. You will then be shown a notepad with six options listed across the bottom: Create Edit Delete Next Prev QuitYou will also see displayed the last note that you entered into the notepad. You may flip through the notes that you have entered by using the PREV or NEXT options. Just press "P" or "N" or move the cursor to the option with the cursor and press RETURN. Each note will have the description and time and date of creation on the top line. TK-NOTE will display a blank notepad when you reach the end of the notes. To create a new note, select the CREATE option. It will ask you for a short description, and then display it with the current time and date on the top line. You then will be allowed to type whatever you wish (for as long as you wish). When the end of notepad is reached, TK-NOTE will display a new page for you. A message at the bottom of the notepad will tell you what key is defined as you HELP function. By pressing this you will see what other functions are available to you for editing your note. When you are done with the note, press the EXIT EDIT MODE function key (also listed on the HELP screen) to return you to the TK-NOTE options. Use the EDIT option to edit an already existing note. Use the QUIT option to exit TKNOTE altogether. |
| TK-PAINT
Screen Painting Utility |
| Description | TK-PAINT provides a convenient method for programmers to create and edit screen text and line drawings for inclusion into application software. Each screen is compiled into the ASCII sequences required for each CRT type identified at the user's site. This compact data then can be quickly painted on the screen with a single line of MUMPS code. |
| Routines | ^TKPAINT, ^TKPNT1, ^TKPNT2, ^TKPNT3, ^TKPNT4, ^TKPNT6, ^TKPAINT |
| Globals | ^TKPAINT |
| Preparation | None. |
| Use | To get into the TK-PAINT menus enter: DO ^TKPAINTThe two main options that you will use in TK-PAINT are Edit Existing Drawings and Build New Drawing. You are also given a HELP option, a Copy and Delete for copying and deleting existing drawings, a Recompile All, and an Output and Input Drawing to and from Global which are discussed later. |
| Creating a Drawing | Select the Build New Drawing option. When creating a new drawing, you will be given the opportunity to enter a short name and description. You will then be asked if you would like an 80 or 132 column screen. (The 132 column screen may not work on the PC monitor.) A blank screen will then be provided with the screen name and video mode displayed on line 24. |
| Moving The Cursor | Text and drawings may be entered anywhere on the 24 X 80 (or 132) screen. Cursor movement is directed using the cursor keys. The "RETURN" key moves the cursor to the left edge of the screen on the same line. Notice that the current row and column position is displayed on line 24. Remember when using the "SPACE" to move the cursor that it will erase any text or graphics on the screen at that point. |
| Video Modes |
The screen is first initialized to the TEXT mode in
normal video, high intensity. Everything you type on the screen will be
displayed, stored and redisplayed in that mode. You may change the video
mode at any time by pressing "CTRL""V". Your cursor will jump to the
bottom line and you will be asked to enter a "R", "H", or "U" for Reverse
Video, High Intensity, and Underline.
Simply press "RETURN" for none of these and change the video mode to normal video, low intensity. Or you may enter one or more of these letters to switch on the corresponding video characteristic. Every character typed on the screen after switching the video mode will be displayed in the new mode. Modes can be changed as often as you like. |
| Line Drawing |
As mentioned earlier, the screen starts up in TEXT
mode. This can easily be changed to LINE mode by pressing "TAB". With the
exception of the cursor keys, the keyboard works exactly the same as TEXT
mode. Rather than just moving the cursor, the cursor keys will draw lines
on the screen as a trail of where the cursor has moved. You can return to
TEXT mode by pressing "TAB".
Lines can be removed by spacing through them. To erase contiguous lines, place the cursor on the line to be erased and press Control E, for Erase. You would use this to erase a box or circle or a long line. Please understand that this will erase all lines touching that line. |
| Compiling The Drawing |
When the screen is completed, press "CTRL""R" or
"CTRL""X" to terminate the edit session and compile
the drawing. You have the option to pick one of three types (1-Overlay,
2-Refresh (with clear line), 3-Refresh (without clear line)). During
compilation, each CRT type for which the screen is being compiled will be
displayed.
When finished, TK-PAINT returns to direct mode and provides a local variable, called 'A', which can be used to paint the drawing on the screen in your application program. In some operating systems, the contents of 'A' can be inserted directly into your program. Refer to your system documentation for details. |
| Types of Compilation |
1-Overlay. If you are using TK-PAINT
for the first time, it is suggested that you compile your screen
using option 1. Option 2 and 3 are designed for advanced screen
manipulation. In this mode, line drawings and different video attributes
are drawn on the screen by graphic type, not row by row. It is the fastest
way to display your painted screen.
Note that TK-PAINT (Overlay) does not clear the screen before it paints the drawing on the screen. Your application is responsible for doing so before executing the display code. It is possible to write one screen over another to obtain a layered affect or other interesting video representations. The MUMPS code is (Characters in brackets vary from screen to screen - refer to code displayed after compilation of screen for specifics): I $D(^TKPAINT("[NAME]",0,^TK($I),1))2-Refresh (with clear line). If you compile your screen using option 2, line drawings and different video attributes are drawn on the screen row by row. For this reason, you may display any portion of your screen. Observe the following code (Characters in brackets vary from screen to screen refer to code displayed after compilation of screen for specifics): I $O(^TKPAINT("[NAME]",0,^TK($I),0))Notice that this screen is painted using a FOR loop where I is the row number. For example, you may change it to be: I $O(^TKPAINT("[NAME]",0,^TK($I),0))..where only the first twelve lines are painted. This option is called "Full Screen" or "Full Windowing On" because it first clears the entire row before painting that row. Option 2 is particularly useful when a refresh screen is the desired effect, such as after using Option 1 or 3 to create a layered screen effect or after using TK-POP. 3-Refresh(without clear line). This option displays the painted screen row by row much like Option 2. You therefore have the flexibility to display only a portion of that screen. However, it is called "Partial" or "Partial Windowing On" because Option 3 does not clear the row before painting the row. Hence, Option 3 combines attributes found in Option 1 and 2. For the appropriate MUMPS code, refer to Option 2 in the manual or code displayed after compilation of screen. |
| Recompile All | This option is used if you ever have a need to recompile all your ^TKPAINT screens. You may need to do this if a new CRT type is added to the user's site or if a new release requires this to be done. |
| Transporting Drawings |
The Output Drawings to Global and Input Drawings
from Global are two functions that are used to move
your drawing to and from another MUMPS global. All the control characters
are removed to make it easier to transport to another computer.
When you select Output Drawings to Global the computer will display a screen from which you may select any number of ^TKPAINT screens. Use the "SELECT" key and then "RETURN" when all have been selected. You will then be asked to enter the MUMPS global to which these are to be stored. When you select Input Drawings from Global you will be asked to enter the MUMPS global where the drawings are stored. |
| TK-PC
Pop-Up Calculator |
| Description | The TK-PC pop-up calculator provides the programmer or end user with a quick means of performing simple calculations while at the terminal. The calculator functions like the ordinary hand held varieties and therefore requires little training. The result of the calculation may be passed back to the application software through the variable 'TKA'. |
| Routines | ^TKPC, ^TKPC1, ^TKPC2 |
| Globals | ^TKPC |
| Preparation | TK-PC is executed from global resident code and must be first transferred from routine to global by executing the code: DO SETUP^TKPC |
| Use | To use the pop-up calculator, issue the following MUMPS code either from the direct mode or an application program: X ^TKPCA small calculator will be drawn on the screen and your cursor will be positioned in the makebelieve display. Press the ? key to get a listing of helps on how to enter the calculations. Using the Mode command (press M), you may optionally turn on the display mode which will list each of your entries on the screen as you enter them. Press E to exit the calculator and return to the direct mode or your application program. The TK-PC routine uses local variables starting with the letters 'TK'. Besides the TK array (which is the general toolkit control array) it will leave the variable 'TKA' defined upon exit. This variable contains the result of the last calculation and may be used by the application program. |