This https://community.bistudio.com/wiki/setVariable says that setVariable works on Controls, but it does not.
Description
Details
- Legacy ID
- 1462116483
- Severity
- None
- Resolution
- No Bug
- Reproducibility
- Always
- Category
- Feature Request
- execute this:
_control setVariable ["MyValueName", _value];
diag_log text format ["%1, value = %2, control value = %3", _control, _value, _control getVariable "MyValueName"];
- check RPT file, it will say:
Control #..., value = ..., control value = <null>
instead of
Control #..., value = ..., control value = ...
Event Timeline
Confirmed. It is supposed to work:
"b:NAMESPACE setvariable ARRAY"
"b:CONTROL setvariable ARRAY" <= here
"b:OBJECT setvariable ARRAY"
"b:GROUP setvariable ARRAY"
"b:TEAM_MEMBER setvariable ARRAY"
"b:TASK setvariable ARRAY"
"b:LOCATION setvariable ARRAY"
But it doesnt
After further investigation, CONTROL is limited to map control, and not just any map but static editor map control, whatever this is. So not a bug really, just useless functionality.
Why do you think this is not a bug? This feature is documented and very useful because one can assign value to a control instance so that value lifetime matches control's lifetime (like RAII). What is workaround for this issue? Globals? Monads?
It is not a bug because there is no provision for all controls, just a particular one. I can change this ticket to Feature Request for you