Programming with Variables

Prev Next Home Home Table Of Contents Index

PROGRAMMING WITH VARIABLES

The Programmable Function Keys allow you to execute programs and DOS commands on files. This may be accomplished by using variables. The variable {F}, means filename. This tells the computer to perform a command on whatever filename is next to the pointer.

Suppose that you want to program the Ctrl F4 key to execute the WORDSTAR Word Processor (filename WS). Position the pointer next to any of your WORDSTAR data files (your letters, reports, etc.) and then, when you press the Ctrl F4 key, the computer executes the word processor and opens the file next to the pointer. Your DOS command for the Ctrl F4 key would read: WS {F}

The following are valid variables for DM. Variables used in the command line must be put in brackets {}.


          {F} = FileName             {P} = Path
          {T} = Type in Text         {D} = Drive
          {N} = Name no Ext          {E} = Ext no Name
          {S} = Allow Program to Change Subdirectory
          {A} = Press Any Key to Return to DM

The chart below shows some uses of the Programmable Function Keys using variables.


  Command       Help Text      Explanation/Use

TREE {A} List Tree Executes the Tree program, which displays all the directories and subdirectories on the disk in a "tree" structure. Pauses before returning to DM.

CHKDSK {A} Chkdsk Tells how much space is used up on the disk, and how much memory is free. Pauses before returning to DM.

BASIC {F} Basic Executes the Basic program and loads the data file next to the pointer.

WS {F} WORDSTAR Executes the WORDSTAR word processor, and loads the data file next to the pointer.

To continue the practice programming session, the preceding four commands and help text could be entered for the Alt F3, Alt F4, Alt F5, and Alt F6 keys on the Edit Commands (F8) menu. Press F8 and choose Option 1.


        ================================
        |  Esc to Exit  Command Line: 2
        |
        |  Alt F1 ......Format
        |  FORMAT A:
        |  Alt F2 ......Dir A:
        |  DIR A:/P
        |  Alt F3 ......List Tree
        |  TREE {A}
        |  Alt F4 ......Chkdsk
        |  CHKDSK {A}
        |  Alt F5 ......Basic
        |  BASIC {F}
        |  Alt F6 ......WORDSTAR
        |  WS {F}

There are many other possibilities for the Programmable Function Keys. Decide what tasks you would like your keys to do. It might help to make a chart like the ones above. Then enter your commands and help text as shown in the examples.

If you are going to be using software in one directory and files in another, you will need to specify the drive and path in your DOS commands. They were omitted from the examples given above for the sake of simplicity. The above commands with pathnames might read:


             C:\UTIL\TREE {A}
             C:\UTIL\CHKDSK A: {A}
             C:\BASIC {F}
             C:\WS {F}

When you're finished, press the Esc key. Then test your newly programmed function keys. You may need to go back and fine tune some of your commands.

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home