• <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>

PreProc Statement

Format
preproc
Description
The preproc statement declares that the statements following it are executed at the beginning of a run, case, level, record, form, roster, or field.
In data entry applications, statements in a preproc procedure are executed when you move forward onto an object. Moving forward occurs when the execution flow moves the cursor onto the object, or when the user goes forward to the object by any means (mouse-click, tab key, arrow keys, etc.). If you move backward onto an object, preproc statements are not executed. Moving backward occurs if a keyer reenters a value, goes backward with a mouse click, or uses the Shift+tab or arrow keys to move backward. If you want to execute the statements when you move both forward and backward onto a field, code them in the onfocus procedure.
In batch edit applications, a preproc is used to execute logic at the beginning of a run, case, level, or record. For an item there is no difference between placing your logic in a preproc or postproc.
Remember, if you don't code a preproc or postproc in a PROC, all instructions are considered postproc statements by default.
Example
PROC INTERVIEW_DATE

preproc

    INTERVIEW_DATE = 
sysdate("YYYYMMDD");
See also: Proc Statement, OnFocus Statement, OnOccChange Statement, KillFocus Statement, PostProc Statement, Order of Executing Data Entry Events, Order of Executing Batch Edit Events