Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get one value from Array #65

Open
HoBu23 opened this issue May 7, 2020 · 2 comments
Open

Get one value from Array #65

HoBu23 opened this issue May 7, 2020 · 2 comments

Comments

@HoBu23
Copy link

HoBu23 commented May 7, 2020

i cant find a method to get one value from an array. Or have i missed a post?
Regards
Horst

@HoBu23 HoBu23 changed the title Get Dataref from Array Get one value from Array May 7, 2020
@HoBu23
Copy link
Author

HoBu23 commented May 8, 2020

It would be very nice if you could sub {dataref} [int] could define. Then you would directly get the value for this array element back.

Currently:
sub sim/cockpit2/switches/generic_lights_switch
set sim/cockpit2/switches/generic_lights_switch [,,,,,1]
ufa sim/cockpit2/switches/generic_lights_switch [1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

Super would be, i.g. also:
sub sim/cockpit2/switches/generic_lights_switch [5]
set sim/cockpit2/switches/generic_lights_switch [,,,,,1]
uf sim/cockpit2/switches/generic_lights_switch 1.0

I would need a lot.

@vranki
Copy link
Owner

vranki commented May 8, 2020

Could be done. Currently you can just get the full array and use the value you want. Pull requests welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants