GetArrayElements for an array of a typed array throws error?

Started by LemonWizard, December 31, 2016, 03:58:37 AM

Previous topic - Next topic

LemonWizard


varamount = getarrayelements(  function_instances(index).function_int_names$()  )


Error is expected array handle.
I kind of don't know what to do here, i'm kind of expecting this to work because I declared the type and the array within the type.

Here's the actual declaration:


type function_instance
function_parameters$()
function_int_values()
function_int_names$()
function_start_pc
function_end_pc
function_name$
function_parameter_amount
instance_id
output$()
endtype


btw the goal here is virtualizing function instances in my interpreter so that function variables and parameters are
reserved during calls to functions of the same name from inside functions of the same name.



kevin


  You can only have static arrays in types, the array functions are for dynamic arrays..  Such code used to error at compile time, but doesn't now for whatever reason. 

  You do the same thing (without the fetch overhead of a nested type) with array handles, but I generally wouldn't bother, as a static pre sized array removes the allocation need for dynamic arrays.