expected integer but got "08"



Hi!

If you do:

if {07 < 100} {
puts a
}
it works.

But if I do:
if {08 < 100} {
puts a
}
I get: expected integer but got "08"

Why is that?

I can remove the leading 0 with:

proc stripzeros {value} {
regsub ^0+(.+) $value \\1 retval
return $retval
}

But I don't understand why I get an error with 08 but 07 works.

Can someone shed some light on this for me please?
.



Relevant Pages

  • Re: expected integer but got "08"
    ... expected integer but got "08" ... ascii ribbon campaign -- against html e-mail ... /\ www.asciiribbon.org -- against proprietary attachments ...
    (comp.lang.tcl)
  • Re: expected integer but got "08"
    ... Your regsub is OK but it's a lot of heavy machinery for ... [string trimleft $value 0] ... you are confident you'll never get exactly zero (good for ...
    (comp.lang.tcl)
  • Re: Quoting question
    ... % puts $a ... substitued to values due to the brackes. ... regsub sees $rep and not the ...
    (comp.lang.tcl)
  • Re: string substitution excluding characters inside a double quotes
    ... don't kow the way I should use "regsub" commands? ... puts $xo ... then do the regsub on every other ... proc doSub {xin} { ...
    (comp.lang.tcl)
  • Re: Regsub/pipes question
    ... add the -inline switch to have regsub return the modified string, ... it puts it in the variable provided ... which produces "howdy world". ...
    (comp.lang.tcl)