• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
      • Introduction to CSPro Language
      • Data Requirements
      • CSPro Program Structure
      • Programming Standards
      • Code Folding
      • Debugging CSPro Applications
      • Declaration Section
      • Procedural Sections
        • Statements
        • Proc Statement
        • PreProc Statement
        • OnFocus Statement
        • OnOccChange Statement
        • KillFocus Statement
        • PostProc Statement
      • Logic
      • Language Elements
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

OnOccChange Statement

Format
onoccchange
Description
The onoccchange statement declares that the statements following it are executed at the time that a group's current occurrence changes. The onoccchange statement can only be coded in a group: a roster or a multiply occurring form.
During data entry, whenever the user moves from one occurrence to another (forward or backward), the onoccchange of the group will be executed.
The onoccchange statement is not very common, but it may be useful in some CAPI applications, particularly to set question text fills.
Example
PROC PERSON_FORM

onoccchange

   
if curocc() > 0 then
        personName = 
strip(FIRST_NAME(curocc())) + " " + strip(LAST_NAME(curocc()));
   
endif;
See also: Proc Statement, PreProc Statement, OnFocus Statement, KillFocus Statement, PostProc Statement, Order of Executing Data Entry Events, Order of Executing Batch Edit Events