Page 1 of 1

#PB_Compiler_InsideProcedure

Posted: Sun Feb 01, 2009 5:54 pm
by Hroudtwolf
Hi,

It would be cool to have a compiler constant like "#PB_Compiler_InsideProcedure", which has the value #TRUE wenn used inside a procedure.
'Cause it isn't possible to check this by using #PB_Compiler_Procedure with CompilerIf.

Fictive example:

Code: Select all

Macro CastModule ( _MODULE_ )
   CompilerIf #PB_Compiler_InsideProcedure
      Protected *this.t#_MODULE_ = GetModule_#_MODULE_ ()
   CompilerElse
      Define.t#_MODULE_ *_MODULE_ = GetModule_#_MODULE_ ()
   CompilerEndIf
EndMacro
Best regards

Wolf

Posted: Sun Feb 01, 2009 8:01 pm
by blueznl
What would you use it for?

Posted: Sun Feb 01, 2009 8:26 pm
by ts-soft
blueznl wrote:What would you use it for?
I think to declare Variables inside Procedure with Protected and outside with Define

This is usefull, not only in OOP programming