On Sun, May 24, 2015 at 2:54 AM, Mike Cowlishaw <[email protected]> wrote:

>  .
>
>  That is the default situation for a method unless an EXPOSE is used.
> Basically, all variables are local unless identified as object scope on the
> EXPOSE instruction.  USE LOCAL is intended to give you the opposite
> situation where all variables are of object scope unless explicitly
> identified as local.  I've found this particularly desirable in INIT
> methods where all of the object variables for an instance need to be
> initialized.
>
>
> OK.
>
>    If the object is a fairly complex one, you end up with a giant EXPOSE
> statement at the beginning to identify each variable to be initialized.
>
>
> Hmm.   I often use:
>
>   shared='error rc logfile whatever whatever'    -- all the variables only
> needed if there is an error
>
> then in the called routine:
>
>   procedure expose (shared)
>
> so the list(s) of variable that might be shared are in one place and
> easily updated for all routines when one needs to change or add one.
>

What will work for procedures, but doesn't work particularly well in an
object init method, since you are starting out with a clean variable slate
at that point.  That is the one place where this feature is most useful.
It is actually quite rare for other object methods to require access to all
object variables.

Rick




>
> Mike
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Oorexx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
>
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to