Altera_Forum
Honored Contributor
14 years agoModelsim: alias to loop a command
I'm trying to create a modelsim alias command which loops another command a specific number of times.
From the command line I can use a Tcl for loop such as this to execute the command A (yet another alias) five times: for {set x 0} {$x < 5} {incr x} A If I create an alias called ten defined to the above command such as this: alias ten "for {set x 0} {$x < 5} {incr x} A" it appears that the variable x is being evaluated rather than used as a variable. So if I issue the command "alias ten" from the command line, what is echoed is: ten=for {set x 0} {0 < 5} {incr x} A Is there some trick to maintain variables in an alias? Or, is there a better way to loop a command via alias? Thanks, -phil