In this article
Forsta Plus uses JScript .NET as its scripting language. The functions and methods available allow you to perform typical Data Processing tasks.
When the script is executed, the values are accessed and updated on a record by record basis. For example, the script is applied to all variables for the first respondent, then applied to all variables for the next respondent, and so on.
Refer to http://msdn.microsoft.com/en-us/library/x85xxsf4(VS.71).aspx for the full Jscript.NET. documentation. The Forsta scripting documentation provides a good introduction to Jscript.NET, however you should note that the scripting manual also covers a number of Forsta-specific functions and objects. These are specific to scripting inside surveys only, and cannot be used in Data Processing scripts.
Data Types
In Action scripts you do not have to call a particular function to work with the survey variables, but can use the question IDs as variables directly. The survey variables are given below in bold text.
The following .Net Framework and JScript.NET data types are used for the various question types (note that for some there are differences between the Optimized and Legacy Database Formats):
- Open text variables (open text questions, other specify, multi open text) - String.
- Single questions and elements of grids:
- Legacy Database Format - String
- Optimized Database Format - Depends on the codes of the answer lists:
- If the codes are numeric:
- For codes up to 255 - byte
- For codes up to 32767 - short
- For codes up to 2147483647 . ,int
- For codes up to approximately 1019 - long
- If the codes include non-numeric characters - String
- For boolean single questions - boolean
- If the codes are numeric:
- Elements of normal multi questions:
- Legacy Database format - String
- Optimized Database format - boolean
- Numeric questions (open numeric, elements of multi numeric) - Decimal
- Date questions (Optimized Database Format only) and date system variables (interview_start etc. on both database formats) - DateTime