Jump to content

Bug with _ArrayToString() (2d Array)?


Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...