Jump to content
Sign in to follow this  
emanemos

Array

Recommended Posts

emanemos

Hi from France,

I've an Array > 65525 lines.

Do U know a method to workaround this problem? I want to write this array in a file ...

Thanks

$mysqlrequest = "SELECT * from toto"

$aArray = _EzMySql_GetTable2d($mysqlrequest)
;~ _ArrayDisplay ($aArray)
_filewritefromarray( $path & $Dir & "state.csv",$aArray,0,UBound($aArray),";")

 

Edited by emanemos

Share this post


Link to post
Share on other sites
jguinch

Hi "voisin".

One way could be to get the number of rows (select count(*)) and make several requests (in a loop), using LIMIT : $mysqlrequest = "SELECT * from toto LIMIT 0, 10000", where 0 is variant (0, 10000, 2000 ...).

Share this post


Link to post
Share on other sites
kylomas

emanemous,

Arrays are not limited to 65525 lines.  _Array display has a limitation of what it can display due to the max number of controls allowed.

The following demonstrates an array of 100,000...

local $a[100000]

for $1 = 0 to ubound($a) - 1
    $a[$1] = $1
Next

; send last ten elements to the console

for $1 = ubound($a) - 1 to ubound($a) - 11 step -1
    ConsoleWrite($a[$1] & @CRLF)
next

Have you tried writing the file and looking at it?

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites
mikell

Confirmed by the helpfile

VAR_SUBSCRIPT_ELEMENTS  16,777,216  Maximum number of elements for an array.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×