would someone be able to point out what i might be doing wrong with this little script:
if { $whoisuserhand != "*" } {
set whoisuserinfo [getuser $whoisuserhand INFO]
if { ($whoisuserinfo != "") || ($whoisuserinfo != "*") } {
set whoisinfofile [open $whoisusernick-userinfo.tmp a]
puts $whoisinfofile "Info: $whoisuserinfo"
close $whoisinfofile
}
}
the problem occurs that even if "$whoisuserinfo == *" the rest of the script is still run, even though as far as i can see it should be missing out that part of the script if $whoisuserinfo == "" or "*"
would someone be able to point out what i might be doing wrong with this little script:
if { $whoisuserhand != "*" } {
set whoisuserinfo [getuser $whoisuserhand INFO]
if { ($whoisuserinfo != "") || ($whoisuserinfo != "*") } {
set whoisinfofile [open $whoisusernick-userinfo.tmp a]
puts $whoisinfofile "Info: $whoisuserinfo"
close $whoisinfofile
}
}
the problem occurs that even if "$whoisuserinfo == *" the rest of the script is still run, even though as far as i can see it should be missing out that part of the script if $whoisuserinfo == "" or "*"
am i missing something?
thanks
Simon
In words you state it like: if $whoisuserinfo == "" or "*", but in code you state it differently.
If "whoisuserinfo == *":
- what will ($whoisuserinfo != "") evaluate too? TRUE or FALSE?
- what will ($whoisuserinfo != "*") evaluate too? TRUE or FALSE?
- And what will { ($whoisuserinfo != "") || ($whoisuserinfo != "*") } evaluate too?
(Read the last statement as: if "this is true" or "that is true" then ... or read it like: if {(*!="") || (*!=*)} then ...)
I want to make it so that if $whoisuserinfo returns a value which IS NOT "" (as in blank) or a * then it would execute that particular part of the script.
so in words if $whoisuserinfo returns nothing, or returns a *, i want nothing to happen, but if it contains anything else, i want the script to run.