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/19/2012
07:48:54 PM
3J316GYGG Show this entire thread in new window
Gratar Image based on email address
From:
Tuvia Vinitsky
To:
Attachments:
None

You are up against a design issue, but one that is not hard to deal with.

FiC actually runs the Init more than one time. The last time prior to the form becoming visible, it runs the Init and also passes the parameters.

This multiple Init was causing some developers problems managing the Init and parameters, and the generally accepted design became to test for that final Init pass with the pcount()>0. Just recently that concensus plan was added to the FAA by FiC to automate the issue for new users not familiar with this idea.

But you do run into a problem using pcount(), and you have found it -- what if there are no parameters being passed? In general you can just remove the if pcount()..endif and let your init instructions be executed more than once. The performance hit is very minor.


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