I wish to use local variables...
There must be a structure to mark parts of code to use local variables. It must be possible to use the same variable-name in different subroutines without using the same ram-location.
I wish to use local variables...
There must be a structure to mark parts of code to use local variables. It must be possible to use the same variable-name in different subroutines without using the same ram-location.
PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2
Hey ... wasup ???? sleeping ????
I think local variables are easy to implement !
like:
startlocal I
(by now, the compiler adds a incrementing number to the variable, here it will be feg: loc_I_1)
endlocal I
(...it is lost...)
The compiler has a seperat RAM-Locationlist for all this local variables and they are used like a stack... If Var1, var2 and var3 are used, var3 may be cleared, so var4 gets the same adress as var3...
This will not be the best, but I think it is a first way...
PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2
It must be possible to use the same variable-name in different subroutines without using the same ram-location
Yikes! - I know that if I used the same variable name, but different subs changed different RAM locations, I'd get hopelessly lost in writing any code at all!
Bookmarks