Page 1 of 1

Change Define and Protected to Local

Posted: Sun Nov 19, 2006 5:46 pm
by ts-soft
My wish :)
Define in a Procedure is useless. Local for Procedures and Main-Scope is
more clearly. For DefaulType an extra Keyword, or remove it.

Or set Define = Protected

Re: Change Define and Protected to Local

Posted: Sun Nov 19, 2006 5:51 pm
by remi_meier
ts-soft wrote:Or set Define = Protected
This would get my vote!
For DefaulType an extra Keyword, or remove it
This one too.

Posted: Sun Nov 19, 2006 5:58 pm
by ts-soft
All local variables should be protected, this is important in view of Includes file other authors.

Posted: Sun Nov 19, 2006 6:21 pm
by freak
> All local variables should be protected, this is important in view of Includes file other authors.

That would make "Global" pretty useless, would it not ?

Posted: Sun Nov 19, 2006 6:27 pm
by ts-soft
freak wrote: That would make "Global" pretty useless, would it not ?
No, global is global, all other is local (protected)

In the moment this is useless:

Code: Select all

Global A.l

Procedure foo()
  Define A.l
EndProcedure
A in foo() should protected!

So using global:

Code: Select all

Global A.l

Procedure foo()
  A = 10
EndProcedure
// Edit:
Better example: in the moment

Code: Select all

XIncludeFile "MyGlobals.pbi"

Global a

Procedure foo()
  Define a    ; global
  Define b    ; ???
  Protected c ; lokal 
EndProcedure