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 

Changing something toupper?

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


Joined: 09 Mar 2006
Posts: 18

PostPosted: Thu Mar 23, 2006 4:48 am    Post subject: Changing something toupper? Reply with quote

How can I change second toupper before i write/echo/whatever to file/chan when using this?
Code:
foreach {first second} [split $arg] {break}
or
Code:
set first [lindex [split $arg] 1]
set second [lindex [split $arg] 2]

(I belive the first one is faster code than the last one, correct?)
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Mar 23, 2006 1:39 pm    Post subject: Reply with quote

To convert second to topupper
Code:
set second [string toupper $second]



And
Code:
set first [lindex [split $arg] 1]
set second [lindex [split $arg] 2]

is different than
Code:
foreach {first second} [split $arg] {break}

since the 2nd code takes the first and second words while the 1st takes the second and the third words. You need to start with index 0, so first is [lindex [split $arg] 0] and second is [lindex [split $arg] 1].
_________________
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