In other programming languages I was always taught to Dim variables early in the program and only in subroutines if the subroutine was only called infrequently. So even though a variable may only be used in one or two routines if it is called frequently then it should be Dim once and initialised going into the routine.
For example in Globals Dim m as Map,a as int
In the sub routines
m.initialise
a=0
Is this considered "good" programmiong practice in B4A and more importantly is it more or less efficient use of memory
Thanks
For example in Globals Dim m as Map,a as int
In the sub routines
m.initialise
a=0
Is this considered "good" programmiong practice in B4A and more importantly is it more or less efficient use of memory
Thanks