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 

uncomment a *

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


Joined: 19 Jul 2006
Posts: 12

PostPosted: Fri Jul 21, 2006 9:49 am    Post subject: uncomment a * Reply with quote

OK I have the following

set oper [lindex [split $arg " "] 6]
if {[string match "*" $oper]} {
...
}

So my problem is now I want to test if the * isin the variable oper, but so it get interpreted as any character.
Back to top
View user's profile Send private message
krimson
Halfop


Joined: 19 Apr 2006
Posts: 86

PostPosted: Fri Jul 21, 2006 10:19 am    Post subject: Reply with quote

so you want to check if '*' is anywhere in your string? or only at the beginning?

Code:
if {[string first * $oper 0] >0} {
  #this will check if there's at least one '*' in $oper
}
Back to top
View user's profile Send private message Send e-mail
keeper2
Voice


Joined: 19 Jul 2006
Posts: 12

PostPosted: Fri Jul 21, 2006 10:35 am    Post subject: Reply with quote

krimson wrote:
so you want to check if '*' is anywhere in your string? or only at the beginning?

Code:
if {[string first * $oper 0] >0} {
  #this will check if there's at least one '*' in $oper
}


seems not to work. I want to test if in the variable $oper is no '*'.

if {![string first * $oper 0] >0} {
#this will check if there's at least no '*' in $oper
}

^^that doesnt't work Sad
Back to top
View user's profile Send private message
keeper2
Voice


Joined: 19 Jul 2006
Posts: 12

PostPosted: Fri Jul 21, 2006 10:42 am    Post subject: Reply with quote

if {[string first * $oper 0] < 0} {
#this will check if there's at least no '*' in $oper
}

OK have it Smile
Thanks for help!
Back to top
View user's profile Send private message
krimson
Halfop


Joined: 19 Apr 2006
Posts: 86

PostPosted: Fri Jul 21, 2006 11:12 am    Post subject: Reply with quote

i misinterpreted your request.. my bad :roll:
Back to top
View user's profile Send private message Send e-mail
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