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.

?? how does split work

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:

?? how does split work

Post by Ofloo »

hmm euhm

why does it not work it is supposed to split on \ and set the first ans last to an var so i can output them in different places ..

Code: Select all

set fline0 [split $line \"]
set fline1 [lindex $arg 0]
set fline2 [join [lrange $arg 1 end]]
i gues i am doing something wrong again with lrange and lindex cause when i putserv fline1 or fline2 there emty? and if i remove the quote of \"
cause its \ actualy where it has to split it says something about a quote that isn't closed well that i need to close it down so i did...
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 set fline0 [split $line \\]

I added the second \ to make the bot read the \ because it is used to skip commands.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

tryed that tryed it again no result ..
XplaiN but think of me as stupid
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

set fline0 [split $line {"}] 
Elen sila lúmenn' omentielvo
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Don't you want to split a \ from something?
Once the game is over, the king and the pawn go back in the same box.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

Yes and i tryed {\} and it doesn't work either ... its a path : test\test1

and it's the second parameter i need it is shown like that ... :/
XplaiN but think of me as stupid
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Ofloo wrote:Yes and i tryed {\} and it doesn't work either ... its a path : test\test1

and it's the second parameter i need it is shown like that ... :/
Might I suggest you take a look at the "file tail" command in the tcl manpages then.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

great it works tnx man ;)

for those who want to use it:

Code: Select all

set dline [file tail $line]
putserv ... $dline
[/code]
XplaiN but think of me as stupid
Locked