b = pff_name.setProperty(property_name, property_value ‖ string_list);
The
Pff.setProperty function modifies the value associated with the
Pff's property specified by the string expression
property_name. The property will be modified to the value given in the numeric or string expression
property_value. If the
property_value is blank, the property will be reset to its default value. Alternatively, a
string_list can be supplied containing values for properties that have multiple values (such as input data filenames).
Property names can be prefixed with the section name. For example, if you load an existing PFF that has a persistent ID value defined for the item PROVINCE, you can code:
However, if no such property was defined in the PFF, the
Pff.setProperty function will not know whether you are modifying a value in the
[DataEntryIds] section, the
[ExternalFiles] section, or another section. To avoid this ambiguity, when setting new custom properties, you can specify the section name when setting the property:
When running a data entry application from a
.pen file, such as on an Android device, you may not have access to the
dictionary file (.dcf) that may be necessary when running certain programs (such as the
Compare Data tool). A special version of
Pff.setProperty, when used with the
InputDict and
OutputDict properties, accepts a dictionary name as an argument. If such an argument is used, certain tools (described in the
execpff help) will be launched using the dictionary that is embedded in the .pen file.
The function returns a logical value of 1 (true) because it will always successfully set a property. If the property name is unknown, then the value is assigned to a new parameter (defined in a PFF's [Parameters] section).
PROC INTERVIEWER_MENU
// run the listing program in the interviewer's assigned cluster
if INTERVIEWER_MENU = 1 then
Pff listing_pff;
listing_pff.load("Listing.pff");
listing_pff.setProperty("Key", maketext("%v", CLUSTER));
listing_pff.exec();
endif;
PROC REPORT_SELECTION
// run the batch application to generate a report on...
Pff report_pff;
report_pff.load("../Report/Report.pff");
// ...the data file for the selected province and region
if REPORT_SELECTION = 1 then
report_pff.setProperty("InputData", maketext("../Data/%v%v.csdb", PROVINCE, REGION));
// ...the data files for all the regions in the selected province
elseif REPORT_SELECTION = 2 then
report_pff.setProperty("InputData", maketext("../Data/%v*.csdb", PROVINCE));
// ...the data files for the entire country
else
List string data_files_listing;
dirlist(data_files_listing, "../Data", filter := "*.csdb", recursive := true);
report_pff.setProperty("InputData", data_files_listing);
endif;
report_pff.exec();