Page 1 of 1

program variables of Addin can not be used outside

Posted: Tue Aug 30, 2011 12:59 am
by maxchen
!doR2 is defined in the eqsumtab.prg of EqTabs Addin

Code: Select all

%ex7 = "\Example Files\EV7 Manual Data\"
%ch2 = "Chapter 2 - A Demonstration"
%wf = @evpath + %ex7 +%ch2 +"\demo.wf1"
pageload %wf
eqsumtab eq*   'save in table "results", and @getnextname

'rename {%tabname} tbeqs 'no effect
c(1) = !doR2   'error

also, %tabname is defined in eqsumtab.prg, but can not be used outside the Addin in the line "rename {%tabname} tbeqs"

Re: program variables of Addin can not be used outside

Posted: Tue Aug 30, 2011 7:50 am
by EViews Gareth
Yep.

Re: program variables of Addin can not be used outside

Posted: Tue Aug 30, 2011 6:44 pm
by maxchen
Thanks, but the object created in Addin is not local, say live in the workfile, and can be accessed by the main prg file.

Re: program variables of Addin can not be used outside

Posted: Tue Aug 30, 2011 7:15 pm
by EViews Gareth
Correct. Workfile objects belong to workfiles, program variables belong to programs. When you delete a workfile, all objects in that workfile are gone, even if you're still running the program that created them. When you exit a program, all program variables in it are also gone, but the workfile objects it created are left behind.