List Info

Thread: Array - max elements number




Array - max elements number
user name
2006-11-27 18:32:59
Hi Bart,

I checked whether there is a general limit for arrays, but
had no 
problems assigning 240000 (long) strings to an array on my
system.

In your code your using LoadDataFromFile from the Tools
library?

In this library 'Redim Preserve' is used to expand the array
and in my 
opinion this copies the array to a temporary array and thus
uses lots of 
system resources.

So I think system resources is what limits the reading of
lines in this 
case.
If I'm wrong somebody might correct me?

Hope this helps
Christoph

Bart Aimar schrieb:
> 
> The target is to convert a large file.txt in file.csv
> 
> (in the source file the fields are in different
lines... )
> 
> The idea is to store the entire file in array, and
after iterate the 
> elements (to manipulate the contents).
> 
> But this (symple) code:
> 
> Sub Main
>  dim contenutofile(121000)' as array
>  dim pathfile as string
>  pathfile = "c:Basilicata.txt"
>  converttourl(pathfile)
>  loaddatafromfile(pathfile, pippo())
>  for i = 0 to 12000
>  msgbox pippo(i)
>  next i
> End Sub
> 
> seems to work only for wide file...
> 
> In large files (130.000 lines) the function
loaddatafromfile return 
> Overflow error...
> 
> There is a max element nunber for the array, or the
limits depend from 
> machine resource?
> 
> Any idea or suggest to resolv my problem in OO?
> 
> thanks for the answers
> 
> Bart
> 
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
> For additional commands, e-mail: dev-helpapi.openoffice.org
> 

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

Array - max elements number
user name
2006-11-27 18:49:04
Btw, did you click 12001 times on the MsgBox?  


Christoph Jopp schrieb:
> Hi Bart,
> 
> I checked whether there is a general limit for arrays,
but had no 
> problems assigning 240000 (long) strings to an array on
my system.
> 
> In your code your using LoadDataFromFile from the Tools
library?
> 
> In this library 'Redim Preserve' is used to expand the
array and in my 
> opinion this copies the array to a temporary array and
thus uses lots of 
> system resources.
> 
> So I think system resources is what limits the reading
of lines in this 
> case.
> If I'm wrong somebody might correct me?
> 
> Hope this helps
> Christoph
> 
> Bart Aimar schrieb:
>>
>> The target is to convert a large file.txt in
file.csv
>>
>> (in the source file the fields are in different
lines... )
>>
>> The idea is to store the entire file in array, and
after iterate the 
>> elements (to manipulate the contents).
>>
>> But this (symple) code:
>>
>> Sub Main
>>  dim contenutofile(121000)' as array
>>  dim pathfile as string
>>  pathfile = "c:Basilicata.txt"
>>  converttourl(pathfile)
>>  loaddatafromfile(pathfile, pippo())
>>  for i = 0 to 12000
>>  msgbox pippo(i)
>>  next i
>> End Sub
>>
>> seems to work only for wide file...
>>
>> In large files (130.000 lines) the function
loaddatafromfile return 
>> Overflow error...
>>
>> There is a max element nunber for the array, or the
limits depend from 
>> machine resource?
>>
>> Any idea or suggest to resolv my problem in OO?
>>
>> thanks for the answers
>>
>> Bart
>>
>>
------------------------------------------------------------
---------
>> To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
>> For additional commands, e-mail: dev-helpapi.openoffice.org
>>
> 
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
> For additional commands, e-mail: dev-helpapi.openoffice.org
> 

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )