Closed stonfute closed 4 years ago
Hi @stonfute ,
float[][]
and float[,]
are quite different. The former is an array of arrays and may be jagged or even contain null
elements. The latter is a 2D array, i.e. one with "rank" 2.
Check out the first and second array articles from the series for more details. The first has a usage example for the config JSON:
{
"Arrays": [
{
"Type": "System.Int32"
},
{
"Type": "System.Single",
"Ranks": [ 1, 2, 3 ]
}
]
}
In your case, I suspect you should add just this:
{
"Arrays": [
{
"Type": "System.Single",
"Ranks": [ 2 ]
}
]
}
Hope that helps, -Jackson
Thank you for your time.
In my case it was "Ranks": [ 1, 2 ]
cause I only want to use 2D arrays.
I will try.
This is still an issue with "Ranks": [ 1, 2, 3 ]
.
Also reproductible with 3D array of any type.
C# property with type int[,,]
generate System::Array3<System::Int32, System::Int32, System::Int32>
type for both get/set methods but it should be System::Array3<System::Int32>
Hi @stonfute ,
Sorry for closing this issue prematurely; I thought you were just asking a question but now I realize it was a bug report. I've fixed the issue in commit 65e70add52952098c5496ce91c4ef85b00c3895d. Please let me know if the problem persists for you.
Best, -Jackson
Sorry for closing this issue prematurely; I thought you were just asking a question but now I realize it was a bug report. I've fixed the issue in commit 65e70ad. Please let me know if the problem persists for you.
No problem ! It seams to work like a charm !
Thank you !
Hi,
I'm using NativeScript in a project and I've notice a problem when using 2D arrays.
In C# I'm defining 2D arrays as
float[,] values
but this generateSystem::Array2<System::Single, System::Single>
inBindings.h/cpp
System::Array2<System::Single, System::Single>
is not defined and it should generateSystem::Array2<System::Single>
.Am I right ? Am I using 2D array as designed in generator ? Should I use
float[][]
instead offloat[,]
?Regards,