This is not an actual problem, it’s about scope and naming conventions of variables and is related to good coding style and programming principles. (I’m posting this after having read thread184-1527177. I’m also familiar with Hungarian Notation and Naming Conventions).
Suppose you have the following case:
In this case I am confused by the notation lcChar_1, which means it’s a LOCAL char variable in FUNCTION Two, while it’s actually LOCAL in FUNCTION One.
My question is: When should the scope letter be used with a variable name? How does it improve programme readability?
Suppose you have the following case:
Code:
FUNCTION One
*********************
LOCAL lcChar_1
Var1 = MyFunction2()
…
ENDFUNC
FUNCTION Two
********************
LOCAL lcChar_2
lcChar_2 = lcChar_1 + CHR(32)
…
ENDFUNC
My question is: When should the scope letter be used with a variable name? How does it improve programme readability?