Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: PCOUNT after Adapt

$
0
0
Re: PCOUNT after Adapt
FoxInCloud
Re: PCOUNT after Adapt
06/20/2012
08:05:20 AM
3J40HC7Y3 Show this entire thread in new window
Gratar Image based on email address
From:
Patrick
To:
Attachments:
None
It is common for my forms to be run without any parameters (default) and if something specific needs to be loaded it is run with a parameter.

I test for PCOUNT to determine what needs to be loaded on Init. I am not sure what the best way for FAA to handle the adaption but I will be aware of it so I can adjust for the forms where a parameter is not always sent.

Thanks,

Patrick


Looks like this automated adaptation needs improvements

As Tuvia explained,
.Init() 'naturally' executes without parameters when form instantiates (FAS keeps an internal reference to each form, shared by all users),
Then FAS executes .init() with your parameter(s)

In most cases, your .init() code needs be executed only at this last stage;
so you may keep everything within
IF pcount() > 0
ENDIF

unless your .Init() method can functionnally be called without parameters

I adapted a form and in the init this is what FIC did. The This.Get_data() no longer runs if no parameter is sent. I can move this line outside the Pcount IF/ENDIF to fix. Thought I would put this out there in case this is not by design.

LPARAMETERS iEmp IF Pcount() > 0 && Added by FoxInCloud Adaptation Assistant version 1.25 (source mode) on 06/19/2012 09:00:32 AM DoDefault() && Added by FoxInCloud Adaptation Assistant version 1.25 (source mode) on 06/19/2012 09:00:32 AM IF PCOUNT() > 0 vEMp_id = (m.iEMP) thisForm.wViewParmSet('employee_id',"vEMP_ID",m.vEMp_id,.T.) thisform.refresh() ENDIF This.Get_data() ENDIF && Added by FoxInCloud Adaptation Assistant version 1.25 (source mode) on 06/19/2012 09:00:32 AM



Viewing all articles
Browse latest Browse all 10393

Trending Articles