Property or indexer '__Usual.Value' cannot be assigned to -- it is read only

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
ArneOrtlinghaus
Posts: 412
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Property or indexer '__Usual.Value' cannot be assigned to -- it is read only

Post by ArneOrtlinghaus »

The following statement with an untyped variable gives the error above
function ControlSetNullValue (oControl , oDB )
..
oControl:Value := false

It seems that the access Value has a special meaning for usuals. Unfortunately it gives conflicts with the control class of the GUI classes.
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Property or indexer '__Usual.Value' cannot be assigned to -- it is read only

Post by Chris »

Hi Arne,

That was fixed about a week ago :-)

Chris
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Property or indexer '__Usual.Value' cannot be assigned to -- it is read only

Post by robert »

Arne,
The problem here was that the Usual structure also has a (read only) Value property.
This property returns the contents of the Usual (as an object).

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Frank Maraite
Posts: 178
Joined: Sat Dec 05, 2015 10:44 am
Location: Germany

Property or indexer '__Usual.Value' cannot be assigned to -- it is read only

Post by Frank Maraite »

The fastest fix is
function ControlSetNullValue (guiControl AS Control , db AS ??? ) AS VOID

guiControl:Value := false

I would do this immediatly after reporting the bug, you know.
User avatar
ArneOrtlinghaus
Posts: 412
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Property or indexer '__Usual.Value' cannot be assigned to -- it is read only

Post by ArneOrtlinghaus »

Hi Frank,
thank you for the idea.
Unfortunately there are many untyped functions existing and I cannot change them in a simple way. Often the functions are called with different parameters and with different number of parameters, and this not hardcoded to be able to find compiling, but also in macros at customer sites.
Frank Maraite
Posts: 178
Joined: Sat Dec 05, 2015 10:44 am
Location: Germany

Property or indexer '__Usual.Value' cannot be assigned to -- it is read only

Post by Frank Maraite »

just start doing it whenever you stumble over an issue like this. And of course whenever you see an untyped function/method. Even the longest way starts with the first step.
Permanent refactoring things like this takes an important amount of time in my work since the early 90ies.
Post Reply