Thomymaster

Bug with _ArrayToString() (2d Array)?

3 posts in this topic

Hi

 

I have a 2d array (from a DB) and i need to fill a listview.

For this, i need to convert every row in this 2d array to a string (columns delimitered by "|")

I used the example for _ArrayToString() but noticed that if you want only the first element of a 2d array ( 0 , 0) then the output is buggy.

 

#include <Array.au3>
#include <MsgBoxConstants.au3>

#include <Array.au3>
#include <MsgBoxConstants.au3>


Local $aArray[10][10]
For $i = 0 To 9
    For $j = 0 To 9
        $aArray[$i][$j] = $i & "-" & $j
    Next
Next
_ArrayDisplay($aArray, "2D Array")
MsgBox($MB_SYSTEMMODAL, "Rows 4-7,  cols 2-5", _ArrayToString($aArray, " :: ", 0, 0)) (i.e. 1, 1 or 2, 5 works)

 

What can i do to solve this issue or what am i making wrong?

 

 

Best,

Thomas

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Not sure what your problem is you see. What is the msgbox showing for you and what are you expecting?

I get this as expected:  0-0 :: 0-1 :: 0-2 :: 0-3 :: 0-4 :: 0-5 :: 0-6 :: 0-7 :: 0-8 :: 0-9

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I saw the whole array as the output in MsgBox. I was running v3.3.12.0, after an update to 3.3.14.2 it was working as expected :)

 

Best,

Thomas

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