Page MenuHomeFeedback Tracker

Make setVariable work on all types of Controls
New, WishlistPublic

Description

This https://community.bistudio.com/wiki/setVariable says that setVariable works on Controls, but it does not.

Details

Legacy ID
1462116483
Severity
None
Resolution
No Bug
Reproducibility
Always
Category
Feature Request
Steps To Reproduce
  1. execute this:

_control setVariable ["MyValueName", _value];
diag_log text format ["%1, value = %2, control value = %3", _control, _value, _control getVariable "MyValueName"];

  1. check RPT file, it will say:

Control #..., value = ..., control value = <null>

instead of

Control #..., value = ..., control value = ...

Event Timeline

sms edited Steps To Reproduce. (Show Details)Jul 28 2014, 4:54 PM
sms edited Additional Information. (Show Details)
sms set Category to Feature Request.
sms set Reproducibility to Always.
sms set Severity to None.
sms set Resolution to No Bug.
sms set Legacy ID to 1462116483.May 7 2016, 7:06 PM

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.

sms added a subscriber: sms.May 7 2016, 7:06 PM
sms added a comment.Sep 26 2014, 8:50 PM

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