#74536 - 2003-04-15 02:45 AM
Writeline Limitations
|
bleonard
Seasoned Scripter
   
Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
|
I have a project where I must create a single-line upload file. Through testing it appears KiX is limited to 31,999 characters that can be written on a single line. My question, does anyone know if such a write process truly writes 31,999 characters on a single line? I script w/Notepad, and its limits of 1024-characters makes it appear that the file has 32 lines (using GOTO Line brings me to additional lines). My guess is the process writes properly as a single line, but I've no other tools to verify.
Can anyone help me with this? I'd appreciate it.
Bill
My simple test script:
code:
$Fil = "C:\Temp\wl.txt" $Idx=0 $Chk=31999 $Char=A OPEN (1, $Fil, 5) DO $Char=$Char + "A" $Idx=$Idx+1 ? "Idx: $Idx" UNTIL ($Idx = $Chk) $wri = writeline (1, "$Char" + @CRLF) CLOSE (1)
|
|
Top
|
|
|
|
#74537 - 2003-04-15 02:58 AM
Re: Writeline Limitations
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
UltraEdit can show your file. I have version 8.10b. It displays a text line of 31,999 "x"'s as multiple lines of ~4,095 chars (max length) but does not increment the line numbers until the next line (CRLF) is encountered. [ 15. April 2003, 03:00: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#74539 - 2003-04-15 11:25 AM
Re: Writeline Limitations
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11631
Loc: CA
|
Using UltraEdit v10.0b I get the following results.
7 Columns of 4200 A characters 1 Column of 2600 A characters for a total of 32,000 characters (0 idx starts the count)
KiXtart v4.12 used for testing.
Modifying code from 31999 to 32000 returns error
quote: Idx: 31998 Idx: 31999 Idx: 32000Script error: expression too long! $wri = writeline (1, "$Char" + @CRLF)
Using KiXtart v4.21-RC2 I get the following result
quote: Idx: 31998 Idx: 31999 Idx: 32000 ERROR : expression too long! Script: C:\SCRIPTS\test.kix Line : 14
|
|
Top
|
|
|
|
#74541 - 2003-04-15 02:10 PM
Re: Writeline Limitations
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
And this example will create a 50,000 character "line".
$sFile="C:\Temp\wl.txt"
; Construct 10,000 character string. $sSpace10=" " For $iIndex=1 To 1000 $sSpace10000=$sSpace10000+$sSpace10 Next $nul=Open(1,$sFile,5) $nul=Writeline(1,$sSpace10000+$sSpace10000+$sSpace10000+$sSpace10000+$sSpace10000) $nul=Close(1)
|
|
|
Top
|
|
|
|
#74543 - 2003-04-15 04:44 PM
Re: Writeline Limitations
|
bleonard
Seasoned Scripter
   
Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
|
Using FOR/NEXT I still ran into limitations as well. However, a programmer friend suggested the following simple change - remove the line feed for each write - and I easily wrote 100,000 characters to a line. Downloaded UltraEdit and it saw as 1 line, 100,000 characters. Logic for my script is to not use CRLF with any write. Duh! Bill
code:
$Fil = "C:\Temp\wl.txt" $Char=A OPEN (1, $Fil, 5) FOR $Idx=1 to 100000 $wri = writeline (1, "$Char") NEXT CLOSE (1)
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 633 anonymous users online.
|
|
|