[LogoShip]

Home

Daqarta for DOS Contents

Introduction

Downloads

Free Registration

Contact Us
Daqarta for DOS
Data AcQuisition And Real-Time Analysis
Shareware for Legacy Systems

From the Daqarta for DOS Help system:
 

KEY MACROS:


KEY MACRO INTRODUCTION:

Frequently-used key sequences may be stored for easier operation. Instead of hitting all the keys of the sequence each time they are needed, using a Key Macro allows the same sequence to be run by hitting a single invocation key ("k" for "Key Run") followed by an identifying key you have assigned.

Almost any valid Daqarta keystroke may be included as part of a macro, including option keys, cursor motions, and text or data entry. The only exceptions are the disaster management keys like CTRL-ALT-DEL (which you probably don't want to include in a macro anyway!) and most applications of file overwrite confirmation (for safety).

Key Macros may invoke other Key Macros that have been defined previously, and repeated a specified number of times. They are typically saved in files for future use. A Key Macro may be created that will run automatically at the start of every session. Macros can be created to speed entry of frequently- used descriptive text on the comment line, avoiding the use of cryptic abbreviations that may not be clear to others... or yourself, a year later.

Proper use of Key Macros can allow high levels of automation, including completely unattended operation in some cases.

CREATING AND STORING KEY MACROS (KeySt):

To set up a key sequence as a Key Macro, hit SHIFT-K or ALT-INS. If you do this while entering text or data, you must use the ALT-INS form since SHIFT-K would just enter an upper-case 'K'.

You will be prompted for an identifying (ID) key to be used for the sequence, via the message line prompt:

    'Store Key Macro as:'
You may use any displayable key for the ID: Any numeral, symbol, or upper or lower case letter, but not Spacebar, CapsLock, Tab, etc. Function keys are also allowed, including SHIFT-Fn, CTRL-Fn, and ALT-Fn. You may not use CTRL- or ALT- with other symbols or letters, though of course SHIFT may be used to distinguish upper and lower case. There are thus 142 keys available for use as Key Macro IDs. High-ASCII symbols such as those available in DOS via ALT-<number pad> entry are not allowed.

As soon as you enter the desired ID key, the message line will prompt you for a descriptive name to help you identify this macro later:

    'Name: '
You may fill up the remainder of the message line (up to 57 characters) with descriptive text. After you hit ENTER to conclude this, the the message line will change to:
     'Storing to Macro Key N.'
where N is your selected ID key, shown highlighted. Now perform any desired operations, and all keys will be stored. The above message will remain displayed until you hit a shift key, when it will revert to showing whatever comment was previously shown. Shift keys alone are never stored as part of the macro, so if you just hit SHIFT at any time you can see that the SHIFT-K option 'KeySt' is active to indicate storage in progress.

When you are done, hit SHIFT-K or ALT-INS again to end the macro. The message line will show a report like:

    'Key Macro N stored with 23456 bytes free.'
where N will be the macro ID you used and 23456 will be the actual bytes of macro memory available afterward.

In a text or data entry mode (ALT-INS only), the above 'Storing to' and 'bytes free' messages will not be shown at all, since the message line is needed for entry. When you hit ALT-INS to begin KeySt, the 'Store Key Macro as:' and subsequent 'Name: ' prompts will replace the text string, but as soon as you enter the descriptive name, the entry text and cursor will be restored. You will thus know that Daqarta is ready to accept the macro text.

At the end of the portion of the text/data that you want to be part of the macro string, ALT-INS will produce a distinctive low-high acknowledgement beep instead of the 'bytes free' message, so you can continue entering any remaining non-macro text.

Also, during text macro entry the SHIFT key will not change the option display, so you will just have to keep in mind that you are not only entering text/data, but also storing a macro. This is not usually a problem, since text strings tend to be relatively short and focused compared to the complexity and depth of possible option sequences.

When selecting an ID key to use with KeySt, it may be helpful to review the previously-saved descriptions of each with the Key Macro descriptive name viewer. You can invoke this by hitting ENTER when prompted for the KeySt ID. You may select a macro from this list for replacement, or enter a new ID.

If you attempt to store a Key Macro with an ID that is already in use, you will be prompted with:

    'Replace N Key Macro? (Y default/N):'
If you hit ENTER or Y, the prior macro using that ID will be replaced with the new one. Any other key will escape from the KeySt command.

CHANGING THE DESCRIPTIVE NAME OF AN EXISTING KEY MACRO:

Sometimes you may want to change only the descriptive name of a Key Macro without actually replacing the macro itself. To do this, begin as though you were going to replace the whole macro: Hit SHIFT-K (or ALT-INS) and give the ID of the selected macro. When prompted to replace it, hit ENTER or Y to do so. Then at the 'Name: ' prompt, enter the new name, but conclude with ALT-ENTER instead of ENTER. The new name will be accepted and the KeySt mode will be immediately exited with no other changes made.

RUNNING A KEY MACRO (KeyRn):

To run the macro at any time, hit the K-key or INS-key. If you are entering text or data you must use the INS form, since the K-key would just enter a lower-case 'k'. You will be prompted for the selected ID with:
     'Run Key Macro:'
After you hit the ID key, the message line will change to:
     'Running Key Macro N.'
where N is your selected ID key. The K-key option 'KeyRn' will be highlighted to show that a macro is running, and key presses will come from the stored macro instead of from the keyboard.

If you need help selecting the proper ID to use, you can review the previously-saved descriptions of each with the Key Macro descriptive name viewer by hitting ENTER when you are prompted for the ID.

If you attempt to run a macro with a non-existent ID, you will see:

    'N Key Macro not found, or wrong option/text mode.'
where N is the ID you attempted to use.

Note that when you invoke a Key Macro, Daqarta must be in the same keystroke mode as when it was stored, or you will also get the 'not found' message. This means that if the first key of the macro specifies an option key, you can't run that macro while Daqarta is awaiting text or data entry. Likewise, a macro that begins with text entry can't be run while Daqarta is awaiting option keys. However, it is perfectly normal for a macro to start in one mode and switch to another. For example, a macro might give the I-key to invoke the InDat option, then give text keys to select the desired file name.

There is no restriction on the number of times a single macro changes modes: The same macro could very well load a file as above and then go on to use option keys to invoke a menu and select an item, then use text entry to change a value, then option keys to collect data and invoke MemSv to save it to trace memory, then a text key to select the memory number, and so on. The only thing that is important is that Daqarta be in the proper mode to begin accepting the keys of the selected macro.

You can use the Key Macro descriptive name viewer to check if a macro begins in text or option mode: The ID display at the start of each descriptive text line will be preceded with a '-' sign for text macros.

While a long Key Macro is running, the ESC key may be hit to cancel the macro and return to normal operation, or NUM-LOCK or the grey Pause/Break key may be used to halt or single-step through the macro. All other "real" keys will be ignored while the macro sequence is active and the 'KeyRn' highlight is on.

One of the advantages of Key Macros is that they execute MUCH faster than the same series of "real" keystrokes, because the macro processor doesn't do any data display between keys unless specifically requested via WaitP. Macros that are just changing between different option setups will thus run so fast as to be almost immediate, so there is no chance to hit any keys before they are done. The ESC and halt options are therefore most useful for long-running macros.

If an unexpected error (like 'File not found') is encountered during KeyRn, the macro will exit so you can take appropriate action. There is no way to "resume at the same spot" after an error, since it is assumed that error recovery will change the current Daqarta state from what the macro is expecting.

KEY MACRO DESCRIPTIVE NAME VIEWER:

When you are prompted to enter a Key Macro ID for either KeySt or KeyRn, you have the option of selecting from a list of all the IDs and their full descriptive names. Just hit PgUp, PgDn, or ENTER at the prompt, instead of a specific ID. The trace will be temporarily Paused and replaced by the sorted macro names list. You can then hit the desired ID key directly, or use the Up/Dn arrow keys to scroll the highlighted cursor line to the desired name, and hit ENTER to accept it.

If you have more than 24 macros stored, you can use the Pg keys to see the others, displayed at 24 per screen, or you can scroll the display by moving "past the end" with the Up/Dn arrow keys. The current cursor line is also shown on the message line. As soon as the ID is accepted, the prior trace display mode will be restored.

If, for some reason, you do not want the running trace to be Paused for the macro name display, you can still review the macros one at a time on the message line. Hit either Up/Dn arrow key at the ID prompt, and you will see the first macro name on the message line. You can then scroll with the Up/Dn arrow keys and hit ENTER or the desired ID key. If, during the single-line scroll display, you change your mind and want to see the full 24-line display, just hit PgUp or PgDn to switch to the Paused mode as discussed above.

The display format for both the single-line and 24-line modes begins with a blank for macros that start in normal option mode, or '-' for those that start in text mode. This is followed by the ID itself, then the descriptive text. For macros that use function key IDs, a shorthand notation is used to show shifted keys:

    '- A   This is a text macro whose ID is "A".'
    ' F10  This is an unshifted function key.'
    ' ^F8  This is SHIFT-F8.'
    '-¢F12 This is CTRL-F12, and it is a text macro.'
    ' @F3  This is ALT-F3.'
GO:

Questions? Comments? Contact us!

We respond to ALL inquiries, typically within 24 hrs.
INTERSTELLAR RESEARCH:
25 Years of Innovative Instrumentation
© Copyright 1999 - 2006 by Interstellar Research