On Mon, 15 Dec 2003, Tom Jackson wrote:

> I'm trying to see if a value is an integer, using:
>
> if {[string is integer "${var}"]} {
>   do something
> }
>
> When var is the empty string it returns true, so I have to use:
>
> if {!("" eq "${var}) && ...
>
> Is this a bug, or expected behavior?

This is expected behavior.  What you want is:

    [string is integer -strict $var]

All of the [string is] commands return true for the empty string, unless
the -strict flag is given.

Michael


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of 
your email blank.

Reply via email to