Artifacts Associated With Ticket 218895
Ticket change [9891748bef] (rid 110624) by nobody on 2000-10-26 01:07:20:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 2587 Bug Version: 8.0p2 SubmitDate: '1999-08-20' LastModified: '1999-08-20' Severity: CRIT Status: Released Submitter: techsupp ChangedBy: hobbs OS: Other OSVersion: Win98, WinNT4.0 Machine: NA FixedDate: '1999-08-20' FixedInVersion: 8.0.5 ClosedDate: '2000-10-25' Name: Stuart Smith Extensions: No extensions have been loaded CustomShell: Only the addition of Icons into the wish80.exe file - modification of the RC file only ReproducibleScript: We are moving towards 8.0.5 from 8.0p2 so that we can make use of TCL Pro (the compiler side) and I have noticed an anomoly in the way info exists works. Below is a small script file that works as expected under 8.0p2, yet fails under 8.0.5. This test script was performed within a 'clean' Wish80 console. set smeg(1,1) 1 set smeg(2,1) 2 set smeg(3,1) 3 set smeg(4,1) 4 set smeg(5,1) 5 set smeg(6,1) 6 set smeg(7,1) 7 set smeg(8,1) 8 set smeg(9,1) 9 set smeg(10,1) 10 set smeg(11,1) 11 set smeg(12,1) 12 set smeg(13,1) 13 set smeg(14,1) 14 set smeg(15,1) 15 set smeg(16,1) 16 set smeg(17,1) 17 set count 1 while [info exists smeg($count,1)] { puts "Looking at smeg($count,1) which contains $smeg($count,1)" incr count } ObservedBehavior: Under 8.0p2, the routine displays the following:- Looking at smeg(1,1) which contains 1 Looking at smeg(2,1) which contains 2 Looking at smeg(3,1) which contains 3 Looking at smeg(4,1) which contains 4 Looking at smeg(5,1) which contains 5 Looking at smeg(6,1) which contains 6 Looking at smeg(7,1) which contains 7 Looking at smeg(8,1) which contains 8 Looking at smeg(9,1) which contains 9 Looking at smeg(10,1) which contains 10 Looking at smeg(11,1) which contains 11 Looking at smeg(12,1) which contains 12 Looking at smeg(13,1) which contains 13 Looking at smeg(14,1) which contains 14 Looking at smeg(15,1) which contains 15 Looking at smeg(16,1) which contains 16 Looking at smeg(17,1) which contains 17 under 8.0.5 it displays the following:- Looking at smeg(1,1) which contains 1 Looking at smeg(2,1) which contains 2 Looking at smeg(3,1) which contains 3 Looking at smeg(4,1) which contains 4 Looking at smeg(5,1) which contains 5 Looking at smeg(6,1) which contains 6 Looking at smeg(7,1) which contains 7 Looking at smeg(8,1) which contains 8 Looking at smeg(9,1) which contains 9 Looking at smeg(10,1) which contains 10 Looking at smeg(11,1) which contains 11 Looking at smeg(12,1) which contains 12 Looking at smeg(13,1) which contains 13 Looking at smeg(14,1) which contains 14 Looking at smeg(15,1) which contains 15 Looking at smeg(16,1) which contains 16 Looking at smeg(17,1) which contains 17 can't read "smeg(18,1)": no such element in array DesiredBehavior: I would have expected both outputs to be exatly the same. The info exists command should have caught the fact that element 18,1 does not exist and fail the while statement, allowing the program to terminate without warnings. Actually, this was a bug in 8.0p2 and is fixed in 8.0.5. This line: while [info exists smeg($count,1)] { is a programming error. Following Tcl syntax, the [] is only eval'd the first time, to 1. Then the loop continues until an error occurs. Conditionals require braces in almost all cases. -- 08/20/1999 hobbs - foundin initialized to: "obsolete: 8.0p2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "info exists command - invalid return code"
- type initialized to: "Bug"
Ticket change [77d039437f] (rid 89837) by welch on 2000-10-26 08:31:15:
- closedate changed to: "2000-10-26T01:31:15"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [829e26cd63] (rid 117264) by dgp on 2001-04-16 20:20:47:
- closedate changed to: "2001-04-16T13:20:47"
- closer changed to: "dgp"
- subsystem changed to: "47. Bytecode Compiler"