by Spike » Fri May 20, 2011 3:32 am
cmd_registercmd("while", mywhile_f);
void mywhile_f(void)
{
if (evaluate(argv(1)) == false)
cbuf_addtext(va("%s\n%s %s\n", argv(2), argv(0), args());
}
would probably do an effective enough while loop. quote the body, or use a single alias for that.
failing that you can always peek ahead in the cbuf and invoke Cmd_Execute directly on the commands up until your 'stop' directive, thus meaning you can add continue/break properly.
or just splice the cbuf execution code directly for intermingling of if/for/do-while/while/switch/etc.
if that's not overkill
.