On Sun, Nov 25, 2012 at 1:49 PM, <amphitr...@ok.de> wrote:

>
> In REXX I rarely used 'procedure' to separate subroutine's
> variables from the variable pool of the main program. Within
> ooREXX ::method seems to imply 'procedure' and I must use 'expose'
> to share variables between methods. The variable pool of the main
> program still seems to be separated.
>
> The manual describes about expose that the variable pool belongs
> to an object. My question: is there something like a
> 'super-expose' to join the variable pools of two or more objects?
>


No, there isn't.  At least not anything I'm aware of.



>
> Why I ask: I use ooDialog to show a Window what is represented as
> an object in ooREXX. From a menu I start a "child" dialog which is
> also an object. Alas a new object with its own variable pool.



I think the word should not be "alas" but "Thank goodness."  Thank goodness
the new object has its own variable pool.



> To
> move the child dialog to (x, y) I used push and pull. But I would
> prefere direct access to 'expose'd varialbes.
>


The one thing you can use, which you might not be aware of being used to
procedural programming, is the "attribute" directive.

If you define your child dialog similar to:

::class 'ChildDlg" public inherit 'SomeDlgClass'

::attribute posX
::attribute posY

you will have some, limited, access to the exposed variables posX and posY
through the "attribute" method.

If you read about the attribute directive you should see that attributes
are really methods and that this:

::attribute posX

is equivalent, or similar to, this:

::method "posX="
  expose posX
  use arg posX

::method posX
  expose posX
  return posX

Using the attribute posX in a program:

dlg~posX = 16

say dlgPosX

would print 16 on the screen.

I'm not too good at explaining things, I think you need to actually use
"attributes" some, to start to understand it.

Here is some, not complete, code to give you an idea:

  mainDlg = .MainDlg~new(..)

  ...

  -- At some point in your program:
  childDlg = .ChildDlg~new(...)

  childDlg~posX = 340
  childDlg~posY = 200

  childDlg~execute

-- Partial class definition for ChildDlg
::class 'ChildDlg" public inherit 'RcDialog'

::attribute posX
::attribute posY

::method initDialog
  expose posX posY

  self~moveTo(posX, posY)

--
Mark Miesfeld
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to