KEYPAD Programming Kit January 26, 1987 ====================== CONTENTS -------- . INTRODUCTION . INSTRUCTIONS, including LOGIN.COM patch . SYMBOLS.COM . KEYS.COM . LK201.KEYS . VT100.KEYS . DEFAULT.COM . DEFAULT.HELP . Other Keypads : GOLD, RED, BLUE, GREEN .COM .HELP .LOCK .UNLOCK . Defining new keys NEWKEY.COM DEF_DEFAULT.COM DEF_GOLD.COM DEF_RED.COM DEF_BLUE.COM . Program Development Cycle Commands EDTCMD.COM EDTINI.EDT ICOMCMD.COM BCOMCMD.COM ILINCMD.COM BLINCMD.COM LROCMD.COM . Other Useful Command Procedures . Directory Listing and Change Information Prepared by William R. Garland for DECUS. Users with VMS accounts at MUN can have this kit made available by request. MAIL requests to TROAKE::BILL. We are investigating ways of getting a network address. Meanwhile, users with PC's can have these files as ASCII text files on a 5.25" diskette. Send a formatted diskette and return mailer to : Wm. R. Garland, Manager Computer Services (Medicine) Health Sciences Centre St. John's, Nfld. A1B 3V6 KEYPAD Programming Kit January 26, 1987 ====================== INTRODUCTION The following is a precis of an article from the ------------ MUN Faculty of Medicine Computer Services Newsletter. Those of you who have been around long enough to remember line- oriented editors will remember the great improvement in personal productivity that occurred when keypad editting arrived. People used to the many DIGITAL operating systems (RSTS/E, RSX, RT-11, VMS, TOPS) will know about TECO. TECO, which stands for Text Editor and COrrector, is an editor extraordinaire, which allows one to write editting programs, that is, programs which operate on text files (such as manuscripts, programs, documentation, etc.). One of the fancier features of TECO is VTEDIT, for Video Terminal EDITor, which is a TECO program that made one's screen come alive by providing instant feedback about the content of one's file by always displaying an up-to-date, screen- sized window into the file, and which allowed single keystroke commands to perform editting functions (such as search and replace, cut and paste, advance or backup in the text by a specified entity such as paragraph, sentence, word). There were some technical problems with TECO on the older systems, especially in that it was a resource hog. TECO was, however, a 'freebee', written by dedicated hacks and provided to DECUS members. As such, it was an 'unsupported product'. There were some thirty-five or forty different versions of TECO over the years, and many survive today. Eventually, however, DIGITAL was forced to provide a 'supported' video editor, and they invented EDT, which did many of the things TECO did, although not all, but a few others as well. EDT became the standard text editor, and its most important feature was, again, keypad editting. EDT itself has now become old and is being replaced by TPU, the Text Processing Utility, which is the subject of another article. The point of all this is that the use of the keypad to provide single keystroke commands went a long way towards providing the individual programmer and other users with some of the power of the computer with which to perform editting tasks. The same phenomenon has occurred at the operating system level on VMS. One can now define keys to perform DCL (DIGITAL Command Language) commands, and, now that I am using these features, I wonder how I ever did things before. ..... This programming kit includes the command files and a small patch one must apply to one's LOGIN.COM file in order to do use the keypad effectively. Individuals will want to start with blank files and define keys for themselves as they go. Crucial to the process is the DEFINE/KEY command, which is well DECumented. You should already be beyond the novice stage to use these tools, however, because it is vitally important that you understand fully the steps in the program development cycle and the concepts of symbols and logical names used on VMS. Also, you should be able to invent many new tools of your own to add to the kit. Send me feedback, if you wish. KEYPAD Programming Kit January 26, 1987 ====================== INSTRUCTIONS 1. Create a directory wherein you will keep DCL Command Procedures. Mine is called [MED.BILL.SYS.CMD] on $DISK1, but use the logical name CMD to refer to this directory. 2. Create a directory (probably below CMD) wherin you will keep KEYPAD command and help files. Use the logical KPD for this. 3. Insert the following 2 DCL commands into your LOGIN.COM file, in the path followed during INTERACTIVE logins. $ define/key/nolog/terminate PF1 "sym" $ sym:=="@$disk1:[med.bill.sys.cmd]symbols.com" 4. Insert the files SYMBOLS.COM and EDTCMD.COM into the CMD directory, as well as any xxxCMD.COM files you wish to use. 5. Insert the remaining files into the KPD directory. These are all the keypads and related files. Included are DEFAULT, GOLD, RED, BLUE, and GREEN keypads, each of which has a .COM, .HELP, and DEF_kpd.COM. There are a few others, too, such as LOCK.kpd and UNLOCK.kpd. 6. When you log in, strike the PF1 key once. This will execute the SYMBOLS command procedure, which is used to define many useful DCL commands or other symbols. The advantage of using a symbols file is that one does not need have a cluttered and often-editted LOGIN.COM file and that one does not always need to define any or all symbols for each login. The last few commands in the SYMBOLS.COM file are : $ sym:==@cmd:symcmd.com $ key:==@kpd:keys.com $ define/key/nolog/terminate pf1 "key" These re-define the symbol SYM and the PF1 key. The symbol SYM now executes a command procedure to define new symbols. 7. Depress PF1 again. This time the KEYS.COM command procedure is executed. KEYS.COM will define two or three keys you will use, depending upon the keyboard you have, to define the other keypads, i.e. $ define/key/nolog/terminate DO "@kpd:lk201.keys" $ define/key/nolog/terminate PF3 "@kpd:VT100.keys" $ key:==@cmd:newkey.com The last command in redefines the symbol KEY to now mean "Define a new key", i.e. execute the command procedure (NEWKEY) to do this. 8. Depress the DO key if you are fortunate enough to have an LK201 keyboard, or PF3 if you are using a VT100 family terminal. If you are using a PC through a terminal emulator, F3 should work as PF3. I'm not sure about other things to do with emulators, though. KEYPAD Programming Kit January 26, 1987 ====================== COMMENT No doubt there are better ways of doing some of these things. You might not need different keypads for different keyboards, and the HELP files require the VT100 line drawing character set. However, you can have keys do what YOU want them to. There are terminal-independent SMG$ routines available to print the help messages and define the keys, for those resourceful enough to use them. SYMBOLS.COM Useful DCL commands and symbols $ ! SYMBOLS.COM - useful symbols and logicals for Keypad Programming Kit $ def cmd $DISK1:[med.bill.sys.cmd] $ def kpd $DISK1:[med.bill.sys.cmd.kpd] $ ! DCL Commands $ dmu:=="mcr dmu" $ c:==show symbol cur_edit $ top:==set def SYS$LOGIN $ doc:==set def [.doc] $ up:==set def [-] $ w*here:==sho def $ t*ime:==sho tim $ s:==sho users $ ba*tch:==submit/noprinter/notify $ ls:==dir/siz/date/prot/width=FILENAME=26 $ lsd:==dir/siz/date/prot *.dir ! List directories $ dfc:==diff &cur_edit ! What changes did I make? $ spc:==spell &cur_edit ! requires SPELL program (DECUS) $ ! $ ! DEFAULT File extension - use your favourite $ cur_ext:==.bas $ ! $ ! Command procedures - invent your own and assign keys to them $ com*pile:==@cmd:bcomcmd.com ! Batch compile $ icom*pile:==@cmd:icomcmd.com ! Immediate compile $ blin:==@cmd:blincmd.com ! Batch link $ ilin:==@cmd:ilincmd.com ! Immediate link $ ! lro:==@cmd:lrocmd.com ! LIBR/REPLACE/OBJECT $ ed*t:==@cmd:edtcmd.com ! EDT $ down:==@cmd:downcmd.com ! Move down $ ! $ ! set up keys to define keypad sets $ define/key/nolog/terminate pf1 "key" $ key:==@$DISK1:[med.bill.sys.cmd.kpd]keys.com $ ! $ ! finish up by re-defining symbol SYM - now means DEFINE NEW SYMBOL $ sym:==@cmd:symcmd.com KEYPAD Programming Kit January 26, 1987 ====================== KEYS.COM $ ! KEYS.COM - to define keys when first logging in $ set ter/inq/appl $ define/key /if_state=(DEFAULT) do "@kpd:lk201.keys"/terminate/nolog $ define/key /if_state=(DEFAULT) pf3 "@kpd:vt100.keys"/terminate/LOG $ define/key /if_state=(DEFAULT,BLUE) pf2 "show key/all"/terminate/nolog $ write sys$output "Use DO key if there, otherwise PF3 to set keypads." $ key:==@kpd:newkey.com LK201.KEYS $ ! Define useful keys from LK201 keyboard $ dfk:= define/key/if_state=(GOLD,RED,BLUE,GREEN,DEFAULT) $ dfk f17 t/terminate/nolog $ dfk f18 "show key/all"/terminate/nolog $ dfk f19 "key" /noterminate/nolog $ dfk f20 ed/terminate/nolog $ dfk do "rr"/terminate/LOG $ dfk e1 "sho def" /terminate/nolog $ dfk e2 "set def [-]" /terminate/nolog $ dfk e3 "down " /noterminate/nolog $ dfk e4 "top" /noterminate/nolog $ dfk e5 "set def [.doc]" /terminate/nolog $ dfk e6 "mai"/terminate/nolog $ @KPD:DEFAULT $ @KPD:GOLD $ @KPD:RED $ @KPD:BLUE $ @KPD:GREEN $ exit VT100.KEYS $ ! Define VT100 Keypads $ @KPD:DEFAULT $ @KPD:GOLD $ @KPD:RED $ @KPD:BLUE $ @KPD:GREEN $ write sys$output "Use BLUE keypad with VT100." $ exit KEYPAD Programming Kit January 26, 1987 ====================== DEFAULT.COM $ ! DEFAULT.COM- Default Keypad Keys $ dkn:=define /key /nolog /if_state=default $ dkn /NOterminate pf1 /set_state=gold "" $ dkn /NOterminate pf2 /set_state=red "" $ dkn /NOterminate pf3 /set_state=blue "" $ dkn /NOterminate pf4 /set_state=green "" $ dkn /terminate kp7 /erase "show sym cur_file" $ dkn /terminate kp8 /erase "show sym cur_ext" $ dkn /terminate kp9 /erase "show sym cur_edit" $ dkn /terminate minus "s" $ dkn /terminate kp4 /erase "inq cur_file" $ dkn /terminate kp5 /erase "inq cur_ext" $ dkn /terminate kp6 /erase "inq cur_edit" $ dkn /terminate comma /erase "mail" $ dkn /terminate kp1 /erase "ls" $ dkn /terminate kp2 /erase "lsd" $ dkn /terminate kp3 /erase "ls *'cur_ext" $ dkn /terminate kp0 /erase "set def kpd:" $ dkn /terminate enter "" $ dkn /terminate period "type kpd:default.help" $ wso "DEFAULT Keypad ON" DEFAULT.HELP )0lqqqqqqqqqwqqqqqqqqqwqqqqqqqqqwqqqqqqqqqk x T x SHOW x @KEYAPPLx ED x DEFAULT KEYPAD x F17x KEYS F18x F19x F20x mqqqqqqqqqvqqqqqqqqqvqqqqqqqqqvqqqqqqqqqj lqqqqqqqqqwqqqqqqqqqwqqqqqqqqqwqqqqqqqqqk xGOLD xRED xBLUE xGREEN x x PF1x PF2x PF3x PF4x tqqqqqqqqqnqqqqqqqqqnqqqqqqqqqnqqqqqqqqqu xSHOW SYM xSHOW SYM xSHOW SYM x SHOW x xCUR_FILE xCUR_EXT xCUR_EDIT x USERS x x 7x 8x 9x -x tqqqqqqqqqnqqqqqqqqqnqqqqqqqqqnqqqqqqqqqu xINQ xINQ xINQ x MAIL x xCUR_FILE xCUR_EXT xCUR_EDIT x x x 4x 5x 6x ,x tqqqqqqqqqnqqqqqqqqqnqqqqqqqqqnqqqqqqqqqu x LS x LS x LS *. x x x x *.DIR x CUR_EXT x RETURN x x 1x 2x 3x x tqqqqqqqqqvqqqqqqqqqnqqqqqqqqqu x x SET DEF KPD: x DISPLAY x x x 0x KEYPAD .x ENTERx mqqqqqqqqqqqqqqqqqqqvqqqqqqqqqvqqqqqqqqqj Note that it is difficult to show escape sequences in this document. When TYPE'd, it will not look correct unless the VT100 line drawing character set is available. KEYPAD Programming Kit January 26, 1987 ====================== OTHER KEYPADS Other keypads are defined in the same way. The kit includes DEFAULT, GOLD, RED, BLUE, and GREEN. Each keypad has a .COM and .HELP file in KPD, as well as LOCK and UNLOCK command files, and a DEF_ file to be used by the command procedure used to define new keys. You should start with empty files and define your own keys as you decide you require them. The kit includes my own definitions, and I may not have all loose ends tied together in this document. GOLD.KEYS $ ! DEFINE GOLD KEYPAD $ dkn:=define /key /nolog /if_state=gold /terminate $ dkn pf1 "" $ dkn pf2 "" $ dkn pf3 "" $ dkn pf4 "" $ dkn kp6 "LS *.OBJ" $ dkn kp7 "rr:==run TST'cur_file" $ dkn kp8 "ll:==link TST'cur_file','cur_file" $ dkn kp9 "CUR_EDIT = CUR_FILE + CUR_EXT" $ dkn MINUS "@kpd:lock.gold" $ dkn COMMA "@kpd:unlock" $ dkn kp4 "cur_file=""TST""+cur_file" $ dkn kp5 "ls tst*" $ dkn kp0 "libr/list object" $ dkn kp1 "libr/rep/log lnk$library_" /NOterminate $ dkn kp2 "libr/ins/log object 'cur_file" $ define /key /nolog /if_state=gold kp3 "libr/LIST " /NOterminate $ dkn period "type kpd:gold.help" /noecho $ dkn F18 "Key" $ dkn F19 "REC/ALL" $ dkn F20 "RE_Ed" $ write sys$output "Gold kpd on" $ exit KEYPAD Programming Kit January 26, 1987 ====================== DEFINING OTHER KEYS The symbol KEY or key GOLD F18 will activate the NEWKEY Command Procedure, which prompts for keypad. The HELP file is displayed to show the current definition. The KEYS file is then editted. You make the changes you want, then EXIT or QUIT. If you wish, you may subsequently edit the HELP file. You are returned to the directory from which you came upon exit. NEWKEY.COM $ temp:='f$directory()' $ set def kpd: $ inquire K "Keypad" $ if k .eqs. "" then @def_kpd.com $ if k .eqs. "G" then @def_gold.com $ if k .eqs. "R" then @def_red.com $ if k .eqs. "B" then @def_blue.com $ if k .eqs. "GR" then @def_green.com $ if k .eqs. "D" then @def_kpd.com $ set def 'temp $ temp:== $ exit DEF_KPD.COM, DEF_GOLD.COM, etc are all alike, eg: DEF_BLUE.COM $ ! DEF_BLUE.COM - to define a blue key $ type blue.help $ assign/usermode sys$command sys$input $ ed kpd:blue.com $ inquire dd "Execute ? [N]" $ if dd .eqs. "Y" then @blue.com $ inquire dd "Edit HELP file [Y]" $ if dd .eqs. "N" then goto exit $ assign/usermode sys$command sys$input $ ed kpd:blue.help $ exit: $ exit I'm sure some enterprising DCL novice could convert all these .COM files into a single file with a parameter. Also, there are better ways to execute some of these command procedures other than through DCL. You could write programs to perform the symbols definitions, especially if your symbols are stable (i.e. you have enough and don't want to change them often). This will execute faster, though not enough faster, in my opinion (now, without having checked it out...) to make it worth having to write this program (using system service calls), and then having to edit, re-compile, re-link, and re-run for each change. KEYPAD Programming Kit January 26, 1987 ====================== Program Development Cycle Commands The objective of all this keypading is to develop and use tools that will make you a more productive programmer. After doing the same things over and over again, you get to see the pattern. (Raise switch register 1. Insert paper tape. Load Address. Depress CONTinue. ) Kit Tools : EDTCMD.COM EDT Command procedure EDTINI.EDT EDT Startup command file ICOMCMD.COM Immediate Compile BCOMCMD.COM Batch Compile ILINCMD.COM Immediate Link BLINCMD.COM Batch Link LROCMD.COM Library Replace/Object This assumes you know how to edit, compile, and link your programs, and that you know what an object module library is. If you don't, you should spend a bit of free overtime learning the trade. EDTCMD.COM $ ! to edit/EDT the file specified in P1 or CUR_EDIT $ ! you can make variations of this procedure to automatically $ ! use &cur_file + &cur_ext, for example, to avoid having to $ ! have a key like my RED KP9, which does : $ ! $ CUR_EDIT = CUR_FILE + CUR_EXT $ ! $ ! Also, I think TPU is a good editor to learn, so you might $ ! try borrowing this procedure as source for your own $ ! TPUCMD.COM procedure. $ ! $ if p1 .eqs. "" then goto spec $ curfile:= 'p1' $ c1='f$length(curfile)' $ c2='f$length(cur_ext)' + 1 $ if 'f$locate(".",curfile)' .eq. c1 then - curfile[c1,c2]:= 'cur_ext' $ goto ed $ spec: $ ! note that CURFILE is local to this procedure, whereas $ ! CUR_FILE is a global symbol defined for your process $ ! $ curfile:= 'cur_edit $ ed: $ assign/usermode sys$command sys$input $ edit/edt/command=cmd:edtini.edt 'curfile' $ exit KEYPAD Programming Kit January 26, 1987 ====================== EDTINI.EDT define key gold q as "ext quit." define key gold z as "ext exit." define key gold b as "27asc91asc49asc109asc." define key gold n as "27asc91asc109asc." define key gold g as "14asc." define key gold l as "15asc." define key gold e as "27asc." set mode change [End of EDTINI.EDT] You may want to substitute your own startup file if you have one. These few commands are all that I use, although I will invent others. There are some nice examples of EDT startup files in The DEC Professional magazine and elsewhere. A sample file is provided with VMS. ICOMCMD.COM $ ! To Immediately compile a basic program specified in P1 or CUR_FILE $ if p1 .eqs. "" then goto spec $ basic/type_default=explicit 'p1' $ goto ex $ spec: $ basic/type_default=explicit 'cur_file' $ ex: $ exit [End of ICOMCMD.COM] My favourite language compiler is VAX-11 BASIC. Change the appropriate line above to suit your preferred compiler. Notice the use of the /TYPE_DEFAULT=EXPLICIT option. The BASIC compiler can be made forgiving without this, but it is not wise to develop good quality programs without declaring your variables. However, you cannot use $ and % suffixes on your variables to have them declared string or integer implicitely. So, if you are writing a quick and dirty program complete with % integers, you can compile immediately using the BB command, defined as : $ BB :== BASIC &CUR_FILE The default extension .BAS is assumed. A command procedure file is not necessary for this. I use the mnemonic symbol BB (basic basic) and have a key right below the ICOM key to do this. It is in RED.COM, and the BB symbol should be defined in SYMBOLS.COM. Note also the use of the ampersand (&) operator to indicate to the DCL Command Interpreter to perform its symbol substitution operation at execution time, not at symbol definition time, which is what would happen if you entered the command $ BB :== BASIC 'CUR_FILE KEYPAD Programming Kit January 26, 1987 ====================== ILINCMD.COM $ on control_y then exit $ if p1 .eqs. "" then goto no_spec $ curfile:='p1' $ goto lin $ no_spec: $ curfile=cur_file $ lin: $ link 'curfile' $ exit [End of ILINCMD.COM] Short and simple. Note the use of both '=' and ':=' in the same program. (I just noticed it.) BCOMCMD.COM and BLINCMD.COM The BATCH versions have to include the current directory, the current LNK$LIBRARY_n logical names, and maybe some other stuff. I had command procedures for these, but I never got around to using them very often, and, since I hate keeping old, un-debugged software around for long, in case I decide to try it someday, thinking it works, (or someone else decides to try it...), I deleted then. Their completion is, therefore, left as an exercise for the reader. LROCMD.COM $ ! To replace the object module specified in P1 or CUR_FILE.obj $ ! in the object module library OBJECT.OLB in the current default $ ! directory. $ curfile:='cur_file' $ if p1 .eqs. "" then curfile:='p1' $ library/replace/object/log 'curfile $ exit [End of ICOMCMD.COM] This LRO command has become obsolete for me, as I now keep several object module libraries in a single directory, rather than several, all called OBJECT.OLB, in separate sub-directories. It is okay to have keypad commands at ones disposal, but I now use multiple LRn commands, one for each library/sub-directory in use on any project. The PROJECT startup file defines these for me, and, while it is easy and convenient (not to mention the point of this entire KIT) to have keys for everything, it pays to keep the old gray matter alert while programming, so it doesn't hurt to remember you are in the subdirectory for library 2, working on whatever program you keep there, for whatever reason, and that when finished you have to replace the object module in LNK$LIBRARY_2. Of course, DCL wizards can easily program generic library replacements without having all .OLB's called OBJECT. KEYPAD Programming Kit January 26, 1987 ====================== Other Useful Command Procedures BATLINK.COM $ set def $disk1:[med.bill.fpc.v4] $ define lnk$library f4:fpc_lib1 $ define lnk$library_1 f4:fpc_lib0 $ define lnk$library_2 f4:fpc_lib2 $ define lnk$library_3 f4:fpc_lib3 $ define lnk$library_4 f4:fpc_lib1 $ define lnk$library_5 f4:fpc_lib0 $ link main_menu [End of BATLINK.COM] This is my way around the problem of debugging BLINCMD.COM as mentioned above. This example is a command file to submit to batch to link the MAIN_MENU program of a certain system. I do other tricks to link other programs, and I usually do them in INTERACTIVE mode rather than batch. This one, however, takes enough time to allow me to do other work while the link is proceeding, work such as learning how to compress libraries and do other magic so the LINK operation doesn't take so long... Some of these other tricks include using RED KP0 as an LL command. As with BB, this is a LINK LINK command, which I define as required. The usual requirement is to link a newly (re-)compiled module with its TST module for testing. A keypad command, GOLD KP8, will do : $ LL:== LINK TST'cur_file','cur_file Another command, GOLD KP7, will (re-)define the symbol RR, as : $ RR:== RUN TST'CUR_FILE The DO key, or a BLUE kepad key, will be for RR (RUN RUN). If you do not get into the habit of testing every module you write, you will either spend a fortune of your company's money on program maintenance, or you will move to another job prematurely. A handy keypad command is GOLD KP4, which does : $ CUR_FILE :== TST'CUR_FILE Then, GOLD KP9 does : $ CUR_EDIT = 'CUR_FILE' + 'CUR_EXT', and the ED command will edit the test file. You will not have to edit a test file every time you want to test a module. Usually, once is enough. If, however, you want to change the parameter passing, the number or type of arguments, or anything related to the module coupling (between pgm and TSTpgm), you will want to edit this file. KEYPAD Programming Kit January 26, 1987 ====================== FPCCMD.COM - a sample PROJECT Start-up file. Execute this command once during a programming session, by using the appropriate GREEN keypad key, when you wish to work on programs and files for a specific project. In my case, the PROJECT code is FPC, which means 'Family Practice Clinic', which is short for 'Family Practice Clinic Data Management System Version Four' (FPCV4), the name of a software system we are developing for family physicians. $ ! When editting this file, copy any commands after TRUNK $ ! to FPCCMDTRN.COM, if they are editted. The truncated file then $ ! becomes the command file executed to re-start work on this $ ! project after you have been distracted by other work. $ ! $ ! Perhaps you would like to write a TPU command procedure to use $ ! when editting PROJECT_STARTUP files, to do this on exit. Or $ ! write the TPU code and invent a KEY to invoke it. From what I $ ! read, TPU can do this and everything else, but I am several $ ! years behind in learning just HOW to write TPU code. $ ! $ ! Define process logicals $ ! $ define cdd$default "cdd$top.fpcv4" $ define dtr$startup "[med.bill.fpc.dtr]startup.com" $ define fp $DISK1:[med.bill.fpc.test] $ define fpc DISK$USER01:[med.bill.fpc.data] $ define fpu DISK$USER01:[med.bill.fpc.data] $ define nmc DISK$USER01:[med.bill.nmc.data] $ ! $ ! F4 is a logical defined in the group logical name table, as : $ ! $ DEFINE/GROUP F4 $DISK1:[MED.BILL.FPC.V4] $ ! $ define lnk$library f4:fpc_lib1 $ define lnk$library_1 f4:fpc_lib0 $ define lnk$library_2 f4:fpc_lib2 $ define lnk$library_3 f4:fpc_lib3 $ define lnk$library_4 f4:fpc_lib2 $ define lnk$library_5 f4:fpc_lib1 $ define lnk$library_6 f4:fpc_lib0 $ define lnk$library_7 f4:fpc_lib3 $ ! Note the multiple definitions of the same libraries. Required $ ! because the linker might pick up references to a module which $ ! resides in a library already searched, in the latest one being $ ! searched. Question the use of /SELECTIVE_SEARCH when defining $ ! libraries. Perhaps I should re-organize these libraries and $ ! devote more time to making the LINK operation efficient... $ ! $ ! Some keypads used by the FPCV4 programs : $ ! $ define fp_time_kpd f4:fpu_time_keys.com $ define fp_time_kpd_help f4:fpu_time_keys.help $ define fp_phys_kpd f4:fpu_phys_keys.com $ define fp_phys_kpd_help f4:fpu_phys_keys.help $ ! ....../continued KEYPAD Programming Kit January 26, 1987 ====================== FPCCMD.COM (Cont'd) $ ! Define FPC symbols (foreign commands) $ ! $ get_mcp:==@f4:get_mcp.com $ lr0:==libr/rep/log lnk$library_1 &cur_file $ lr1:==libr/rep/log lnk$library &cur_file $ lr2:==libr/rep/log lnk$library_2 &cur_file $ lr3:==libr/rep/log lnk$library_3 &cur_file $ bl:==submit/noprinter/notify cmd:batlink $ ! $ ! Initial definition of RR and LL commands $ rr:==run f4:main_menu $ ll:=='bl' $ f4:==set def f4 $ l0:==set def $disk1:[med.bill.fpc.v4.lib0] $ l1:==set def $disk1:[med.bill.fpc.v4.lib1] $ l2:==set def $disk1:[med.bill.fpc.v4.lib2] $ l3:==set def $disk1:[med.bill.fpc.v4.lib3] $ swnmc:==@f4:swnmc $ swfpu:==@f4:swfpu $ SHOW log /g $ wso:==write sys$output $ wso "Keypads defined for FPU. Use > SWNMC to change." $ ! $ ! Make truncated version of command for re-start $ ! $ fpc:==@cmd:fpccmdtrn.com $ ! If this is first line, DO NOT EDIT THIS FILE. See FPCCMD.COM. $ ! $ ! TRUNK $ ! $ f4 $ show sym cur_edit $ show sym cur_file $ show sym cur_ext $ show sym rr $ show sym ll $ sho def $ exit [End of FPCCMD.COM] There are several references here to files not in this KIT. The FPCCMD.COM file is provided for reference only. You should write your own similar project start-up file(s). KEYPAD Programming Kit January 26, 1987 ====================== DOWNCMD.COM $ ! To "move down" to the sub-directory specified in P1 $ if p1 .eqs. "" then goto exnul $ set default [.'p1'] $ goto exit $ exnul: $ write sys$output "Down Town?" $ exit: $ exit [End of DOWNCMD.COM] It would be easy enough to prompt for the value. SYMCMD.COM $ ! To define a new symbol in SYMBOLS.COM $ cur_dir := 'f$directory() $ set default cmd: $ assign/usermode sys$command: sys$input: $ ed symbols.com $ inquire cur_ans "Do you want to execute new file? [N]" $ if cur_ans .eqs. "Y" then $ @symbols $ set default 'cur_dir $ exit [End of SYMCMD.COM] KEYPAD Programming Kit January 26, 1987 ====================== Production Versus Development Different shops have different needs and standards concerning finished software products. When a system is released to the users, they will typically execute a command such as : $ RUN F4:MAIN_MENU to run their top-level program. When creating an account for users, I often include a DEFINE/KEY statement in their login.com file to execute this program, such as: $ DEFINE/KEY/TERMINATE/NOECHO PF4 "RUN F4:MAIN_MENU" Experienced programmers will note the trouble caused by the above BATLINK.COM procedure. The output of the link operation specified there is a new version of MAIN_MENU.EXE. This is not so good when users are already logged in and are running an earlier version. If you do the link several times, the system will try to purge the old version and wont be able to. That is not a problem, but if a user stops the execution of the previous image and starts again, he or she will now get the new version, without knowing, and, before you know it, those bugs you are presently testing for will show up in the user process before you have a chance to correct them. Also, you have changed from a system that was running (albeit with existing problems) to a new one that you don't know (for a few minutes, anyway) will run or not. This is not a good way to release new versions of software, especially in systems consisting of hundreds of modules. One should have a policy established whereby users execute a .EXE file stored in a separate production account or directory, or by some other means. I now use a different name for testing the main program, and, when it is complete and tested, and when all users have gone home, I rename the test version to be the new MAIN_MENU.EXE. Hence I no longer use BATLINK.COM, but a Vnnn.COM file, such as : V426.COM $ set def f4 $ define lnk$library f4:fpc_lib0 $ define lnk$library_2 f4:fpc_lib2 $ define lnk$library_3 f4:fpc_lib3 $ define lnk$library_4 f4:fpc_lib1 $ define lnk$library_5 f4:fpc_lib0 $ link main_menu/executable=fpc_v426_test.exe [End of V426.COM] When the new version, 4.26, has been released, and users have been notified by MAIL, and the Release Notes are written and sent to users, the V426.COM is renamed to V427.COM, editted to change 426 to 427, and I can carry on developing the system. A TPU command file to do this would be a good idea. KEYPAD Programming Kit January 26, 1987 ====================== Directory Listing and Change Information On following page are directory listings of programs in the KIT, for the logical directories CMD and KPD. My actual directories contain other files, too, so I have editted this listing in this document, but the version numbers and dates are current. One final checkout of the contents of the files is required because of incessant editorializing while preparing this document. I really need a TPU or EDT edit program to perform INCLUDE functions to patch the actual files into this document, so I can have the editorial changes (improvements one decides to make before letting others read your sloppy code) incorporated into the real files, thereby producing primary documentation instead of secondary. And DECUS doesn't want users to editorialize their programs, just to have them work as they say they do... Changes : Vers Date Init Description ---- ------------ ---- ------------------------------- 1.00 Jan 26, 1987 WRG Original for DECUS Credits : The DCL used in these programs is mostly my own, although some sources came from Andy Orr, who wrote most of his command procedures under VMS Version 2. Others came from Donna Ball, and Peter Ball did the original VT100 help diagram. There may be some undocumented programs in the Kit. I will no doubt continue to improve my own existing tools and add new ones, but I cannot make a committment regarding distribution of future versions of this Kit. This kit is being sent to DECUS through our local user group, the Newfoundland and Labrador LUG (NL LUG), and if users send me new tools or improvements to old ones, I will make every effort to send new versions to DECUS. There are many more programming productivity enhancement tricks possible than are described here. KEYPAD Programming Kit January 26, 1987 ====================== Directory $DISK1:[MED.BILL.SYS.CMD] [editted for KIT] BATLINK.COM;1 1 26-JUL-1986 21:42 DOWNCMD.COM;5 1 17-OCT-1985 13:21 EDT.COM;2 1 11-NOV-1986 12:42 EDTCMD.COM;2 1 20-NOV-1986 22:59 EDTINI.EDT;4 1 4-DEC-1986 11:50 FPCCMD.COM;46 5 5-JAN-1987 23:06 FPCCMDTRN.COM;4 1 27-NOV-1986 10:18 ICOMCMD.COM;7 1 12-NOV-1986 17:24 ILINCMD.COM;2 1 12-NOV-1986 10:30 LINKCMD.COM;1 1 7-JUL-1982 16:57 RR.COM;1 1 2-JAN-1986 09:37 SYMBOLS.COM;29 3 27-NOV-1986 11:26 SYMBOLS.KIT;2 3 16-JAN-1987 10:44 SYMCMD.COM;8 1 27-JUN-1986 02:53 Directory $DISK1:[MED.BILL.SYS.CMD.KPD] [editted for KIT] BLUE.COM;11 2 24-JAN-1987 21:44 BLUE.HELP;8 3 4-MAR-1986 10:11 DEFAULT.COM;9 2 16-JAN-1987 10:20 DEFAULT.HELP;16 3 14-NOV-1985 17:15 DEFAULT.KPD;1 3 11-OCT-1985 09:11 DEF_BLUE.COM;1 1 14-NOV-1985 17:29 DEF_GOLD.COM;1 1 14-NOV-1985 17:28 DEF_GREEN.COM;1 1 14-NOV-1985 17:30 DEF_KPD.COM;6 1 14-NOV-1985 17:08 DEF_RED.COM;1 1 14-NOV-1985 17:29 GOLD.COM;40 2 16-JAN-1987 10:25 GOLD.HELP;25 3 5-JAN-1987 22:04 GREEN.COM;7 2 16-JAN-1987 09:52 GREEN.HELP;11 3 9-NOV-1986 16:30 KEYS.COM;3 1 4-MAR-1986 23:48 LK201.KEYS;6 2 4-MAR-1986 10:06 LOCK.BLUE;4 1 1-NOV-1985 11:58 LOCK.GOLD;3 1 1-NOV-1985 11:57 LOCK.GREEN;3 1 1-NOV-1985 11:59 LOCK.RED;3 1 1-NOV-1985 11:58 NEWKEY.COM;7 1 5-MAR-1986 13:19 RED.COM;19 2 16-JAN-1987 09:47 RED.HELP;18 3 6-JAN-1987 13:45 RESET_TER.COM;2 1 4-MAR-1986 10:17 UNLOCK.COM;2 1 1-NOV-1985 11:56 VT100.KEYS;2 1 4-MAR-1986 10:05