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.
Old posts that have not been replied to for several years.
M
MikePT
Post
by MikePT » Thu Oct 21, 2004 2:13 pm
Hi,
I need to set a variable with an SQL statement (Very long one) to execute in MySQL but it seams that long strings doesn't work.
Even this doesnt work:
set testing "(Imagine that this string is 500 chars in length)"
What's the deal, is there any kind of limitation in string length?
spock
Master
Posts: 319 Joined: Thu Dec 12, 2002 8:40 pm
Post
by spock » Thu Oct 21, 2004 3:07 pm
works for me
Code: Select all
proc longstring l {
set i 0 ; set s ""
while { $i < $l } {
append s a
incr i
}
puts $s
puts [string length $s]
}
% longstring 1000
"a x 1000"
1000
%
edit: had to sidescroll a bunch with all them a's
photon?
M
MikePT
Post
by MikePT » Thu Oct 21, 2004 3:29 pm
Works for me like this:
Code: Select all
set l 100
set i 0
set s ""
while { $i < $l } {
append s a
incr i
}
puts $s
puts [string length $s]
if do this doesn't work
Code: Select all
set l 1000
set i 0
set s ""
while { $i < $l } {
append s a
incr i
}
puts $s
puts [string length $s]
It seams that strings have a limit
i am using Activetcl 8.4.7 for Windows and Windrop (eggdrop for windows)
M
MikePT
Post
by MikePT » Fri Oct 22, 2004 11:35 am
Does anyone have this problem? I am getting out of options, i cant compact my sql statement (MySQL 4.0 does not support nested selects)
M
MikePT
Post
by MikePT » Mon Oct 25, 2004 7:01 am
correction, this works with tclsh
Code: Select all
set l 1000
set i 0
set s ""
while { $i < $l } {
append s a
incr i
}
puts $s
puts [string length $s]
This doesn't work with windrop:
Code: Select all
set l 500
set i 0
set s ""
while { $i < $l } {
append s a
incr i
}
putserv "NOTICE $nick : $s"
So it must be a windrop problem, or a cygwin problem, any thoughts?
KrzychuG
Master
Posts: 306 Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:
Post
by KrzychuG » Mon Oct 25, 2004 8:52 am
I'm not sure about other ircds, but IRCnet version limit maximum characters, which can be send to server in one line to 480.
Que?
M
MikePT
Post
by MikePT » Mon Oct 25, 2004 11:41 am
KrzychuG wrote: I'm not sure about other ircds, but IRCnet version limit maximum characters, which can be send to server in one line to 480.
I guess that it the problem... i changed my code to this:
Code: Select all
putserv "NOTICE $nick : Test..."
set l 500
set i 0
set s ""
while { $i < $l } {
append s a
incr i
}
set dimension [string length $s]
putserv "NOTICE $nick : $dimension"
putserv "NOTICE $nick : $s"
And it sent two NOTICES:
Test...
500
I guess it's solved, thanks