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.

break a script on certain chars ..

Old posts that have not been replied to for several years.
Locked
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

break a script on certain chars ..

Post by Ofloo »

how do i do this

the match with a var and if the var contains [] i want to disable it but how do i do that ..?

Code: Select all

if {[string match *[*]* $var] || [string match *{*}* $var] == 1} {
  putserv "privmsg $chan :Your string contains invalid chars !"
  break
}
XplaiN but think of me as stupid
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

try

Code: Select all

if {[string match *\[*\]* $var] || [string match *\{*\}* $var]} { 
  putserv "privmsg $chan :Your string contains invalid chars !" 
  break 
}
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

tryed that didn't work either so found a way arround it tnx for replying tho
XplaiN but think of me as stupid
User avatar
Souperman
Halfop
Posts: 69
Joined: Sat Feb 02, 2002 8:00 pm
Location: Cape Town, South Africa
Contact:

Post by Souperman »

Instead of trying to devise unnecessary workarounds to problems with special chars, rather try and write your script correctly in the first place. Read http://www.peterre.com/characters.html.
Quick! Somebody get me a new ink cartridge
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

thats a way arround it as well dude it always will be a way arround it there is no correct way its not cause someone has written it down that it is a correct way ! it nice way but its a way arround it just the same as mine :p

A write way would be an index way of tcl it self !

like: largs or something what ever then you would be able to say that it is the best way but this is scripting so i don't thing there is a write way on the other hand best way is in every ones opinion depending what you know and what is easyest to understand for your self

So concluding this there is no write way to solve this only suggestions that are ways arround it

Tnx for the info tho ;)
XplaiN but think of me as stupid
Locked