[_ A B Y SCRNLINE C …FA  M E N U P R O G R A M ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß DYNAMENU - The Program Organizer & Presentation Menu Overview The DYNAMENU program is a powerful organizer of dBase and DOS programs. It has the ability to control 1680 complex program calls (hereafter referred to as cells) and each call can be 100 characters in length and may contain concatenated (subsequent) calls such as may be found in a batch file. See Creating Program Calls below for more information. DYNAMENU runs under the control of dBase IV from either the dot prompt or via the dBase RUNTIME program. When using RUNTIME, additional memory is made available - this shouldn't be a concern since even the most complex of applications have been successfully executed with DYNAMENU from the dot prompt. The system has the ability to control colors of screens throughout any application and a utility has been incorporated to allow the user to visually select colors. See Setting System Colors under Keyboard Controls below. Keyboard Controls - Navigating the Menu The keyboard controls used to navigate the DYNAMENU screen have been designed with the current direction of most popular software products in mind. A help screen is available from any cell position in the menu by simply pressing 'H' - the details of that screen are spelled out more clearly as follows: - Moving to the right or left (Main menu cells only) þ Keys F1 thru F8 Display columns 1 thru 8 respectively and display the associated program information. Note that only the abbreviated program information is displayed in the cell and the highlighted cell will have the display of the extended description displayed at the bottom of the screen. þ Keys -> & <- Display column to the right or the left one column. Pressing the SHIFT key in conjunction with these keys moves the displayed column to the right or the left two columns. þ Keys HOME & END Displays the most left or right column. þ Keys  &  Move the cursor up or down one cell within the displayed column. Pressing the SHIFT key in conjunction with these keys moves the cursor up or down two cells within the displayed column. þ Keys PGUP & PGDN Move the cursor to the top or bottom cell within the displayed column. - Exiting the Menu þ Keys ESCP & X The ESCAPE & X keys will cause DYNAMENU to exit to either the dot prompt or to DOS depending on if, respectively, dBase or RUNTIME are active. If DYNAMENU exits to the dot prompt, all memory variables are left as they were and the next execution of DYNAMENU will not be required to reinitialize. þ Key Q 'Q'uit on the other hand mean just that - QUIT to DOS. - Calling a program þ Key ENTER The ENTER key causes the underlying program information for the highlighted cell to be evaluated and acted upon. This means that if only one call is required, it will be executed and subsequently the screen will return to the current cell display. If more than one call is required, they are sequentially executed before returning to the current cell display. See Creating Program Calls below for more information. - File/Text Editing - Control Key Combinations The following control key combinations may be used throughout the system almost universally. This information will be found on various help screens in the system and serves to further ones understanding of how a user may interface with a PC in a dBase environment when editing input fields or full screen file edits. þ Keys -> OR <- The right and left arrow keys move the cursor one character to right and left respectively within a given field. þ Keys CTRL-> OR CTRL<- The CONTROL right and left arrow keys move the cursor one word to right and left respectively within a given field. þ Keys  &  The up and down arrow keys will move the cursor to the next field on the left or above and to the next field on the right or below respectively. In full file browse mode where more than one database record is displayed on the screen, these keys cause a positioning of the record pointer to one record above or below with the same column. þ Keys TAB/SHIFT When entering data into multiple fields or in a file edit mode the TAB key skips the cursor from the current field to the next field to the right or below. The SHIFT/TAB moves the cursor from the current field to the next field to the left or above. þ Keys CTRL-U When in file edit mode (using 'EDIT' or 'BROWSE'), the keys CTRL-U cause the current record at the cursor position to be changed to deleted status. Pressing those keys again reverses the process. Records in a file with a deleted status may or may not be visible depending on other variables under program control. For example, the dBase status variable DELETED can be 'ON' or 'OFF' - if it is 'ON', these records generally can not be viewed. Records in delete status are candidates for packing of the database, which means to recover the disk space being occupied by them and therefore make the file smaller. As you can see, deleting is a two step process - first 'DELETE' then 'PACK'. Program RANDPACK may be used to complete the packing process. There are times when it is prudent to deny certain kinds of access, such as deleting records. This may be the cause for this key combination to appear to have no effect. þ Keys CTRL-END Keys CTRL-END cause the conclusion of any read of any number of input fields and for program execution to continue to the next line. If in full screen, BROWSE or EDIT mode, control is returned to the calling program. þ Key ESCAPE The ESCAPE key is very similar to the CTRL-END keys in that control of program execution is passed to the next line of code in the calling program. Unlike CTRL-END though, any changes made to a field, or group of fields in full screen BROWSE or EDIT modes, will not be retained. þ Keys CTRL PGUP & CTRL PGDN Keys CONTROL PAGEUP & PAGEDOWN are generally used only in full screen BROWSE or EDIT mode. Use of these keys cause the record(s) at the beginning/end of the file respectively to be displayed. þ Keys PGUP & PGDN Keys PAGEUP & PAGEDOWN are generally used only in full screen BROWSE or EDIT mode. Use of these keys cause the record pointer to move one record up or down in the case of a full screen EDIT. In the case of a full screen BROWSE, the screen will be updated to represent the next group of records (up or down). The next group of records could be 20 or more or as few as one depending on how the BROWSE is being invoked (ie, with or without the window option and how large the window is). þ Keys HOME & END The HOME & END keys are useful for positioning the cursor to different parts of the screen - their meaning varies depending of whether a simple input of a variable is in progress or if a full screen EDIT is in progress. The response to these keys is different yet in full screen BROWSE mode. Each situation is handled as follows: þ Simple Variable Read HOME moves the cursor to the beginning of the field and END moves the cursor to the end of the field. þ Full Screen EDIT Mode HOME moves the cursor to the beginning of the field in which the cursor is positioned and END moves the cursor to the end of that field. þ Full Screen BROWSE Mode HOME moves the cursor to the beginning of the first field being displayed on the left and END moves the cursor to the beginning of the last field being displayed on the right. þ Key ENTER The ENTER key causes the cursor to be moved to the next variable being read on the right or below. If only one variable is being input, it has the same effect as keys CTRL-END, it concludes the read and retains any changes to the variable. In the case of a full screen EDIT or BROWSE mode, if the cursor is on the lower most or right most field, the cursor is positioned at the beginning of the first field on the next record. þ Key INSERT Pressing the INSERT key causes insert mode to be turned on or off - always the opposite of what it currently is. It works at any time there is an input variable being read and the results of pressing that key may be displayed with 'INS' on the status line or on the top line of the screen depending on how dBase variables STATUS and SCOREBOARD have been previously set. þ Key DELETE The DELETE key is used to remove the character at the current cursor position. Pressing this key also causes all text in the given field to the right of the cursor to be moved one position to the left. þ Key BACKSPACE The BACKSPACE key is used to remove the character one position to left of the current cursor position. Pressing this key also causes all text in the given field to the right of the cursor to be moved one position to the left. þ Keys CTRL-Y The CTRL-Y keys are used to remove all characters to the right of the current cursor position. þ Keys CTRL-T The CTRL-T keys are used to remove the remainder of a word to the right of the current cursor position. This will not include any characters to the left of the cursor no matter what the position of the cursor is within the word. A word is delimited by the next space to the right, or the next character to the right if the cursor is positioned on a space, or the end of the field, whichever comes first. Customizing the Menu Menu Changes - Creating/editing program calls þ Keys CTRL-F1 Provide access to the storage areas associated with the highlighted cell. This means that you may add, change or delete current cell information with this command. Once you have invoked this function you may simply type the information you need to store or you may edit what is already present. Note that the colors of the storage areas are changed and that any manipulation of existing data may be accomplished using standard keyboard input and the text edit functions described below. Pressing CTRL-END when you have finished making changes will cause the changes to be stored and will invoke the Column Header Change option. If you press ESCAPE, any changes will be abandoned. The Column Header Change option asks if you would like to change the column header - the default is 'N'o as you would not normally want to make changes to these fields once you have set them up for your application. - Changing the number of active items in a column þ Keys CTRL-F2 Change the number of active items to be displayed on screen when moving from one column to another. This can affect both main menu columns and extended menus. Reducing the number from, say 15 to 6, does not erase the associated information - it simply controls how much of the information for that column will be displayed. This can be advantageous when the performance level of a given PC is marginal - fewer cells will have to be displayed. - Setting system colors þ Keys CTRL-F3 Change the colors for either the input (user to PC) or output (PC to user) fields. The position of the cursor after selecting 'I' or 'O' will be for the default colors - those that the system is delivered with. Upon changing the colors of either the input or output fields and returning to the DYNAMENU presentation menu, the newly selected colors will be implemented across all programs utilizing the system public variable 'SVCOLOR' (more about this under Custom Programs below). This command is only available from the main menu and is not available from an extended menu entry. - Creating/Deleting/Recalling Extended Menu Entries þ Keys CTRL-F4 Allows the user to convert the highlighted cell to an extended menu entry. If the highlighted cell is currently an extended menu entry call, the option is to delete it. No data is lost during this process and therefore you may in effect move the complete extended menu by immediately placing the cursor on a blank cell in another column and pressing CTRL-F4 again. This will move all entries to that new cell location. Each time you delete an extended menu entry, a reference is stored for future recall. Use of this command will eventually begin to add 15 records to the file DYNAMENU.DBF when stored extended menu references have been exhausted. This command is only available from main menu cells and is not available from an extended menu entry. - Screen Saver þ Keys CTRL-F5 Allows the user to set the number of seconds to elapse before the screen is blanked - 1-999 seconds. Creating Custom Programs - The Heart of the System The DYNAMENU System is designed with the idea in mind that there is a need to combine ever changing groups of divergent applications into one cohesive, yet flexible presentation menu. The heart of this system is its ability to do just that - to take any number of user created programs and combine them in a seamless way so the user perceives order where there may not have been any. It does this in such a way as to allow one to create new programs (with programming) and to then insert them at any point (cell) in the menu, as required, without the need for programming. As you continue to create new programs, keep the following considerations in mind. Color Considerations The DYNAMENU System resets the color to the stored color combination (represented by the PUBLIC variable SVCOLOR) each time a menu controlled program concludes its execution and the main DYNAMENU is then presented. When creating custom programs with the need for special color enhancements, use the following syntax to reset the color attributes: SET COLOR TO &SVCOLOR There are four other public color variables which are derived from SVCOLOR that may be of some value: GETCOLOR is derived from the combination of colors selected for making input and can be used to accent output without the need to clear an input GET. ENHNCDCLR is bright white on black. HICOLOR is yellow on the background color of the selected normal output combination. FLASHCLR is blinking yellow on the background color of the selected normal output combination. All of these combinations are set by using the command CTRL-F3 from the DYNAMENU presentation screen described previously in this section. Using DYNAMENU Utilities UNIVERSAL FILE BROWSE PROGRAM - FILEBROW Program FILEBROW is designed to allow the use of of the dbase 'BROWSE' command while restricting the user from adding or deleting or changing records in a particular file. The specific use of this program (ie, program parameters) are discussed in DYNAHELP file PROGDIR.INF. You may select 'BROWSE HELP FILES' or 'BY PROGRAM NAME' from the main help MODE SELECTION MENU. UNIVERSAL MESSAGE/BOX PROGRAM - CLEARBOX Program CLEARBOX is designed to create a consistent method by which to send messages to the screen. Use of color and initialization of the variable 'ANS' should be completed prior to calling CLEARBOX. 'ANS' may be of any length or type, however, no verification of input is performed. It is assumed that the potential variances in the text and the length of the variable 'ANS' have been tested for use in this program. TYPEAHEAD is cleared on every call. There are ten parameters to be passed as discussed below. STLINE The first line at which to draw the box. STCOL The first column at which to draw the box. STOFFSET The number of columns to the right of STCOL at which STR1, STR2 & STR3 are displayed. ENDLINE The last line at which to draw the box. ENDCOL The last column at which to draw the box. RINGBELL .T. or .F. - If .T.rue, an audible will be sounded. GETINPUT .T. or .F. - If .T.rue, a 'GET' will be performed on the variable 'ANS' at the column furthest to the right depending on the length of 'ANS'. This occurs at the end of the last line of text to be displayed which depends on how many of the three strings have been passed. STR1 First string to display - required. STR2 Second string to display - optional (must have "",). STR3 Third string to display - optional (must have ""). RANDOM PACK PROGRAM - RANDPACK RANDPACK is a random pack program which will allow you to pack any database from any DYNAMENU cell or any other program. The strength of this program is the benefit of being able to call the dBase pack routine from a predefined cell on the menu - there are those times when it is convenient to pack a file from a menu without the need for creating an extensive packing application. Such an application will generally analyze a set of databases based upon dynamically developed criteria and then set out to pack the files as a set. This ability also makes the menu truly custom and yet dynamic (hence the name) and not just a cloned version of a standard menu such as may be found in programs developed with code generators. Also, there may be times when the use of this program will solve an unanticipated maintenance problem. Such problems can occur, especially when a user application is being executed from RUNTIME - at these times, it can be very convenient to instruct a user by telephone to add a specific line of information to a blank cell, thereby resolving the immediate problem. The underlying problem may be another matter entirely. The user is responsible for determining the parameters to be passed. The following information relates to those parameters. PACKFILE - Pass the directory\name of the database to pack - do not pass an extension name. MINDEXES - Pass the directory\name of an associated index file. If additional index files need to be passed, precede them with a comma. A production MDX file does not require a reference as the dBase pack feature automatically provides for its inclusion in the process. All referenced files must be resident. There is no provision for packing a database with an associated non-production MDX file from this program. NETWORK FILE/RECORD LOCKING EXAMPLES (LOCKERR) The source code provided in program LOCKERR.PRG is informational only and is not specifically called from the programs in this system. Program RANDPACK and others utilize their own forms of this code - it therefore should be reviewed for any value it may provide in the system you are developing. It is meant to be a guide to understanding the in's and out's of file/record use and locking. It would be advantageous to develop universal methods of using/locking files and records under the myriad of circumstances in a networked environment. Methods of insuring that all possible conditions have been checked and methods that will cause the systematic shutdown of an application are absolutely essential. Procedure RTRAP which can account for both previously locked records and files and has been used extensively in a networked environment, has proven itself over time. Follow the calls on the program and the subsequent call on the shutdown procedure SYSTERR. RTRAP does not, however, provide for the EXCLUSIVE use of a database - procedure EXCLLOCK provides an example of how to program an exclusive file lock. Default 'SET'tings - DYNAMENU resets the following system options: þ PROCEDURES are set to none. þ All screens are released and the MAIN screen is revived. þ ESCAPE is set off. þ All databases are closed. þ EXACT is set to OFF. þ The screen and cursor position are reset. þ CONFIRM is set to OFF (just prior to the next execution). Printer Installation & Selection The database PRTRSRCE (printer source) represents a significant number of printers for the IBM PC and compatibles realm. It may be used to install any number of printers on this system or may be incorporated to provide a means of creating a custom printer installation system - refer to the text in file SYSTEM.INF. The choice of printers should include one that is capable of reproducing the extended character set. When DYNAMENU is in its initialization process it executes the program PRTMENU. A window appears with any printers that have been added to file PRTROPTS.DBF. In order to select a printer, press the up and down arrow keys until the proper printer has been highlighted then press to select. The printer selected will be displayed on the information line toward the bottom of the screen. If this is the first time this program is being called, as it will happen when first calling it each time, it will set up the printer control variables as described in SYSTEM.INF. You must select a printer the first time by pressing . The menu will also appear at other times, however, you may press to avoide the selection process. In those cases, press only if you need to change printers If you reduce the number of installed printers to one, printer selection will never be required. When writing custom programs, it will be necessary to ask the user to select a printer at at times. Program PRTMENU is designed just for that purpose - simply call the program from your own module. If it is imperitive to know that a printer was selected and is on line, implement the following call on PRTMENU within your program: PRTSELTD = .T. MABORT=.F. DO PRTMENU IF PRTSELTD .AND. .NOT. MABORT ELSE RETURN ENDIF In a network environment a call (RUN) is made from program PSPOOLER to the NOVELL print spooler with the information for that printer. The parameters used in that call may need to be changed to fit the specifics of the environment. The source code for PSPOOLER and PRTMENU have been included with the system and may be modified to fit a custom need. Maintenance considerations - before returning to DYNAMENU, any custom program should do some housekeeping. Be sure to: þ set SCOREBOARD and STATUS to OFF. þ RELEASE all loaded modules (.BIN files). þ RELEASE any defined MENUS, POPUPS & SCREENS. þ RELEASE all variables defined PUBLIC - do not use the reference CLEAR ALL. It is not necessary to display the original screen as that is accomplished upon return to DYNAMENU. Creating Program Calls Creating a program call starts with pressing CTRL-F1 and then entering the required information as described in Keyboard Controls above. The addition of a new program should be initiated from an appropriate blank cell - set the cursor to that position before pressing CTRL-F1. Enter the Abbreviated and Extended program definitions and then follow the instructions below for the kind of program call you are trying to create. The program call may be up to 100 characters in length and that number may be increased by simply modifying the structure of the field PRGNAME in file DYNAMENU.DBF. Simple dBase Calls The most simple of calls are those on standard dBase .DBO programs which require no parameters. Simply enter the name of the program to be called (executed). Use of parameters are identical to the requirements of making a call from a program or from the dot prompt, or, in the case of a DOS program, making a call from the DOS command line. Simple DOS Calls DOS program calls can be just as simple - enter the name of the DOS program to be called just as you would from the DOS command line - include any necessary parameters. The only difference is that the first character in the field must be a '/' - this tells DYNAMENU to look to DOS and not to dBase for the execution of the program. Be aware that large DOS applications are not good candidates for use with this option without using a memory to disk swapper of some kind. Complex Calls It is sometimes necessary to execute a combination of programs in succession, such as one may do in a batch file. In order to utilize this capability from within one cell, place a semicolon (';') at the end of the preceding call. In other words, to call two simple dBase programs and then one DOS program you would enter: DBPROG1; DBPROG2; /DOSPROG Note the '/' preceding the 'DOSPROG'. This will cause DYNAMENU to execute each program, one after the other. The use of parameters are optional as described above. A Word About Messages In a dBase environment, messages can and will be displayed in a variety of ways and in any number of locations on the screen and there may be an audible or no sound at all in conjunction with these messages. In some cases, that depends largely on the severity of the condition encountered or the source of the message. By and large, this system has been created with the idea that messages requiring the users immediate attention will be displayed with an audible warning and normal messages will not receive the audible. An audible is also used at the conclusion of a longer running procedure, at times, to allow the user to concentrate on something else. This can not always be said of messages produced from dBase directly - those messages may be received without any audible warning depending on how the dBase option BELL is set. If BELL is 'ON' dBase will produce an audible. In either case, many dBase messages (especially those found in a box in the middle of the screen) usually mean that a critical error has been encountered. The 'CANCEL' option is the normally accepted response to these kinds of messages. If such a message should be encountered, it is recommended that the user always respond with 'CANCEL'. Upon canceling an application, dBase will display the hierarchy of events leading to the critical error message. It is recommended that the user press the key in order to prepare a permanent record of that event via the printer. If the application that was in use was an original and unchanged STARTECH SYSTEMS program, be sure to send a copy of that output to: STARTECH SYSTEMS Attn: Technical Support 12 Longview Court San Francisco, CA 94131 Be sure to include company name, your name, telephone number and the serial number of your system along with the date & time information of the programs listed in the hierarchy of events. For the most part, when you think a program is not working or has locked up your machine or when something isn't working as you think it should, check the screen for messages very carefully, especially the lower part of the screen. Network Considerations The DYNAMENU System has been created specifically for use on a Novell Local Area Network - no other networks are supported at this time. It can, however, be installed on either a stand alone computer or on a Novell network server drive - the differences between the two are very slight. If you installed the system on a network drive, be sure to copy file DYNAMENU.DBF to your directory \USERAREA\. Also, the system login script must contain the statement: SET USERNAME="%LOGIN_NAME" Although not necessary, you may also want to copy files '*.MEM', PERSNAME.* and CONFIG.DB. Subsequently, use the utility program CREAUSER to do this for other users on the system. CREAUSER copies all of these files for you. Since some systems have specific needs for the content of the implemented version of file CONFIG.DB you may want to modify this program or replace file CONFIG.DB with one that meets the requirements of both the DYNAMENU System and the custom application. In all cases there are three program cells that will require modification. The references to file 'PERSNAME' in the cells (in the PERSONAL NAMES extended menu) for 'BROWSE NAMES', 'EXPORT FRIENDS' and 'PACK FRIEND FILE' need to be changed to reflect the '\userarea\userid\persname' as appropriate. This will be true for every new network user that is added to the system. Copying file DYNAMENU.DBF from someone's userarea to the original install directory will cause that copy to serve as the base for future users menus. This is an acceptable way of keeping the model up to date since on a network this file is never actually used or modified. Program CREAUSER, is not intended for use on a stand alone machine and will not function thereon.