Declaring all variables as Protected in a Procedure.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
breeze4me
Enthusiast
Enthusiast
Posts: 633
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Declaring all variables as Protected in a Procedure.

Post by breeze4me »

If there is a compiler directive declaring all variables as Protected in a Procedure, it would be easy to declare many variables as protected.

like this.

Code: Select all

Global x = 10
Global z

Procedure test()
  CompilerEnableDefine #PB_Compiler_Protected

    x=100   ; it's protected

  CompilerDisableDefine

    z=100   ; it's global

EndProcedure
and something like "CompilerEnableDefine #PB_Compiler_Global"

any possibility, Fred? :D
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

Use Macros ? :lol:
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
josku_x
Addict
Addict
Posts: 997
Joined: Sat Sep 24, 2005 2:08 pm

Post by josku_x »

If Fred would add all that unneeded stuff, PB would be already just bloatware.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

josku_x wrote:If Fred would add all that unneeded stuff, PB would be already just bloatware.
It's the feature request and wishlist forum, so please respect everyone wishs.
Post Reply