realblue Member Licensed User Longtime User May 15, 2013 #1 Happy programming folks, Great things are happening with B4A. A new version came up with "class property". Did anyone start using this feature? I used to code two subs in order to implement get/set properties as follows: ... Dim m_property as string ... Public Sub property_set(value As String) m_property = value End Sub Public Sub property_get As String Return m_property End Sub As I understood from the documentation now I can use as m_property.text. But I couldn't make it work and also how will I declare read only or write only properties. Thanks in advance.
Happy programming folks, Great things are happening with B4A. A new version came up with "class property". Did anyone start using this feature? I used to code two subs in order to implement get/set properties as follows: ... Dim m_property as string ... Public Sub property_set(value As String) m_property = value End Sub Public Sub property_get As String Return m_property End Sub As I understood from the documentation now I can use as m_property.text. But I couldn't make it work and also how will I declare read only or write only properties. Thanks in advance.
W wl Well-Known Member Licensed User Longtime User May 15, 2013 #2 Look at the example at http://www.b4x.com/forum/basic4andr...orials/18626-classes-tutorial.html#post106825 You should call the property from an object of the class containing the property, the m_property in your exampleis just an instance variable containing the value of the property. Upvote 0
Look at the example at http://www.b4x.com/forum/basic4andr...orials/18626-classes-tutorial.html#post106825 You should call the property from an object of the class containing the property, the m_property in your exampleis just an instance variable containing the value of the property.