Macro: Using captured strings (from a replace) in subsequent code?

Joerg Fischer jf505 at gmx.de
Sun Dec 31 13:03:26 CET 2006


Tony Balinski wrote:

> Joerg's suggestion of having a subexpression array is an excellent one,

Well, it was Joachim's suggestion.  

> however. Doing things as described above is clumsy.

This is the point.  We could also drop arrays from the macro
language and work around not having them, but this would be clumsy. 

Moreover, talking about searches, I found it useful occasionally if
one would have access to the search history. When the macro language
had no arrays, it wasn't clear how to have a structured access to
the search history, that is, access to the search strings and the
type of the search (literal, case or regex). Now it should be
possible to have a double array called
$search_history[n]["string"/"type"].

Another limitation, well-known and unfortunately not so obvious to
solve, is the fact that _actions_ can't have return values, can't
even tell you whether they've succeeded or not. Okay, on failure
some of them can beep, but then, you know, my macro can't hear the
beep and act accordingly, so one is at a loss already even if one
just tries to do very simple things. But for this topic, I need to
change the subject line...

(If actions can't return values, couldn't we have at least a global
variable like $last_action_succeeded yes or no?)

Cheers,
Jörg


More information about the Discuss mailing list