Progress
Debugger Guide


MACRO Command

Creates a Debugger macro.

SYNTAX

MACRO macroname macro-definition 

PARAMETERS

macroname

The name of the new macro. The macro name is case sensitive and cannot specify a Debugger command name.

macro-definition

One or more Debugger commands and user-defined macro names separated by semicolons (;).

NOTES

Table A–2: Variables in Macros as Commands
Variable
Value
&FILE
A corresponding quoted or unquoted string.
&LINE
A corresponding numeric value.
&TEXT
A corresponding quoted or unquoted string.

EXAMPLES

This macro definition executes the BREAK Command using the &FILE and &LINE Debugger variables:

MACRO stop-at BREAK &FILE &LINE 

To invoke the stop-at macro as a command, you must specify the macro name followed by a filename and line number:

stop-at myapp.p 36 

The stop-at macro expands to this Debugger command:

BREAK myapp.p 36 

When you invoke a macro as a command, you can specify only one value for each Debugger variable used, no matter how many times you use it. Thus, you can never specify more than three variable values for a macro command. For example, this macro definition executes the BREAK Command and RUN Command using the &FILE Debugger variable:

MACRO debug BREAK &FILE; RUN &FILE 

To invoke the debug macro, you only have to enter the macro name with one filename parameter:

debug myapp.p 

The debug macro then expands to these Debugger commands:

BREAK myapp.p; RUN myapp.p 

This macro definition executes the CANCEL BREAK Command using the &TEXT variable. This allows all formats of the CANCEL BREAK Command to be invoked by the macro command:

MACRO cb CANCEL BREAK &TEXT 

These commands all show valid uses of the cb macro:

cb "myapp.p 33"
cb "#2 #4 #5 #8"
cb 33 

SEE ALSO

BUTTON Command, CANCEL ALL Command, CANCEL MACRO Command, SHOW MACROS Command


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095