Page 1 of 1

Question about Variable.*Value properties

Posted: Fri Jan 08, 2016 5:30 pm
by Rado1
Does anybody of you use Variable component's Value, IntValue, ModelValue or ByteValue properties? Do you think it is useful to still have them? If so, then StringValue is missing.

I could see some usage in debugging the previewed application, but in practice, I rather use trace() function instead.

Re: Question about Variable.*Value properties

Posted: Fri Jan 08, 2016 5:54 pm
by Kjell
Hi Rado1,
Rado1 wrote:Does anybody of you use Variable component's Value, IntValue, ModelValue or ByteValue properties? Do you think it is useful to still have them? If so, then StringValue is missing.
I occasionally look up the value of a integer or byte by glancing at the component properties, so to me it's still useful. But i understand where that question is coming from, the component is a bit of a mess ( editor-wise ) in general ( imo ) .. not only string is missing, vec2/3/4 and mat4 are as well, and more importantly you can only edit the value of a float variable. It's not consistent nor intuitive.

Suggested this back in 2013:

Image

Depending on the type you select a corresponding edit control is shown for the value.

K

Re: Question about Variable.*Value properties

Posted: Fri Jan 08, 2016 5:57 pm
by VilleK
I consider these properties as an internal requirement by the runtime. They could be hidden. The only use I see is for debugging (clicking on the variable in the project tree and check the current value).

As why some datatypes are missing, it is because they are represented internally in different ways. Byte/float/int are simple primitive types and have their own properties. The others are garbage collected (a.k.a. "managed") types so they share a property called ManagedValue (which is hidden already).

Re: Question about Variable.*Value properties

Posted: Fri Jan 08, 2016 6:02 pm
by Kjell
Hej Ville,
VilleK wrote:I consider these properties as an internal requirement by the runtime. They could be hidden. The only use I see is for debugging (clicking on the variable in the project tree and check the current value).
Don't forget you can click on the Value property and edit the ( float ) value in the property editor or using the slider :wink:

K

Re: Question about Variable.*Value properties

Posted: Fri Jan 08, 2016 7:17 pm
by Rado1
I just would be glad if the implementation is consistent, in any way. BTW even if float Value can be edited, it cannot be saved and it is still in disable look, I think that's a mistake of implementation.

BTW there is another hidden property Timer.CurrentRelativeTime which should be shown in property editor because it is used in expressions much more than Variable.Value.