[Pas2js] Multi dimensional static array to dynamic array?

Mattias Gaertner nc-gaertnma at netcologne.de
Tue May 15 13:44:13 CEST 2018


On Sun, 13 May 2018 12:57:29 +0700
Ryan Joseph <ryan at thealchemistguild.com> wrote:

> I have the array:
> 
> array[0..3, 0..3] of GLfloat

Is translated to an array of three arrays of three glfloat.

 
> which I need to pass to “array of GLfloat” but I can’t seem to typecast. What’s recommended here? Again we have weirdness going from Pascal to JS where I would pass this as a pointer but in JS they should be the same type and typecast should be ok.

No, they are not.

 
> TJSFloat32List = array of GLfloat;
> data: array[0..3, 0..3] of GLfloat;
> list: TJSFloat32List;
> 
> list := TJSFloat32List(data); // no go

Rightfully so.

Mattias


More information about the Pas2js mailing list