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.

sorted informations

Old posts that have not been replied to for several years.
Locked
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

sorted informations

Post by EEggy »

Hi,

i'll apprecite for the help, i am trying to get the bot's known users informations from the userlist and wanted to write to the file, and i wanted to sort it with "person Handle"

bind pub m .reveiw chan_reveiw
proc chan_reveiw {nick uhost hand channel args} {

foreach u [userlist -b+o] {
set ss [getuser $u LASTON]
if {$ss == 0} {set ss -}

set e [getuser $u XTRA EMAIL]
if {$e == ""} {set e -}

set ssss [getuser $u XTRA HANDLE]


putserv "NOTICE $nick : Handle: $ssss"
putserv "NOTICE $nick : Laston:$ss"
putserv "NOTICE $nick : Email:$e"


}
}

i don't know how to sort and then write to the file
output like

Handle: xyz
Laston: Nov. 10
Email: email@email.com

then space
and then next...


thanks
EEggy
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

TCL Manual

commands :
open
puts
close
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

Post by EEggy »

Thanks, but let say i wanted to sort the information by Email?
EEggy
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

EEggy wrote:Thanks, but let say i wanted to sort the information by Email?
To be able to sort something you need to collect it first. And if what you want to sort on is a certain piece of that something you need a way to tell it apart from the rest. Use a list to store the information about each user and add this list to another list. That way you can sort using 'lsearch' with the -index option.

Check out list, lindex, lappend and lsort.
Have you ever read "The Manual"?
Locked