The
skip statement skips to the
field_name given. The field must be forward in the path; that is, it must be located after the current field. The argument
field_name is either the name of a field, or it is a string variable specifying the name of the field. If the field you wish to skip to has multiple occurrences and you are not skipping from a field within the same repeating form or roster, the target occurrence number must be specified to skip to the correct occurrence.
The
next keyword skips to the next occurrence of
multiply_occurring_field_name. If the target field is on the same repeating form or roster as the current field, control will move to the next occurrence of the target field. If not, control will move to the first occurrence of the target field. Occurrence numbers cannot be used with the
next keyword.
When using the
next keyword without the optional target field, control passes to the next occurrence of the current repeating form or roster, with the target field as the first field in that form or roster. This is a useful way to skip to the beginning of the next occurrence.
If using
skip without specifying a target field, then control passes to the next field in the application. This targetless skip can only occur in the
preproc of a field, roster, form, or user-defined function. CSPro will automatically figure out what the target field should be, as it does with an
ask statement.
The target field can be located in any record at the same level as the current field, but it cannot be located at a different level. The field must be later on the path than the current field, meaning that it is a field that has not yet been entered. If the field has already been entered, an error message will be displayed during data entry. If you do not know whether the field is earlier in the data path, use the
move statement.
When a skip statement is executed, the
preproc of the target field will be executed but none of the statements between the
skip statement and the
preproc of the target field will be executed. Skipped fields are assigned the special value of
notappl.
Note that the
skip statement behaves differently from the
advance statement, skipping
past some number of fields, rather than moving
over the fields.