macro read
Allows you to create a macro by reading the commands to be executed from a file. Thus, instead of creating a new macro from the scratch, an existing command file can be used as a template.
Format:
macro read |
|---|
macro_name = | macro name |
file_name = | file name with path |
user_entered_command = | command |
wrap_in_undo = | yes/no |
help_file = | help file path |
help_string = | help text |
create_panel = | yes/no |
Example:
macro read & |
|---|
macro_name = | TEST_MACRO & |
file_name = | “C:\macros\test_mac.cmd” & |
user_entered_command = | “TESTMAC” & |
wrap_in_undo = | No & |
help_string = | ‘This is a test macro’ & |
create_panel = | No |
Description:
Parameter | Value Type | Description |
|---|
macro_name | String | Specifies the name of an existing macro. |
file_name | String | Specifies the name of the file that is to be read, written, or executed. |
user_entered_command | String | Specifies the command string to be entered by the user to execute the macro. |
wrap_in_undo | Yes/No | Specifies whether or not to the entire macro can be undone with a single undo command. |
help_file | String | Specifies the text that is to be used as the command or topic string when getting help on a macro. |
help_string | String | Specifies the text that is to be used as the command or topic string when getting help on a macro. |
create_panel | Yes/No | Allows the user to specify if a panel is to be created for the specified macro. |
Extended Definition:
1. Adams View will not allow you to have two macros with the same full name, so you must provide a unique name. You must separate multiple macro names by commas.
2. The user_entered_command is a string with a list of keywords separated by blanks. The keywords can match existing keywords, but the final command defined must be unique.
For example: user_entered_command = "force my_force create"
If this parameter is not entered, the name of the macro will become the new command.
3. You can specify the Adams View commands that are to be executed when the macro is used with the commands_to_be_executed parameter on the macro read and macro modify commands, or from a file on the macro read command. Adams View does not check your entries in this field for correct syntax when you create the macro, only when the macro is executed the syntax errors will be notified. You enter these commands as quoted strings separated by commas. You can have quotes inside a string by proceeding them with a backslash "\". You can indicate parameters to associate with the macro be placing a dollar sign '$' followed by the name of the parameter you want anywhere in the commands.
4. The help that is obtained by help_file string is the same as you would get if you supplied the help string to the command: help command_or_topic=. You must specify the entire file name, there is no default extension. The search path facility is used to find the specified file.
5. If there are no parameters in the macro, no panel will be created. The name of the macro panel will be macro_ appended with the macro name. For example, if the name of macro being created or modified is MAC1, the panel will be named macro_MAC1.
Cautions:
1. If the macro is very large turning the wrap_in_undo option to yes may decrease the speed of it's execution.
Tips:
1. You may identify a macro by typing its name. If a macro is available by default, you may identify it by entering its name only. If it is not, you must enter its full name. If you type a "?", Adams View will list the macros available by default.