Overview
| Artifact ID: | a32e44f3ca661d2c029248bea673db24c68881ce |
|---|---|
| Ticket: | 219153ffffffffffffffffffffffffffffffffff
"!" operator can't handle string booleans |
| User & Date: | nobody on 2000-10-26 05:02:22 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 1194 RFE Version: 8.1b1 SubmitDate: '1999-02-11' LastModified: '1999-12-03' Severity: LOW Status: Assigned Submitter: pat ChangedBy: hobbs RelatedBugIDs: 616 OS: Linux OSVersion: 2.0.35 Machine: Other FixedDate: '2000-10-25' ClosedDate: '2000-10-25' Name: Steve McAndrewSmith ReproducibleScript: # These all work fine ... set b 1 if { $b } { puts "ooga" } set b 0 if { ! $b } { puts "ooga" } set b yes if { $b } { puts "ooga" } set b no if { $b } { puts "no ooga" } else { puts "ooga" } if { ($b && $b) || $b } { puts "ooga ooga ooga" } # This produces an error.: can't use non-numeric string as operand of "!" if { ! $b } { puts "GAKK!" } ObservedBehavior: When using string boolean values (e.g. "true", "false", "yes", "no") in if expressions, the negation operator ("!") does not recognize the strings as boolean values. Only "0" and "1" are correctly accepted. It gives the following error: can't use non-numeric string as operand of "!" However, both "&&" and "||" (and probably others) accept these boolean strings correctly. DesiredBehavior: "!true", "!false", "!yes", and "!no" should all evaluate correctly. This is not the defined behavior. 03/23/1999 18:13 - surles - - foundin changed to: "obsolete: 8.1b1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "10. Objects"
- title changed to: ""!" operator can't handle string booleans"
- type changed to: "Bug"