Android Question Equates

Gavin

Member
Licensed User
Longtime User
I was wondering if there is a way of implementing Equates in B4A.
I my Windows Programing Software, you declare a Numerical Equate at the head of the program by the use of a percentage sign, %MaxPeople = 100 and a String Equate with a dollar sign, $MyName = "Gavin".
You then use %MaxPeople and $MyName through your program. This is not the same as using a variable as an Equate can not be accidentally altered by your program.
I have tried looking in the forums for an answer with no success.

Gavin
 

mangojack

Well-Known Member
Licensed User
Longtime User
In the meantime just create your own .. unfortunately the "$" and "%" cant be used.
although this does not prevent them getting accidently changed ..
Though in a single developer situation where they are clearly named as such the risk is minor.
B4X:
dim ConstmyVariable as String
dim ConstmyVariable as Int
 
Upvote 0

Gavin

Member
Licensed User
Longtime User
Thank you Erel and mangojack.
Great to hear that constants will be supotred in the future. In the mean time, I will use something like mangojack suggested.
 
Upvote 0
Top