Declaring a variables

Peter Simpson

Expert
Licensed User
Longtime User
This is a wish rather than anything else, maybe in V2.0x.

I find that the package to be great but the one thing that could be is declaring variables.

At the moment in Globals you have to write the following.
Dim SDFontSize As Int
SDFontSize = 20

A cleaner solution would be:
Dim SDFontSize As Int = 20

That's it really, silly I know. Just being able to condense 2 lines into one makes for better reading I think.

Anyway thank you(Erel) and all the B4A community, for all your hard work in making this the best Android community on the internet.
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
Next logical step would be in Subs too (Default values and optional parameters...I don't do much coding in Java obviously or I wouldn't have needed B4A, but does Java do this? Quick search says just overloading, but that could emulate it.):

MySub(firstParam as int=3, secondParam as string="Nothing Passed")

Some languages only allow these as the last parameter(s)...which is fine too.
 
Top