I program in TCL, now in some of my codes, I'm using hebrew (language) vars, my problem is, then when the var is a hebrew channel,
the program can't do if on it like doing:
if {($hebchanvar1 == $hebchanvar2)} { ... }
or
if {([info exists hebchanvar])}
the problem is kind of critical so I can't skip the check
anyone know what is the problem?
Thanks
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
The value's are hebrew chans
and I think that will work, because [string match does work
but I need it to work with info exists and to get the value, it's more in a list...
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
It doesn't matter what is stored in the variable, info exists will work if you are using it correctly. Make sure if it's a global variable that you used the "global" command before "info exists".
The var of the list is in english, the lines of the list are in english and hebrew chans, and the contents are or in english or in hebrew
and if it is a hebrew chan, in info exists, or when I try to reach the value,
it say it's empty, anyone has answer please?
thanks
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
In my tests, "info exists" works perfectly no matter what the value of the variable is. So you must be doing something else wrong. Maybe you can paste some actual code, with the values you use, and show us.
if {(![info exists cbot([strlwr $target])])} { ....
if the $target is hebrew chan, it will show always true..., that no info exists in there, but the info is there...
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
So you're not using your own hebrew variable, you're using one passed from an eggdrop bind.
Most likely, the problem is that when you set the variable in your script, it's using the utf-8 encoding, but when eggdrop creates the variable for the bind, it's not. Try using the tcl "encoding" command to convert the hebrew value.
Maybe a better, easier approach, is to use setudef to store information about each channel. That way, instead of
Use that "if" inside the proc to see if that channel has the specified channel flag. Read in the tcl-commands.doc file the coments about the "setudef". By default is set to 0, as disabled.
Once the game is over, the king and the pawn go back in the same box.
Whatever you store in your list, you can also store with channel set and retrieve with channel get. Of course, you don't have to do this. Have you looked at the encoding command? Check docs at www.tcl.tk