DB_PRG VER 2.0 by Tim Dickey ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ There are three reasons I have written this program. #1 I have a bad memory for details. In spite of the fact that I have been writing Clipper programs for years I still find it very hard to remember the exact syntax for many commands and functions. This causes no end of manual searching and grumbling on my part. Hence the idea of making a MACRO which contained the syntax of the command so you could sort of "fill in the blanks" as it were. This problem becomes particularly acute as my list of library functions grows. Second (and most embarrassing) I am a very bad speller and I frequently cannot remember whether it is 'APPEND' or 'APEND'(if you get my dripht). Third I am just plain tired of entering fifteen case statements and forgetting that I didn't put an endcase at the end because I have been messing around up at #4..(way out of my field of view down somewhere there should be and ENDCASE.) This also applies to FOR NEXT LOOPS ,IF ELSE THEN, and DO WHILE ENDDO Statements. So I wrote this little word processor program which allows me to Key a whole DO CASE.....CASE.....ENDCASE at once and then fill in the blanks. From this simple idea grew this program. Along the way I added many other features most of which are subsets of my bad memory problem...ie a pop up list of variables that I don't have to run to the front of the program to check the spelling on. Context sensitive ASSIST to remind me of what the is referring to...Library of procedures and so on. I have been told that this program is very useful to those who are just beginning to learn Clipper and DBASE III programing language but that other editors are faster once you get the basics of the language under your belt. Yep...that is true. I still use XYwrite to do search and replace ...haven't been able to figure out how to code that in a 'user' function for memoedit() yet... but perhaps in the next release. (or the one after ) BUT for jamming together the outline of a program I will put this little editor up against any of them. I hope that you enjoy using my little program and that it will make your life a little easier. It has mine. ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ NEW WITH THIS RELEASE ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ BLOCK COMMANDS F8 First you must Mark a Block beginning and End using ALT+M then pressing F8 will copy the marked text to the CLIPBOARD (not to be confused with KLIPBOARD). After the text has been copied to CLIPBOARD you may paste it using ALT+P. Note that the text will overwrite existing text unless INSERT is active. ALT+F8 First you must Mark a Block beginning and End using ALT+M then pressing ALT+F8 will bring up an input window which asks you what you wish to name the file. A DOS file will be created and the marked block will be copied to it. See the WARNING later in the text about semi-colons. It also applies to the block paste function. I changed the internal workings of the HELP system. It was just too prone to error and I hated having to keep track of the Help DBF. So if you have an earlier version delete the help dbf. The new Help file is HLP.PRG which is a standard ascii text file. You can print this out if you would like for reference. This saved me about 4 K of available memory which was quickly used up by the addition of the next item. Added a PRINT command to the main menu. I am not in love with this but it is the best I could come up with. The problem is that it breaks the code arbitrarily at line 55 for pagination....that leads to breaks in the flow of code which make it hard to read. Also any line over 78 Characters wide will wrap to the next line without notice. But you asked for it so it is there. [HISTORY] ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ NEW WITH VERSION 1.3 ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ F9 KEYBOARD CHR() ENTRY. This handy little procedure takes a keypress and translates it into the form CHR(NNN). Thus after pressing F9 pressing the ESCAPE key will produce CHR(27). Pressing RIGHT ARROW will produce CHR(4). If you hold the Alt key down and enter numbers from the keypad the numbers will collect until you release the Alt key. Thus holding the Alt key down and pressing 1 7 7 will produce CHR(177). There is a partial listing of Characters available from the Assist (F7) after you enter a CHR() using F9. By the way doing (ALT-NNN) without pressing F9 will produce the character itself which happens to be "±" [CHR(177)]; [in case you did not know that about MEMOEDIT()]. For those of you who would like to you can now enter a file name as a parameter when you run DBPRG and it will autostep through the menu sequence to load the program you wish to edit. It is not necessary to type the extension...though you can if you wish. This also works with DBASE III command edit. Now you can enter the name of the procedure from dot prompt [MODIFY COMMAND ] and the editor will step through the opening screens to your file if it exists. Remember that you have to MAKE PROGRAM in order for DBASE III to have access to it....or to compile it with Clipper when it comes to that. Relocated KLIPBOARD PASTE to ALT-F6 because it seems to belong on the same F-Key as IMPORT (F6). Added VARIABLE DELETE CTRL-F5 which pops up the variable list from which you can then select a variable to delete. The Variable number at the top of the screen is adjusted to reflect the change. ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ NEW WITH VERSION 1.02 ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ Moved PROCEDURE and UDF Filter Macros to ALT-F2 and ALT-F3. It seemed more logical that they should be shifted functions of COMMAND and FUNCTION since they employ the same data bases. ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ NEW WITH VERSION 1.01 ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ Added a "Klipboard" which allows you to paste the contents of one program into another without having to copy it to COMMAND or FUNCTION databases. To operate choose KLIPBOARD from the main menu and select the program or procedure you wish to COPY to the Klipboard. Then when inside the editor choose ALT-F6 to paste it into the current program. Added a new procedure which filters for User added procedures and User Defined Functions in the COMMAND and FUNCTION databases. This is just so you can find your own added code more easily. The procedures are on Alt-F2 and the UDF's are on ALT-F3. DBASE III+ PROGRAMING- I discover that it is possible to use DBPRG from within DBASE III+ plus as a Command Editor...IF...you have lots of memory and IF you keep your programs down to small size. DBASE III+ loads itself into conventional memory...taking about 288K; DBPRG loads in at 290K leaving as much as 60K conventional memory. If you have Expanded memory DBPRG will use that for many of it's functions. If you run out of memory DOS will tell you. I have no fix for this so don't ask. (On my computer starting out with 2 megs of memory and 621 K of available conventional memory...after I load DBIII+ and call DBPRG as the command editor I wind up with 36 K available for program editing. This translates to about 500 lines of program on my machine.) To use this idea set your config.db file 'tedit' to tedit=dbprg then when you use the MODIFY COMMAND in DBASE III+ DBPRG will run and present your program for editing ,if it has already been created, or leave you at the main menu if it has not. A better way to use the power of DBPRG from within DBASE III+ is to get a copy of MODCOM from the same author as DBPRG. MODCOM is a slightly altered version of the same program which has been cut back for memory. It will allow twice as large a program file as DBPRG when called from DBASEIII. It's COMMAND and FUNCTION databases are limited to just those Functions and Commands which are usable with DBASEIII+. ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ INSTALLATION ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ The Zip should contain the following files. COMAND.DBF & COMMAND DBT The command Database FUNCT.DBF & FUNCTION.DBT The Function Database PRG.DBF & PRG.DBT The Procedure Database DBPRG.EXE The executable file for this program DEMO.TXT This file HLP.PRG Help Text file To install you must first create a directory off the root called DBPRG which you should place in your Path Statement. This will allow you to create procedure files (.PRG) anywhere on your disk. The EXPORT PRG and IMPORT .PRG functions write to/from the CURRENT DIRECTORY but DBPRG looks for its data in \DBPRG. Place DBPRG.ZIP in the \DBPRG directory and unzip it there. The program creates it's own indexes. ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ NOTES ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ The word processing commands for this program follow the standard for MEMOEDIT() in Clipper Library. I am looking for a better word processor but have not had much luck. In order to insert a CLIPPER or DBase command or function all you need to do is place the cursor where you want the command to appear and hit F2 (COMMAND) or F3 (FUNCTION) a list of commands will pop up allowing you to choose. The menu follows the first letter locate protocol. When you have found the command you wish hit ENTER and the command together with its syntax options will be keyboarded into the PRG. You then simply replace the syntax options as needed with either Variables or Numbers as required by the situation. For help with the syntax use F7 (ASSIST) which will pop up an associated help screen for that command or function. That assist screen remains available until you select another COMMAND or FUNCTION. When choosing a variable use F4 and the Variable you select will be added to a list associated with the program you are working on. (Limit 100 variables of 15 characters each). From then on you may insert it into the program by using F5. Whenever you re-edit the program the variable list is reloaded along with it so it is always available. This is also a handy place to put your procedure names (another thing which gives me fits is remembering procedure names). ALT-F5 pops up the variable list but does not keyboard it into the program. CTRL-F5 pops up the variable list from which you can then select a variable to DELETE. The Variable number at the top of the screen is adjusted to reflect the change. ALT-F6 may be used to paste the contents of the "Klipboard" to the current program. You must first have loaded the "Klipboard" from the Main Menu for this to operate. F6 is used to import any file with the extension ".PRG" You may want to keep several versions of each PRG going; importing and changing as you go. The EXPORT function is only available from the MAIN MENU. I haven't come up with a successful way to RE-IMPORT a PRG into the same file easily. You can do it but it involves using CTRL-Y to delete all the lines of the program and then using F6 To RE-IMPORT. (Be careful with this procedure see SEMI COLON GLITCH later in this document). F7 Only operates AFTER you have entered a COMMAND,FUNCTION,PROCEDURE or UDF using F2, F3, ALT+F2, or ALT+F3 F8 First you must Mark a Block beginning and End using ALT+M then pressing F8 will copy the marked text to the CLIPBOARD (not to be confused with KLIPBOARD). After the text has been copied to CLIPBOARD you may paste it using ALT+P. Note that the text will overwrite existing text unless INSERT is active. ALT+F8 First you must Mark a Block beginning and End using ALT+M then pressing ALT+F8 will bring up an input window which asks you what you wish to name the file. The Marked Block will then be copied to that DOS file. F9 KEYBOARD CHR() ENTRY. This handy little procedure takes a keypress and translates it into the form CHR(NNN). Thus after pressing F9 pressing the ESCAPE key will produce CHR(27). Pressing RIGHT ARROW will produce CHR(4). If you hold the Alt key down and enter numbers from the keypad the numbers will collect until you release the Alt key. Thus holding the Alt key down and pressing 1 7 7 will produce CHR(177). There is a partial listing of Characters available from the Assist (F7) after you enter a CHR() using F9. By the way doing (ALT-NNN) without pressing F9 will produce the character itself which happens to be "±" [CHR(177)]; [in case you did not know that about MEMOEDIT()]. I would suggest writing your programs in small procedures which can then be called from a master program. This allows you to begin to form a library of routines which can be interchanged with other programs. ALT-F2 filters the COMMAND database for just those procedures which you have added to it. ALT-F3 sets the same filter on the FUNCTION database F10 Exits the editor and saves the contents to the database. ESCAPE exits the program without saving if the contents have not been altered. If they have a "Y,N,S" option is presented (Y=ABANDON N=CONTINUE S=SAVE AND EXIT). ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝFUNCTION KEY LAYOUTΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ KEY FUNCTION ALT-FUNCTION CTRL-FUNCTION ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ F1= Help F2= Pick command Pick user procedure F3= Pick function Pick user defined function F4= Enter variable F5= Pick variable from list View variable list Delete variable F6= Import program from dos Paste from KLIPBOARD F7= Command & Function assist F8= Copy Marked Block to Mem Copy Marked Block to File F9= Create 'CHR()' From keystroke F10= SAVE & EXIT 'S' Save / Continue 'M' Mark block 'P' Paste Block ON THE MAIN MENU ADD PRG appends a record to the database and puts you in edit mode. EDIT PRG presents a choice window of programs in the database and then puts you into edit mode. DELETE PRG brings up a TAG utility which allows you to Tag those programs you wish to delete. MAKE .PRG allows you to export a program from the database to a .PRG text file for later compiling or use in Dbase. COMMAND lets you EXPORT a program from the program database to the COMMAND database for later retrieval. FUNCTION does the same as COMMAND except the contents are saved to the FUNCTION database. KLIPBOARD allows you to copy the contents of a program into a "Klipboard" which can then be PASTED into another program using ALT-F6 within the editor. PRINT allows you to select a program from the database to print. If you don't have a printer on line it will allow you to dump the program to a print file. ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ Disclaimer ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ Tim Dickey distributes this program solely on an "as is" basis and offers no warranties at all. Tim Dickey shall not bear any liability or responsibility to any user or entity with respect to any liability, loss or damage caused, or alleged to be caused directly, or indirectly by this program, including but not limited to interruption of services, loss of business or anticipatory profits or consequential damages resulting from the use or operation of any of the functions contained in this product. Tim Dickey makes no warranties, either expressed or implied regarding this software product, it's merchantability and/or it's fitness for a particular purpose. The user agrees that Tim Dickey shall not be held liable for any consequential damages, even if Tim Dickey has been advised of the possibility of such damages. ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ Shareware ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ DB_PRG is being distributed under the shareware concept. You are granted the right to use this program for a trial period of thirty (30) days, at which time you must either stop using the program, or pay the registration fee of US $30. (subject to change) I will handle the postage in the USA. You may send in your registration fee to: Tim Dickey 6951 Homer St. #14 Westminster CA 92683 (714)891-2759 Registered Owners will receive the other part of the system which allows updating of the Command and Function databases and the associated help screens. PLEASE NOTE that there are many functions contained in the Function Database which are NEITHER Dbase nor Clipper Functions. Some are from the Soft Clip Library by SoftSystems and some are from the Super Library from Functional Software. In order to use these functions you must purchase these libraries and link them to your program. These are contained in the data base because I use them extensively. As a matter of fact I used them to write this program...so I highly recommend them. SEMI-COLON glitch...due to a quirk in CLIPPER '87 any attempt to IMPORT a PRG which contains a ";" directly into the editor will result in the ";" being replaced by a linefeed. This means that until I find a fix the ";" line wrap is not a good idea to use in your procedures. EXAMPLE: 'placing a long line of text into the program by'+; 'using a ";" will result in the line looking like the following' 'placing a long line of text into the program by'+ 'using a ";" will result in the line looking like the following' .........and CRASHING when you try to compile it. The text field is 120 characters wide so you need not wrap the lines in this way. Oddly this problem does not occur when transferring a procedure to the COMMAND or FUNCTION database but only when the input is run through the keyboard buffer. A WORD ABOUT INDENTATION Many programers like to indent loops,case statements, and IF THEN Structures in order to make them more readable. There is no way that I can judge ahead of time at what level the structure of a command should commence in your program. Thus all indentation in the Command structure is single level. I would suggest that you get a program called SNAP from your local BB. Snap will automatically indent your program for you. DB_PRG is primarily a Clipper Utility. Dbase III and Dbase IV ..etc are not completely covered in the command and function databases. You may wish to add extra commands and functions which will reflect these programs or to completely rework the Command and Function databases if these are your primary area of interest or purchase a copy of MODCOM which, although basically the same as DBPRG has only DBASE III+ commands and functions and is optimized for use as a replacement for the COMMAND editor within DBASE III+. ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ Trademarks ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ Clipper is a Trademark of Computer Associates. Super Function is a trademark of Functional Software Soft Clip is a trademark of Soft Systems DBASE III and DBASE IV are trademarks of Borland SNAP is a trademark of Walter J. Kennamer All references in this documentation to trademarks, copyrights, registered names or the like are intended only as a reference and do not contain any inference.