Topic: Load/trace user macro .. (1 of 4), Read 92 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Sunday, March 18, 2001 09:47 PM

Hi fellow Vedit users.

I had a problem running a macro and so, I had to go back to the manual and study it. Then I
discovered that it is pretty easy to modify the {Misc, Load/exec user macro ..} menu command to execute the macro step by step. I am enclosing the command which I put into my {User_Menu}:

Get_Filename(86,"c:\vedit\user-mac\*.vdm") Reg_Load(85,@86) ?Call(85)

In fact, I am looking forward to Vedit+ 6.0,
when I will be able to add this command to the {Misc} menu.

-peter.

 


Topic: Load/trace user macro .. (2 of 4), Read 92 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Monday, March 19, 2001 02:42 AM

Another suggestion:

While developing a macro put this into it:

----------
// At the beginning (#90 as example):
?(#90==12345)

// ... your macro code ....

//At the end:
?(0)
----------

Additionally put that in your user.mnu:

8
Toggle Debug Mode
if(#90==12345){#90=0}else{#90=12345}

----------

So you are able to toggle the debug mode for those prepared macros on and off.

The final ?(0) is necessary to switch the conditional debug mode really off. Otherwise many VEDIT commands remain in debug mode after executing the debugged macro.
(Ted: I think this is a little bug?!).


Christian

 


Topic: Load/trace user macro .. (3 of 4), Read 95 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Monday, March 19, 2001 03:17 AM

[Next try. (HTML destroyed the commands last time...)]


This way the menu item shows the current debug state:

8
Toggle Debug Mode ON
#91=BN BS(BF) RS(91,'Toggle Debug Mode') RI(124,BEGIN) if(#90==12345){#90=0 R("|<|@(91)|Y|>","|@(91) ON")}else{#90=12345 R("|<|@(91)|Y|>","|@(91) OFF")} RE(91) BoF RC(124,ALL) BQ(OK) BS(#91)

(The 3rd line with the commands must be ONE single line of course!!)


Christian

 


Topic: Thanks Christian. (4 of 4), Read 82 times, 1 File Attachment
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Sunday, July 15, 2001 06:30 AM

On 7/14/2001 6:49:00 PM, Peter Rejto wrote:
>This project is a little bit over my head.

Huh, really? Most parts are already there...

>Looking forward to using your load/trace user macro.

O.k., o.k. ;-)

Here is my solution. It's a mixture out of your {USER} menu entry and my debug toggle.

I put it in my {TOOLS} menu, but it's easy to use it in the {USER} menu too: Just change "123" to "124" in the appropriate menu entry.

There are three entries:
1) Execute the macro in @100 (with or without debug)
2) Load/execute a macro (...)
3) Toggle the debug mode

There are no modifications in the executed macro(s) itself necessary!

If using debug mode you should open the command mode window before starting a debugged macro to easily see the steps.

(The debug toggle uses #90 as memory. That register shouldn't be used in your macros of course, or you have to change #90 to another one.)


Christian

 
TOOLS.MNU (1KB)