To create a flight parameter browser with selectable inputs, I try to retrieve a property value from a property listed in another property. The property "/autopilot/external/bank/input" has been set in the aircraft_set.xml and contains the property path string "/autopilot/internal/heading-bug-error-deg". Both strings are valid property paths.
- Code: Select all
var path = '/autopilot/external/bank/';
var propinput = getprop(path ~ "input");
print(propinput);
input = getprop("/autopilot/internal/heading-bug-error-deg");
print(input);
input = getprop(propinput);
print(input);
This piece of code is not bound to a specific aircraft model or properties but can be reproduced with any property string.
When executing this code, I get an error message at line #6:
'"' found in propertyname after '''. name must begin with alpha or '_'.
It seems to be impossible to retrieve a property value by a string that itself is a result of getprop() or node.getNode().getValue().
The property path string inside propinput is correct. When I call getprop() with this string manually inserted, I get the desired output (see lines ##4 and 5).
I've tried several things to get rid of this problem, but without success.
What am I doing wrong or what can I do to make it work?
Thanks in advance,
Autowings