View Full Version : Using EvalDeferred commands in sequence

10 October 2005, 06:25 PM
I am trying to do a script where I wanna use several eval deffered command in sequence to run several differet scripts. Trick is that they have to happen in the correct order.

sending the commands like this gets inconsistant results:

evalDeferred $cmd1;
evalDeferred $cmd2;
evalDeferred $cmd3;
evalDeferred $cmd4;

It usually ends up running the commands in this order.


which is not what I would expect. Is there anyway to make sure these all run in the correct order that I sent the commands in?


10 October 2005, 04:18 AM
You might want to try wrapping your sequence of a command in a procedure, then executing that procedure.

global proc cmds()

global proc stuff()
// Do some stuff

or alternatively, you can build a semicolon list of sequential commands, and then execute them:

global proc stuff()
evalDeferred($cmd1 + ";" + $cmd2 + ";" + etc);

or you could probably get away with using just eval statements. Those usually behave pretty well and execute in order. I find myself very rarely having to use evalDeferred.

CGTalk Moderation
10 October 2005, 04:18 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.