The Function question type uses its text field to perform 'internal' calculations that are imperceptible to the interviewer, but calculations that can, nevertheless, influence data collection and survey logic.
Depending on the function and syntax specified in the CAPIDesigner, a value is returned by the WebSurvey as a response to each question that indicates success, failure, or problem in the execution of the function. Sample response values for each function are listed at the bottom of the Possible uses table for each function in the CAPI help documentation. The only response values returned by the WebSurvey are:
1 | = | Success |
0 | = | Failure |
-999999999 | = | Problem, i.e., Error executing the function. |
Troubleshooting Functions (a.k.a. Runtime Errors)
When troubleshooting a function for runtime errors, pay close attention to the return values of each function. The "Problem" in executing the function depends 100% on the function that produced the error. It is in combination with the error value returned and the function used where the archivist/designer needs to begin the troubleshooting process:
Note: The results of a functional command specified in the Functions question type should not be confused with the question's response ( = return values). The results are a consequence of the operation or calculation carried out by the logic of the function. If a result is needed later in the survey, it will need to be saved as a Symbol (see, Save Symbol field) for later reference. Results may include the creation of a calendar, file, roster, etc.; or they may be a cleaned string of characters, a converted or repaired date, or the initiation and termination of a loop.
Special Characters
In the Functions question type two sets of characters have special significance:
Sample Functions question type shown in the CAPIDesigner: