Overview
| Artifact ID: | 1abf1ca0e8b381485de4ed6dd2f84d3bf8398ef4 |
|---|---|
| Ticket: | 410043ffffffffffffffffffffffffffffffffff
"if" does not evaluate same as "expr" |
| User & Date: | nobody on 2001-03-20 16:17:01 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
The following script produces strange output. Script: #----------------------------------------------- set vmin 1.3 set vmax 1.7 set idx 4 set incr 0.1 set newval [expr {$vmin+int($idx)*$incr}] if { $newval > $vmax } { puts "Bare 'if' says $newval > $vmax" } else { puts "Bare 'if' says $newval <= $vmax" } if { [expr $newval > $vmax] } { puts "'if' with expr says $newval > $vmax" } else { puts "'if' with expr says $newval <= $vmax" } #----------------------------------------------- Output: Bare 'if' says 1.7 > 1.7 'if' with expr says 1.7 <= 1.7 As you see, the "if" command returns a different answer depending on whether or not you use expr. - foundin changed to: "obsolete: 8.3"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "45. Parsing and Eval"
- title changed to: ""if" does not evaluate same as "expr""
- type changed to: "Bug"