*Repeat macro
Julie Stamp (8365) 474 posts |
Repeat is handy. I’d like to be able to go something like
At the moment I’d make an ObeyFile with the line “SetType %0 BBCFont” and call that as the first argument to repeat instead. |
GavinWraith (26) 1563 posts |
Unfortunately Repeat appears to evaluate its arguments first. What you need is lazy semantics for commands, not eager. Because the Obeyfile command language is first order, the only way to use lambda expressions (what comes within your double-quotes) is as separate Obey files. I do not know of any command-shell languages that are higher order, but I would be glad to be corrected. |
Ronald (387) 195 posts |
At the moment I’d make an ObeyFile The repeat command can also be an alias, to a limit, then it is better in an obey file. |
Stuart Swales (1481) 351 posts |
+1 for Ronald’s suggestion of using aliases. This is what I do in my Obey files with Repeat. |
Julie Stamp (8365) 474 posts |
You could have a *DoMacro command instead to do it anonymously:
|
David Gee (1833) 268 posts |
If you’re interested in iterating over files and/or directories, there was a very useful article in Archive 23.1. It might be particularly useful to look at Steve Revill’s |
edwardx (1628) 37 posts |
The *Repeat command has a third argument called <tail>, but it’s buried among various switches when you try *Help Repeat. Ignoring the switches, the syntax of *Repeat is:
So what you want can be achieved by:
|
Ronald (387) 195 posts |
The *Repeat command has a third argument called I haven’t used this in the past, thanks for bringing it to my/our attention, makes things tidier. |