• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
        • Pff Statement
        • Pff.load Function
        • Pff.save Function
        • Pff.getProperty Function
        • Pff.setProperty Function
        • Pff.exec Function
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Pff.exec Function

Format
b = pff_name.exec();
Description
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:
Pff my_pff;
// ...

if my_pff.getProperty("AppType") = "Entry" then
   
execpff(filename(my_pff), stop);
else
   
execpff(filename(my_pff), wait);
endif;
If you want to execute a data entry PFF without closing the current application, you can code:
execpff(filename(my_pff), wait);
Tools Running in the Same Process
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.
Return Value
The function returns a logical value of 1 (true) if the new application was started successfully and 0 (false) otherwise.
Example
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();
See also: Pff Object, ExecPFF Function