XojoScript computed property


Possible use computed property with XojoScript ?

Never see a example, if anybody have simple example.


I don’t think its possible. What you can do is a method with methodname(Assigns value as datatype)

Use it as Methodname = somevalue

Computed properties behave like Methods in a way.
The assigns keyword is very helpfull for this.

You are welcome.

I copied a computed property from a class. It looks like this:

Property myproperty As Integer
  Return 1
End Get
  value = 1
End Set

So probably you should use such code.

This syntax works, as confirmed by Joe R:

[code]Module Test
Dim p As Integer = 1
Property TestProp As Integer
Return p
End Get
p = value
End Set
End Property
End Module


Computed Properties can be declared inside of modules and classes, but not at the top level of a script.