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.

some small problem

Old posts that have not been replied to for several years.
Locked
d
dopestar

Post by dopestar »

hi there
i constantly get the error "unmatched open quote in list" whenever i try to save a topic including one or more "s to a file. anybody knows how to get rid of this? thx =)
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This usualy happens when you start handling a list as a string.

You would have to show use the offending code to see any way of fixing it.
d
dopestar

Post by dopestar »

well i try to read the infos from the file the following way:
--- cut ---
set temp [gets $dateichen ]
close $dateichen
set nickname [lindex $temp 0]
set channel [lindex $temp 1]
set hostmask [lindex $temp 2]
set weekday [lindex $temp 3]
set month [lindex $temp 4]
set day [lindex $temp 5]
set daytime [lindex $temp 6]
set year [lindex $temp 7]
set info [lrange $temp 8 [llength $temp]]
--- cut ----
well if $info contains an " then i get the error, thats it
any idea?

<font size=-1>[ This Message was edited by: dopestar on 2001-11-20 08:59 ]</font>
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

As stated, you are trying to perform list command on a string.

Simply changing

Code: Select all

set temp [gets $dateichen]
to

Code: Select all

set temp [split [gets $dateichen]]
should fix the problem.
d
dopestar

Post by dopestar »

well thx, but it fixes ony half of the problem. now if there is a quote for example
"bla blal bla bla" bla

the tcl changes it to

"{bla} bla bla" bla

any ideas?
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

Dopestar,

the reason for the added characters is that your variable $info now has become a list of separated items. You will have to "join" these separated items. Something like:

set info [join [lrange $temp 8 [llength $temp]]]

For some reason list operations on strings are often used in eggdrop tcl's.
Why not using a (faster) string operation (scan) on a string?

gets $fd temp
close $dateichen

scan $temp "%s %s %s %s %s %s %s %s %[^n]" nickname channel hostmask weekday month day daytime year info

Make sure that the total number of items (9: nickname, channel etc.) is available, else the scan will break.
d
dopestar

Post by dopestar »

thx very much guys
Locked