egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Lsearch HELP!

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
eric
Voice


Joined: 20 Oct 2005
Posts: 1

PostPosted: Sun Apr 16, 2006 2:09 pm    Post subject: Lsearch HELP! Reply with quote

I need help with my script, i have problem with lsearch command, return bad value

Script:

#make a list
set List1 [list 5,83.21,Text1,text1 3,83.22,TeXt2,text2 1,83,23,Tex[t,tex[t]

# List1 = {5,83.21,Text1,text1 3,83.22,TeXt2,text2 1,83,23,Tex[t,tex[t}

#list search
set Var1 {tex[t}
set Var2 "*,$Var1"
set VarIndex [lsearch $List1 $Var2]

VarIndex is set 0, when it must set 2.

Somebody can help me? Crying or Very sad
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Apr 16, 2006 3:39 pm    Post subject: Reply with quote

Because [ has a special meaning in glob match. Try skipping it (i.e. use \[ instead of just [).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber