[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] String problem



use string compare ... look at 

http://www.sco.com/Technology/tcl/man-7.6-4.2/tcl7.6/string.n.html

debo


On Thu, 27 Sep 2001, Michael Gao wrote:

> Hi, all,
> 
> Who can tell me how to use the string in tcl scripts?
> 
> Why there alwasy an erro when I use the following if
> statement.
> "set name [lindex $argv 0]
> if {[expr name == "Tahoe"] } {
>     set name " "
> }"
> Error:
> syntax error in expression "name == Tahoe"
>     while executing
> "expr name == "Tahoe""
> 
> while there is no such problem when I use 
> if {[expr number == 1] } {
>     set name 2
> }
> 
> thanks a lot.
> 
> Michael
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Listen to your Yahoo! Mail messages from any phone.
> http://phone.yahoo.com
> 
>