Hello Igor, here are two more possibilities to solve the problem:
1: Use the Directory class
2. Pass the root of a stem. If you give the stem variable the same name everywhere it will be as if it were exposed (in the example I made it different on purpose)
Peace!
is it possible to use EXPOSE in ::ROUTINE
PUBLIC='I I1'
I=1
I1=3
call TEST
exit
::routine TEST
expose PUBLIC
say I';'I1
Error 99.907: EXPOSE must be the first instruction executed after a method invo
cation
thanks all!
No it is not. ::routines are always invoked as if they were external
calls.
Rick
On Tue, Sep 15, 2015 at 4:57 AM, Igor ingvaring@users.sf.net wrote:
Igor, as an alternative you might consider using the .local directory, e.g.
.local["EXPOSED.I"] = 1
.local["EXPOSED.I1"] = 3
call TEST
exit
::routine TEST
say .exposed.I";".exposed.I1
On Tue, Sep 15, 2015 at 11:41 AM, Rick McGuire bigrixx@users.sf.net wrote:
Thanks Erich! I have knew this way using .local object.
Hello Igor, here are two more possibilities to solve the problem:
1: Use the Directory class
2. Pass the root of a stem. If you give the stem variable the same name everywhere it will be as if it were exposed (in the example I made it different on purpose)
-- Example 1
flg = .Directory~new
flg~One = .false
flg~Two = '42'
say 'Before'
say flg~One
say flg~Two
res = Sub(flg)
say 'After'
say flg~One
say flg~Two
::routine Sub Public
trace o
USE ARG _Flg
say 'In Routine'
say _Flg~One
say _Flg~Two
_Flg~One = .true
_Flg~Two = _Flg~Two - 1
Return .nil
::requires 'winsystm.cls'
-- Example 2
flg.One = .false
flg.Two = '42'
say 'Before'
say flg.One
say flg.Two
res = Sub(flg.)
say 'After'
say flg.One
say flg.Two
::routine Sub Public
trace o
USE ARG _Flg.
say 'In Routine'
say _Flg.One
say _Flg.Two
_Flg.One = .true
_Flg.Two = _Flg.Two - 1
Return .nil
Thanks Olov! I knew this way.