docs.intersystems.com
Home / Class Definition Reference / Method Keywords / ProcedureBlock

Class Definition Reference
ProcedureBlock
Previous section           Next section
InterSystems: The power behind what matters   
Search:  


Specifies whether this method is a procedure block. Applies only if the method is written in ObjectScript.
Usage
The class definition specifies whether methods in the class are procedure blocks by default. To override that default, and specify that a given method is a procedure block, use the following syntax:
Method name(formal_spec) As returnclass [ ProcedureBlock ] 
{    //implementation }
Or (equivalently):
Method name(formal_spec) As returnclass [ ProcedureBlock=1 ] 
{    //implementation }
Otherwise, to specify that a given method is not a procedure block, use the following syntax:
Method name(formal_spec) As returnclass [ ProcedureBlock=0 ] 
{    //implementation }
Details
This keyword specifies that an ObjectScript method is a procedure block.
Within ObjectScript, methods can be implemented as procedure blocks or not. Procedure blocks enforce variable scoping: methods cannot see variables defined by their caller. New applications use procedure blocks; non-procedure blocks exist for backwards compatibility.
Default
If you omit this keyword, the value of the class-level ProcedureBlock keyword is used.
See Also


Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-07-15 06:54:33