Skip to content
Tcl Source Code History Of Ticket 770849ffffffffff
Login

History Of Ticket 770849ffffffffff

Artifacts Associated With Ticket 770849ffffffffff

  1. Ticket change [3dbfc824c3] (rid 121145) by nobody on 2003-07-14 09:22:47:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Tcl Version: 8.4.1
      Os Platform: AIX 4.3.3.10
      
      Problem Behaviour:
      
      When I set a variable to 08 or 09 and then gives 
      increment command its fails, giving an ERROR "expected 
      integer but got "08" (looks like invalid octal number)".
      
      But if i assign value equals to 05 or 06 and then issue an 
      incr command it gives a proper result.
      
      Please refer the Wish output
      
      % set r 07
      07
      % incr r
      8
      % set r 08
      08
      % incr r
      expected integer but got "08" (looks like invalid octal 
      number)
      % info tclversion
      8.4
      % info patchlevel
      8.4.1
      % 
      
      
      So, the output must be consistent for all values, like 05 
      it must give an error while incrementing its value OR 
      ELSE for 08 and 09, it must not give an ERROR.
      
      
    4. foundin initialized to: "obsolete: 8.4.1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "07. Variables"
    10. title initialized to: "incr of neumeric values for '08' and '09' fails"
    11. type initialized to: "Bug"
  2. Ticket change [38c6aa11c0] (rid 112265) by msofer on 2003-07-14 18:04:28:

    1. closedate changed to: "2003-07-14T11:04:28"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      This is not really a bug ... although it bugs plenty of
      people. See for instance 
      http://sourceforge.net/tracker/?group_id=10894&atid=360894&func=detail&aid=623061
      
      Tcl will interpret a string of digits starting with 0 as an
      integer in base 8 (octal). Now 07 is a valid octal number
      (value seven), but 08 is not - the number eight is written
      010 as an octal. Hence the "looks like an invalid octal"
      message. In this sense, an invalid octal is a string of
      digits starting with 0 and containing at least an invalid
      octal digit (8 or 9).
      
      Workaround: remove a possible leading zero with 
          set r [string trimleft $r 0]
      and use [format] at the endofyour calculations if you need
      topad with zeros.
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "msofer"
  3. Ticket change [90ef2e1ffd] (rid 120541) by dkf on 2003-07-14 19:19:22:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Using [string trimleft] can be a bad idea if you might have
      to deal with the value 0.  A better workaround is to do:
        scan $r %d r
      (Otherwise, I agree 100% with the assessment.  There is a
      TIP to alter this behaviour, but it is not accepted yet.)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"