This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
-
keeper2
- Voice
- Posts: 12
- Joined: Wed Jul 19, 2006 10:16 am
Post
by keeper2 »
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.
-
krimson
- Halfop
- Posts: 86
- Joined: Wed Apr 19, 2006 8:12 am
Post
by krimson »
so you want to check if '*' is anywhere in your string? or only at the beginning?
Code: Select all
if {[string first * $oper 0] >0} {
#this will check if there's at least one '*' in $oper
}
-
keeper2
- Voice
- Posts: 12
- Joined: Wed Jul 19, 2006 10:16 am
Post
by keeper2 »
krimson wrote:so you want to check if '*' is anywhere in your string? or only at the beginning?
Code: Select all
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
-
keeper2
- Voice
- Posts: 12
- Joined: Wed Jul 19, 2006 10:16 am
Post
by keeper2 »
if {[string first * $oper 0] < 0} {
#this will check if there's at least no '*' in $oper
}
OK have it
Thanks for help!
-
krimson
- Halfop
- Posts: 86
- Joined: Wed Apr 19, 2006 8:12 am
Post
by krimson »
i misinterpreted your request.. my bad :roll: