PFK.BAS - by Mike Foley / Data Control / P.O. Box 101 / Dunedin, FL 33528 Donated to AMUS for members use - Copyright (c) 1986 by Data Control PFK.BAS is a program that asks for the name of an instruction file to process into a .PFK file.  The instruction file is created and edited in VUE. It must contain the name of a function key or FUNCT-key sequence and a group of commands for each function key. The object is to create a MACRO type of program to permit automatic operation of the computer if the function key is pressed. The programs required for this process to work are:     PFK.BAS[7,6]   PFK.RUN[7,6]   PFKBAS.HLP[7,1] To run the program type .RUN PFK from the AMOS dot. You will see the prompt: Enter file to process into a PFK file (file) > The program is expecting the name of an instruction file.  Use only the first 6 characters of the name (the extension will be .PFI). If you enter ? at the prompt you will see this help file. If a file name is displayed in parenthesis you can press RETURN to accept the filename in parenthesis. You may also enter /D to force the creation of a diag file (file.DIA) which will list the instructions and codes in a sequential file. After you enter a file name you will be put into VUE to create or edit the instruction file (file.PFI). PFK will remember the last instruction file you processed.  It will be the default file listed in the parenthesis. Just press RETURN to re-edit it. The rules for the instruction file are:        A semi-colon is a remark and information following it on the  same line will not be processed.       A function key name or labeled key name (PREV SCREEN key,     HELP key etc.) must be given to define the key being set up,  followed by the instructions for that function key.           Valid function key names are:                 F1      through F16            F1 SHIFT  through F16 SHIFT            FUNCT0  through FUNCT9         FUNCTA  through FUNCTZ        Other KEYS you can use are: (Use the word KEY with these)              KEY INSERT CHARACTER    or      KEY INS CHAR           KEY DELETE CHARACTER    or      KEY DEL CHAR           KEY INSERT WORD         or      KEY INS WORD           KEY DELETE WORD         or      KEY DEL WORD           KEY INSERT LINE         or      KEY INS LINE           KEY DELETE LINE         or      KEY DEL LINE           KEY PREV SCREEN                KEY NEXT SCREEN                KEY HOME               KEY PREV WORD          KEY NEXT WORD          KEY HELP               KEY NEW LINE           (The word KEY will distinguish these from similar commands) Valid instructions are any AMOS commands, program inputs, or if for use in VUE or AlphaCALC any instruction from the COMMAND LISTING below. Use remarks freely after a semi-colon. SAMPLE INSTRUCTION LIST: F1           ;Specify the F1 key DIR/W               ;The DIR program with the /W argument          ;A blank line for neatness F1 SHIFT     ;The Shifted F1 key SYSTAT              ;This key will give me a SYSTAT display F2             ;The F2 key DATE                ;Can hold both date TIME               ; and time ****************************************************************** ****************************************************************** After editing the instruction file exit VUE with an F to save it. The PFK program will re-run and will write a file.PFK, and will load it into your memory. Any other .PFK files in your memory will be deleted first. Wait for the AMOS dot, and then you will see the instruction to use the function keys. Now you can try your file.PFK. Press the function key (or keys) you defined in the instruction file. Hopefully all will work well. If failure should occur go back to the first step in this process which was .RUN PFK and re-edit your instruction file. INSTRUCTION FILE RULES The function key names must be F1 to F16 for the 16 programmable function keys, and FUNCT0 to FUNCT9 or FUNCTA to FUNCTZ for the FUNCT-key combinations used with the FUNCT key. The word SHIFT after the F1 or FUNCT1 command will program the shifted key. After each function key name a list of AMOS system commands, VUE editing commands and AlphaCalc editing commands may be listed along with any text or symbols desired. The following words will be converted to VUE or CALC control sequences by the program, and are therefore reserved.  They must be used exactly as listed below to be converted.  Most have two possible spellings, with the first one abbreviated. A few have three possible spellings.  The wording for these commands is directly from the VUE and CALC manuals. See the sample .PFK instruction file called SAMP.PFI.    COMMAND or alternate phrasing of command and alternate spellings.      =================================================================      RIGHT   RIGHT ARROW    LEFT    LEFT ARROW     UP      UP ARROW       DOWN    DOWN ARROW     NW      NEXT WORD      PW      PREVIOUS WORD  EOL     END OF LINE    SOL     START OF LINE  NM      NEXT MATCH     PP      PREVIOUS PAGE  NP      NEXT PAGE      LP      LAST PAGE               END    EOF     LAST PAGE      CC      CENTER SCREEN           CENTER CURSOR  SS      STOP SCROLL    HOME    HOME POSITION  CR      CARRAGE RETURN IL      INSERT LINE    DL      LINE DEL                DELETE LINE    CL      CONCATENATE LINES      IC      CHAR INS                INSERT CHARACTER       DC      CHAR DEL                DELETE CHARACTER       DPC     DELETE PREVIOUS CHARACTER      RUB     RUBOUT DEL     DELETE TO END OF LINE  DW      DELETE WORD    CIM     CHARACTER INSERT MODE  LIM     LINE INSERT MODE       BM      SET BLOCK MARKERS       BLOCK MARK      BLOCK  ESC     ESCAPE    ALPHACALC SCREEN CONTROLS - SOME ARE SAME AS IN VUE        SLA     SHIFT LEFT ARROW       SRA     SHIFT RIGHT ARROW      AA      AUTO ADVANCE   AE      AUTO EDIT      BCLEAR  BLOCK CLEAR    BCOPY   BLOCK COPY     BERASE  BLOCK ERASE    BCOL    BORDER COLUMN  BROW    BORDER ROW     CANCEL  MENU   COLDEL  COL DEL COLUMN DELETE  COLINS  COL INS COLUMN INSERT  EDIT   ERACOL  ERASE COLUMN   ERAROW  ERASE ROW      EX      EXECUTE        HELP   SH      SHIFT HOME     LC      LOCK COLUMN    LR      LOCK ROW       MO      MOVE   NS      NEXT SCREEN    PS      PREVIOUS SCREEN        PC      PROTECT CELL   RC      RECOMPUTE      RD      ROW DELETE     RI      ROW INSERT     SL      SCREEN LEFT    SR      SCREEN RIGHT    MISCL ADDED SCREEN CONTROLS         CR      force a carrage return LF      force a linefeed       TAB     insert a tab   CRLF    force a carrage return + linefeed      SPACE   insert one space        SPACE/5  insert 5 spaces       LINE25  set text on following line as 25th line status display         Use to create 25th line CRT display easily!!           Will also create a shifted status line if used a second                time in one .PFI instruction list.     /LF     LINEFEED - after a command will force a line feed ie. TIME/LF  /NLF    NO LINEFEED - after a command will prevent a line feed         This is very useful if you are RUNning a basic program.                Use RUN PROG/NLF to keep display tighter (no skipped lines)    /NCR    NO CARRAGE RETURN - after a command will prevent insertion             of a carrage return    /5      will do a proceedure 5 times ie. DOWN/5 will insert            5 down arrow commands into a VUE session               Use with CR, LF, CRLF, TAB, SPACE, UP, DOWN, RIGHT, LEFT, etc.         and most other commands.      ODTIM   If used in a VUE edit session command will insert             the date in Day, Month Day, Year Time format. Use the          same boolean arguments for ODTIM as in the AlphaBasic          XCALL subroutine manual to change format: ODTIM/512            The ODTIM/8 argument will put the date into the .PFK           file in the format YYMMDD. This is a variation on the          regular ODTIM.SBR processing.  Also you may spell ODTIM               as ODTIME.    ODTIM/-1        Will format the time as:                       Monday, February 10, 1986 05:10:00 PM $text   If the text you want conflicts with a command then use                the $ symbol to designate text only (the $ will be            dropped by the program).      STOP    This command in the instruction file will set a breakpoint             and the file will not be processed past the STOP     SPECIAL ARGUMENTS:             /AUTO   If you enter the filename to process followed by the          argument /AUTO or /A then PFK.RUN will skip the VUE            session and go directly to the processing of the .PFI          file.  I use this argument to make process a daily             file which puts todays date into a .PFK file. Additional instructions: If the command: VUE filename is given in the instruction list, PFK.BAS will look to see if the filename exists. If not it will make one.  It will not do this for CALC files though. NOTE: Once in VUE or CALC, the function keys will either not work, or will have their CALC functions restored.  .PFK files only seem to work from AMOS system level, or from within BASIC programs, etc. This is because VUE and CALC load their respective .VUX or .CUX key translation tables. One way to is to copy your terminal driver into another filename in [1,6]. Then set a TRMDEF in your AMOSL.INI file with the new driver. Then use TRMTYP to switch drivers before VUEing. I have a W.TDV in [1,6] which I use when I do word processing in VUE. It is a copy of ALPHA.TDV (or AM60.DTV). There is a TRMDEF in my AMOSL.INI that has this this W.TDV in it:   TRMDEF DUM5,PSEUDO,W,25,25,2            ;MIKES DRIVER When I want to load my special VUEKEY.PFK file that has the F keys set up for fast COPY & FORMAT etc. I use TRMTYP W to switch drivers. Naturally, I like to switch back to the ALPHA driver when I'm done, so this .DO file does the switching for me: ;DSK0:VK.DO[2,2] ;SEND IN ON or OFF and PROGRAM TO RUN GOTO $0 :<VK format:  VK ON  or  VK off > GOTO LEAVE ;ON :< Setting up VUE KEYs on your CRT .. > DEL *.PFK TRMTYP W                     ;Need my special W.TDV TRMDEF LOG LIB:                  ;I keep all PFK files in LIB: RUN PFK   VUEKEY/A                       ;Auto process (No VUE phase) LOG $:$P                   ;Takes me back to where I came from GOTO LEAVE                  ;All done ;OFF :< Re-setting your CRT keys to NORMAL .. > TRMTYP ALPHA                 ;Put my regular TRMDEF back NORMAL                              ;Execute the DSK0:NORMAL.CMD[2,2] ;LEAVE :< Done> :R RUN $1                            ;Optional branch In the above example VUEKEY.PFI is my PFK file instruction list. NORMAL is a command that loads my normal system level function keys. It was created with PFK, and moved to [2,2] and modified like this: ;DSK0:NORMAL.CMD[2,2] :S DEL *.PFK         ;Throw out whatever PFK is up there LOAD LIB:NORMAL.PFK ;Get the NORMAL.PFK in memory SET ECHO          ;This may be needed SET PROMPT .                ;Sometimes I need the dot back XY=29                    ;Cursor off to avoid flash on CRT :R                    ;Got to see it :<z f1 CLS f2 MODEM f3 G&K f4 SPY f5 DOW f6 GOLF f7 EZAR f8 LOCK SETTINGS f9 CALC                                                        >                    ;This was created by PFK.RUN for me as LINE25 :<Z f1 132 column  f2 80 column                                                    >                   ;and so was this XY=28                  ;Cursor back on I recommend putting all .PFK files into one PPN such as LIB: and always running this program or preparing .PFK files there.  You should also make a .CMD or .DO file in CMD: to load the .PFK file you want.  Be sure to DEL *.PFK before loading a .PFK file. See the file.CMD produced by PFK.RUN for the load process. If you want the 25th status to show your selections use the LINE25 command followed by the exact text to display on the 25th line of the CRT.  If a second LINE25 command is encountered by the program the shifted status line will be set up with the text immediately following it. Only the LINE25 command will force the creation of a FILE.CMD to automatically load the .PFK file by the same name, and set the CRT 25th status line. One should be careful in choosing file names.  Do not conflict with existing file names or existing files may be overwritten. The possible files that this program will prepare are:  file.PFK        programmable function key line file.PFI        instruction list for PFK.BAS   file.CMD        will load the PFK and set 25th line of CRT     file.DIA        diagnosis file - type it or print it   PFK.WRK         This holds the name of the last file                  processed by the PFK program in your PPN. All of the files will be created in the PPN where the program is run. If you want to place the .CMD file in DSK0:[2,2] you will have to copy it there.  You may also want to edit it to load the .PFK file from where you want it to reside. See the NORMAL.CMD above. Some of the limits to this program use are: Your TRMDEF in buffer size is the maximum size in bytes of any PFK file you want to use.  The PFK will execute until it runs  out of IN buffer and will suspend at that point.  Also the    terminal bell will likely ring.       When in VUE you may not use FUNCTION keys if you have a       .VUX file in DSK0:[7,0] that has the same terminal name as your        terminal driver.  Either use another driver, another driver name.      See the example above (VK.DO and W.TDV).      The DEL LINE key and HELP key on the AM60 refuse to work with this program, but all the other keys seem to work ok. Other software available from Data Control:    AUP     AlphaBasic Programmer Utilities:               9 programs to speed applications development.  W       Word processing helper:                For VUE & TXTFMT users to manage multiple printers             with easy formatting (Underlining, Bold etc, etc)              No special terminal drivers needed.   SNAP    Random file program manager with automatic indexing            and basic programmers 'hooks'. Easy to use. Automatic          CRT formatting.       GOLF    Pro golf score management. For other products please call DATA CONTROL at 813-461-9382.