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 

Replace element in list with white space

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


Joined: 15 Mar 2015
Posts: 317

PostPosted: Tue Jan 24, 2017 4:20 pm    Post subject: Replace element in list with white space Reply with quote

The list is stored in the cursong variable
Example: if the cursong variable returns: Another&Brick&In&The&Wall&Pink&Floyd
To return: Another Brick In The Wall Pink Floyd
I try:
Code:
set cursong [string map [list "&" " "] $cursong]

But, no work
_________________
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks Smile
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Tue Jan 24, 2017 10:28 pm    Post subject: Re: Replace element in list with white space Reply with quote

juanamores wrote:
The list is stored in the cursong variable
Example: if the cursong variable returns: Another&Brick&In&The&Wall&Pink&Floyd
To return: Another Brick In The Wall Pink Floyd
...


<myhandle> .tcl split "Another&Brick&In&The&Wall&Pink&Floyd" &
<botnick> Tcl: Another Brick In The Wall Pink Floyd
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Tue Jan 24, 2017 11:04 pm    Post subject: Re: Replace element in list with white space Reply with quote

juanamores wrote:
The list is stored in the cursong variable
Example: if the cursong variable returns: Another&Brick&In&The&Wall&Pink&Floyd
To return: Another Brick In The Wall Pink Floyd
I try:
Code:
set cursong [string map [list "&" " "] $cursong]

But, no work


This does work.

<me> .tcl string map [list "&" " "] "Another&Brick&In&The&Wall&Pink&Floyd"
<botnick> Tcl: Another Brick In The Wall Pink Floyd
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Fri Jan 27, 2017 8:15 pm    Post subject: Reply with quote

There was another line in the script that modified the command. Embarassed
Both solutions work perfectly

Thank you willyw! Very Happy
_________________
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks Smile
Back to top
View user's profile Send private message
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