H Hanz Active Member Dec 29, 2018 #1 I'm using v6.51. When the return type of the property is an Int, the entire sub name is presented in the instance of a class. For instance, the code is: Code: Copy public sub getNormalBalance When you call the instance of the class, instead of presenting only the "NormalBalance", the entire sub name is presented which is "getNormalBalance." But it's not the case when I change the data type into a String. Is this a limitation or a bug?
I'm using v6.51. When the return type of the property is an Int, the entire sub name is presented in the instance of a class. For instance, the code is: Code: Copy public sub getNormalBalance When you call the instance of the class, instead of presenting only the "NormalBalance", the entire sub name is presented which is "getNormalBalance." But it's not the case when I change the data type into a String. Is this a limitation or a bug?
DonManfred Expert Licensed User Longtime User Dec 29, 2018 #2 Asuming your intvalue is mBalance inside the Class. The sub signature of the getter method should be Code: Copy public sub getNormalBalance as Int ' <- Define the return type. Here Int return mBalance ' don´t forget to add a return end sub In this case it is a read only property. If you want to change the property too you need to create a setter method too. Code: Copy public sub setNormalBalance(balance as Int) mBalance = balance end sub Last edited: Dec 29, 2018 Upvote 0
Asuming your intvalue is mBalance inside the Class. The sub signature of the getter method should be Code: Copy public sub getNormalBalance as Int ' <- Define the return type. Here Int return mBalance ' don´t forget to add a return end sub In this case it is a read only property. If you want to change the property too you need to create a setter method too. Code: Copy public sub setNormalBalance(balance as Int) mBalance = balance end sub
H Hanz Active Member Dec 29, 2018 #3 Oh, I see... So what is missing is the "As Int" after the sub name. You need to put it when the data type is not a string type. Thanks!!! Upvote 0
Oh, I see... So what is missing is the "As Int" after the sub name. You need to put it when the data type is not a string type. Thanks!!!