#120417 - 2004-06-01 10:56 AM
Expression bigger than 32000 characters
|
mima
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
   
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
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 837 anonymous users online.
|
|
|