The
Pff.exec function starts another CSPro application using the properties defined in the
Pff object. If you modified any of the Pff object's properties, it is not necessary to save the file to disk when running it, as this function will save a temporary file to the disk with the defined properties.
For data entry PFFs, the function executes the application and immediately closes the current application (without saving any data). This is the same as running
execpff with the
stop argument. For other PFFs, the function executes the application using the
wait argument. That is, this function is equivalent to:
If you want to execute a data entry PFF without closing the current application, you can code:
The
execpff help page includes information about how some tools launched via
Pff.exec and
execpff are run in the same process as the calling application.
The function returns a logical value of 1 (true) if the new application was started successfully and 0 (false) otherwise.
PROC INTERVIEW_SELECTION_MENU
Pff application_pff;
// conduct the main household interview
if INTERVIEW_SELECTION_MENU = 1 then
application_pff.load("../Household/Household.pff");
// conduct the agriculture interview
else
application_pff.load("../Agriculture/Agriculture.pff");
endif;
// set the key to the household the user selected
application_pff.setProperty("Key", SELECTED_HOUSEHOLD_KEY);
// run the program
application_pff.exec();