Reputation: 914
I am trying to check the value of a variable in a while loop
set resultReturn 0
while {expr $resultReturn == 0} {
# Apply the stream configurations.
set resultReturn [stc::apply]
}
I am getting the following error:
syntax error in expression "expr $resultReturn == 0": variable references require preceding $
What should be the correct way to check the variable in an infinite loop until it changes value from 0?
Upvotes: 0
Views: 289
Reputation: 5723
While takes a test as its first argument and processes it in the same manner as expr
.
while { $resultReturn == 0 } {
References: while
Upvotes: 3