PDA

View Full Version : Public Variables 'Not Found'



Jeff_Stone
2013-05-09, 16:02
I have the following page init and load procs.

proc page1_init()
public proc_date, chose_deal, display_chosen
//use deallist597 alias deals597
proc_date = date()
chose_deal = "F "
display_chosen = .t.
endproc

proc page1_load()
messagebox("Made it 1")
// select chosen,long_name,filename,settle_dt from deallist597 into cursor deals597 readwrite
m_deals = lianja.getelementbyID("gDealList")
//m_deals.addItems("select * from deals597")
m_deals.addItems("select chosen,long_name,filename,settle_dt from deallist597")
endproc

Even though the 3 public variables listed in the init() proc actually are showing up correctly in the displayed Page1 (attached), the Debug window is producing 'not found' messages:

Thu May 9 15:51:24 2013
**** Lianja error ****
proc_date
^
Variable/field 'PROC_DATE' not found

Thu May 9 15:51:24 2013
**** Lianja error ****
proc_date
^
Variable/field 'PROC_DATE' not found

Thu May 9 15:51:24 2013
**** Lianja error ****
display_chosen
^
Variable/field 'DISPLAY_CHOSEN' not found

Thu May 9 15:51:24 2013
**** Lianja error ****
display_chosen
^
Variable/field 'DISPLAY_CHOSEN' not found

Thu May 9 15:51:24 2013
**** Lianja error ****
chose_deal
^
Variable/field 'CHOSE_DEAL' not found

Thu May 9 15:51:24 2013
**** Lianja error ****
chose_deal
^
Variable/field 'CHOSE_DEAL' not found

Not sure what I'm doing incorrectly and would appreciate feedback. tia Jeff
293

yvonne.milne
2013-05-10, 05:57
The init() events fire as follows:

App Init
Section Init
Field Init (memvar will be checked here)
Other Section Init
Page Init

If you declare the memvars in the App init() (Settings button in the ModeBar) or in the Section init() (or relevant Field), the 'not found' error will not occur.