1

I am using the tclsh interpreter and the Synopsis Primetime shell. Both are not supporting that kind of loop. is there something that I am missing here?

Thanks a lot

I am trying to perform a very standard for loop

Raul
  • 11
  • 1

1 Answers1

1

I think you just a syntax error. This works for me:

for {set x 0} {$x<10} {incr x} {
    puts "x is $x"
}

Outputs:

x is 0
x is 1
x is 2
x is 3
x is 4
x is 5
x is 6
x is 7
x is 8
x is 9
TrojanName
  • 4,853
  • 5
  • 29
  • 41
  • 1
    Yes thank you! My problem was that I did not put a space between the curly braces in "for {}{}{}" as you did. – Raul Feb 10 '23 at 11:33
  • 3
    You might want to review [the 12 rules of Tcl syntax](https://www.tcl-lang.org/man/tcl8.6/TclCmd/Tcl.htm). This is #3: commands are made out of space-separated words. – glenn jackman Feb 10 '23 at 11:44