| |||
| Home > RealView Debugger Commands > Alphabetical command reference > 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.
{VMACROwindowid | fileid} [,macro_name(args)]
where:
windowid | fileidSpecifies the window of file to be associated with
the macro. This must be a user-defined or windowid.fileid
macro_nameSpecifies 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.
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.
If the attached macro contains any commands or predefined
macros that use a different or windowid,
then they are not affected by the VMACRO command.fileid
If you do not supply a macro name, the window or file is disassociated from any macro. The VMACRO command runs asynchronously.
The following examples show how to use VMACRO:
vmacro 50,showmyvars()Use the macro showmyvars() to
write formatted variables to window 50.
vmacro 50Unbind all macros from user window 50.
fopen 100,'c:\myfiles\messages.txt'
vmacro 100,showmyvars()
showmyvars()
vmacro 100
vclose 100Use the macro showmyvars() to
write formatted variables to the file messages.txt, unbind
the macro from the file, and finally close the file.