Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e35697e651682047ba292137c488d3ce18fe6af2
Ticket: 218393ffffffffffffffffffffffffffffffffff
expr 08 + 1 will error
User & Date: nobody on 2000-10-26 00:57:02
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 5059 Bug
    Version: 1.3
    SubmitDate: '2000-04-13'
    LastModified: '2000-04-13'
    Severity: SER
    Status: Closed
    Submitter: techsupp
    ChangedBy: hobbs
    OS: Linux
    OSVersion: Mandrake 7.0(TclPro1.3 & TCL/TK8.0) & IRIX6.5(TCL/TK 8.0)
    Machine: Intel PIII-500 Linux & SGI Origin200
    FixedDate: '2000-10-25'
    ClosedDate: '2000-04-13'
    
    
    Name:
    Feng Lei
    
    ReproducibleScript:
    #!/usr/local/bin/wish
    
    set NUM 1
    while {$NUM < 12} {
    #  set  NUM [expr $NUM + 1]
       incr NUM
       set  NUM [format "%02d" $NUM]
       puts $NUM
    }
    exit
    
    ObservedBehavior:
    OUTPUT:
    02
    03
    04
    05
    06
    07
    08
    Error in startup script: expected integer but got "08"
        while executing
    "incr NUM"
        (file "String_Format.tcl" line 8)
    
    
    IF I set the NUM=8 it aslo can not run properly.
    09
    Error in startup script: syntax error in expression "09 + 1"
        while executing
    "expr $NUM + 1"
    
    DesiredBehavior:
    It is very easy calculated, but he not understand!
    
    
    
    Tcl8.3 explains this error with a better message:
    
    weasel [tcl8.2/unix/sol251] 41 % tclsh8.3
    % expr 08
    "08" is an invalid octal number
    
    See the docs for more info. 
    -- 04/13/2000 hobbs
    
  4. foundin changed to: "obsolete: 8.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "expr 08 + 1 will error"
  11. type changed to: "Bug"