Izmirov.Yaminovich Member Licensed User Longtime User Jun 23, 2016 #1 Hi, Just a question about what I can read on the forum. Are there any difference between dim and private? The guide that I downloaded are using private as for the rest of the forum tutorial uses dim. Are there any specific reason to use any of them? Thanks
Hi, Just a question about what I can read on the forum. Are there any difference between dim and private? The guide that I downloaded are using private as for the rest of the forum tutorial uses dim. Are there any specific reason to use any of them? Thanks
DonManfred Expert Licensed User Longtime User Jun 23, 2016 #2 a private variable can only be accessed from the activity the var is defined in. Resp. it is only available in the sub the variable is declared in. Upvote 1
a private variable can only be accessed from the activity the var is defined in. Resp. it is only available in the sub the variable is declared in.
An Schi Well-Known Member Licensed User Jun 23, 2016 #4 To me it seems like 'dim' was used in the past and is still working. But now you should go with 'private'/'public'. Upvote 0
To me it seems like 'dim' was used in the past and is still working. But now you should go with 'private'/'public'.
Erel B4X founder Staff member Licensed User Longtime User Jun 23, 2016 #5 An Schi said: To me it seems like 'dim' was used in the past and is still working. But now you should go with 'private'/'public'. Click to expand... That's true (for global / process_global variables). Upvote 0
An Schi said: To me it seems like 'dim' was used in the past and is still working. But now you should go with 'private'/'public'. Click to expand... That's true (for global / process_global variables).
klaus Expert Licensed User Longtime User Jun 23, 2016 #6 The Guides use Private or Public, these are the advised keywords. Dim remains only for compatibility. Many users still use Dim, 'old habits'. You may have a look at chapter 10.5 Scope in the B4A Beginner's Guide. Upvote 0
The Guides use Private or Public, these are the advised keywords. Dim remains only for compatibility. Many users still use Dim, 'old habits'. You may have a look at chapter 10.5 Scope in the B4A Beginner's Guide.