2.3.153. VMACRO

Attaches a macro to a user-defined window or file. Any output that is normally sent to the Cmd tab of the Output view is redirected to the specified window or file.

Syntax

VMACRO {windowid | fileid} [,macro_name(args)]

where:

windowid | fileid

Specifies the window of file to be associated with the macro. This must be a user-defined windowid or fileid.

macro_name

Specifies the name and call arguments of the macro that is to send its output to the specified window or file. This happens whenever the macro runs, either directly from the CLI or a command script, or by a breakpoint being hit to which the macro is attached.

Description

The VMACRO command attaches a specified macro to a specified user-defined window or file. Any output that is normally sent to the Cmd tab of the Output view is redirected to the specified window or file whenever the macro is called.

Note

If the attached macro contains any commands or predefined macros that use a different windowid or fileid, then they are not affected by the VMACRO command.

If you do not supply a macro name, the window or file is disassociated from any macro. The VMACRO command runs asynchronously.

Examples

The following examples show how to use VMACRO:

vmacro 50,showmyvars()

Use the macro showmyvars() to write formatted variables to window 50.

vmacro 50

Unbind all macros from user window 50.

fopen 100,'c:\myfiles\messages.txt' vmacro 100,showmyvars() showmyvars() vmacro 100 vclose 100

Use the macro showmyvars() to write formatted variables to the file messages.txt, unbind the macro from the file, and finally close the file.

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0175N
Non-ConfidentialID052111