Oxygen Basic
Information => Development => Topic started by: Brian Alvarez on November 23, 2018, 05:00:55 PM
-
Can classes in oxygen contain properties?
I would like to do something like this:
Ob.prop(1,2,3) = 123
Is this possible?
-
o2 does not have a separate category of property, but it supports pseudo-assignment.
class cc
'
int a[1000]
'
function prop(int i,j,k, v) 'SET
int d=i+j*10+k*100
a[d]=v
end function
function prop(int i,j,k) as int 'GET
int d=i+j*10+k*100
return a[d]
end function
'
end class
cc c
c.prop(1,2,3)=21
int x=c.prop(1,2,3)
print x
-
I think that is the exact behavior of a property module Charles... i dont mind the name, but
i am curious... why didnt you add the name "property"? You are kind of... already there.
-
In VB, properties are functions that act like assignable objects with rules and limitations.