John L. Clark wrote: > On Tue, Dec 30, 2003 at 04:48:12PM -0700, Rick Lansky wrote: > >>My problem is that I have a macro that calls a command and I need to use >>the results of the command. I know that I can use the '%_' operator to get >>the results of the previously run command, but the problem is that I don't >>use the results until several commands later and it is impossible to change >>the order of the commands. I've tried copying the results of the command >>into the clipboard but I haven't been able to get that to work. Any >>suggestions? > > > I had a similar problem, and was equally stumped until Mr. Shafie > suggested the following solution. What you can do is encapsulate the > sequence of commands following the command that sets the '%_' variable > within a single new command, and pass the '%_' variable to that command > as a parameter, so that it will be accessible as '%0' for every command > located in the new command. For example (assuming a default namespace > of http://www.xmlmind.com/xmleditor/schema/configuration): > > <command name="trickyCommand"> > <macro> > <sequence> > <command name="somethingThatReturnsACriticalValue"/> > <command name="intermediary"/> > <command name="needsValueReturnedByFirstCommand"/> > </sequence> > </macro> > </command> > > Would become: > > <command name="wrapper"> > <macro> > <sequence> > <command name="intermediary"/> > <command name="needsValueReturnedByFirstCommand" > parameter="%0"/>> > </sequence> > </macro> > </command> > > <command name="trickyCommand"> > <macro> > <sequence> > <command name="somethingThatReturnsACriticalValue"/> > <command name="wrapper" parameter="'%_'"/> > </sequence> > </macro> > </command> > > If the instance of your problem is more complex than this, you might > want to post additional details to the mailing list.
Everything said by Mr Clark is correct. If your problem is more complex than this, I'm afraid you'll have to wait until XXE V2.6 is released (not before February 2004). Super macro-commands, featuring variables (among other things), will be available in this release. Note that today simple macro-commands are fully compatible with tomorrow super macro-commands.

