Page 1 of 1 1
Topic Options
#120417 - 2004-06-01 10:56 AM Expression bigger than 32000 characters
mima Offline
Hey THIS is FUN

Registered: 2002-01-25
Posts: 217
Loc: Jönköping, Sweden
Hi
I have a textfile I read in a loop. One row has more than 32000 characters, and kix dump. In the manual it says like this:
Quote:


A string expression can contain up to 32,000 characters.





Code:

$TLine = ReadLine(1)
If Len($TLine) > 32000
? "More then 32000 characters"
? $TLine ; Now kix dumps
EndIf
$Rc = WriteLine(9,"$TLine" + @Crlf) ; Doesnt work



Has anyone any good idee how I can write this string ?

/Mima

Top
#120418 - 2004-06-01 12:35 PM Re: Expression bigger than 32000 characters
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
String manipulation is your problem. So long as you don't try to do anything to the string you should be ok.

Try this:
Code:
$TLine = ReadLine(1)
If Len($TLine) > 32000
"More then 32000 characters" ?
$TLine ?
EndIf

$Rc = WriteLine(9,$TLine)
$Rc = WriteLine(9,@CRLF)


Top
#120419 - 2004-06-01 04:54 PM Re: Expression bigger than 32000 characters
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Quote:

String manipulation is your problem. So long as you don't try to do anything to the string you should be ok.

Try this:
Code:
$TLine = ReadLine(1)

If Len($TLine) > 32000
"More then 32000 characters" ?
$TLine ?
EndIf

$Rc = WriteLine(9,$TLine)
$Rc = WriteLine(9,@CRLF)






Actually, you can work with string that have a length greater than 32000, just cant display them as is to the console window.

Code:

break on
$string = ""
do
$string = $string + "........"
? len($string)
until len($string) = 32000
do
$string = $string + ",,,,,,,,"
? len($string)
until Len($string) = (32000*2)

? "$$string at 1 = " + substr($string,1,1)
? "$$string at 32000 = " + substr($string,32000,1)
? "$$string at 32001 = " + substr($string,32001,1)
? "$$string at 64000 = " + substr($string,64000,1)



You will need to break up that long string to be able to display it.

And after closer look.... it seems that you can not display a string if its LEN is greater than 30704....



Top
#120420 - 2004-06-02 05:13 AM Re: Expression bigger than 32000 characters
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See also POLL: String Expressions . There might be a string length limit around 480 million characters (480MB) ;-)
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1077 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.052 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org