Skip to content

Return array size from XP array datarefs #69

@JT8D-17

Description

@JT8D-17

I'm trying to return the array size of a dataref by using the method documented in the SDK:

Read a part of a single precision floating point array dataref. If you pass NULL for outVaules, the routine will return the size of the array, ignoring inOffset and inMax.

So in theory

XPLMGetDatavf("sim/aircraft/overflow/acf_tank_X", NULL,0,2)

should return the size of the array (10 for the example dataref)

But instead, I get "Wrong arguments to function XPLMGetDatavf" as a console output.

The only accepted format of a XPLMGetDatavf call in FWL is

XPLMGetDatavf(inDataRef, inOffset, inMax)

with everything else producing the aforementioned "wrong arguments" error.

My use case is trying to get the size of an array dataref in XP so that I can iterate through it.

It would be nice to have this functionality implemented.

FWL version: Plugin Version: 2.7.26 build Jun 27 2020 22:48:04
XP version: 11.50b13
Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions