Hi there,
Title says it all.
Greetings
Franky
Allow multidimensional arrays in structures
Allow multidimensional arrays in structures
Give Up everything but trying!
Re: Allow multidimensional arrays in structures
already requested ...
http://www.purebasic.fr/english/viewtop ... =3&t=23624
http://www.purebasic.fr/english/viewtop ... =3&t=10640
http://www.purebasic.fr/english/viewtop ... =3&t=15752
http://www.purebasic.fr/english/viewtop ... =3&t=23624
http://www.purebasic.fr/english/viewtop ... =3&t=10640
http://www.purebasic.fr/english/viewtop ... =3&t=15752
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: Allow multidimensional arrays in structures
Sorry for the late answer, it's been a busy time.
What I mean is not static but dynamic Arrays
I have 2-dimensional Data of which I don't know the number of rows or columns on compile time, but that I find by loading data from a file (or more; up to 250 MB of Data and more).
For the moment, I'm doing it like this:
The problem is, that this is very unoptimized. Having a 2-dimensional Array inside structures would take me ~2 milliseconds for allocating memory and another half second to fill it with the data. The workaround takes me ~2 milliseconds for allocating the firstDimension (Dim Val), half a second to fill in the Data, but nearly 2 Seconds to allocate all the Inner Arrays.
So, it's kind of missing possibility for otimizing my code.
I could work with AllocateMemory and Pointers, but that's ugly, buggy and unreadable.
And another point (not for me, but in many cases happening)
Imagine 2D-Data inside a file (for example a Bitmap).
Would make it possible, to read multiple files by reading ReadData and using these Data inside the Array.
So, to me it seems like an important feature.
Perhaps Freak or Fred could tell something about how hard that would be to implement.
Best Regards
Franky
What I mean is not static but dynamic Arrays
Code: Select all
Structure MyValues
Dim Value.l(1,1)
EndStructure
For the moment, I'm doing it like this:
Code: Select all
Structure MyInnerValues
Dim Value.l(1)
EndStructure
Structure MyValues
Dim Val.MyValues(1)
EndStructure
So, it's kind of missing possibility for otimizing my code.
I could work with AllocateMemory and Pointers, but that's ugly, buggy and unreadable.
And another point (not for me, but in many cases happening)
Imagine 2D-Data inside a file (for example a Bitmap).
Code: Select all
Structure Img
height.l
width.l
Dim Pixel.l(0,0)
EndStructure
Global NewList Images.Img()
So, to me it seems like an important feature.
Perhaps Freak or Fred could tell something about how hard that would be to implement.
Best Regards
Franky
Give Up everything but trying!