You can use the CSPro language to write logic for virtually any part of your data entry or batch edit application: a level
, or field
. In a data entry application you must make sure the screen has the logic view
on the right and the data entry tree
on the left, so you can click on the item for which you want to write logic. You can see the logic for the whole application by clicking on the forms file (usually the topmost node) on the data entry or batch edit tree.
Give a message for the keyer if there are married (or previously married) people under the age of 12. Click on the "Marital Status" field on the forms tree, P06_MARITAL_STATUS in our example. In the text editor, at the top of the logic view, you will see:
Now enter the following:
P06_MARITAL_STATUS <> 1 and
P05_AGE < 12 then
("Not 'never married' but less than 12 years old"
Note that this particular verification can be done only after data has been entered in both fields. If for some reason AGE is captured after P06_MARITAL_STATUS, then these instructions would be placed in the AGE field's logic.
Program a skip after the marital status question to skip over "Age at First Marriage" if the person is never married. Click on the "Marital Status" field on the forms tree, P06_MARITAL_STATUS in our example. In the text editor, at the top of the logic view, enter: