• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
      • Introduction to Data Entry
      • Data Entry Application
      • Data Entry Editing
      • CAPI Data Entry
        • Introduction to CAPI
        • CAPI Features
        • Capture Types
        • Multimedia
        • CAPI Strategies
        • How to ...
          • Create a New CAPI Application
          • Define Languages
          • Organize Forms
          • Enter Question Text
          • Create Fills In Questions
          • Edit Styles
          • Change Formatting
          • Add Images
          • Insert Link In Question Text
          • HTML Question Text
          • Question Text Macros
          • Resource Folders
          • Use Multiple Languages
          • Create Conditional Questions
          • Structure Movement
          • Create Helps for Fields
          • Show Values for Selection
          • Handle Multiple Answers
          • Choose Topic Sections
          • Create General Helps
          • Test Application
      • Network Data Entry
      • Android Data Entry
    • 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>

Choose Topic Sections

Often in a CAPI questionnaire, the enumerator needs to be able to move from one section of the questionnaire to another.
To make this happen, a global navigation key needs to be established and handled by the onkey function. The accept function can be used to collect the enumerators choice of what section to move to and define the first field in the section to move to. Movement, however, must be made from a location, a field, before any of the sections are encountered in order maintain the path structure. This field is protected so that no data need to be entered into it.
Below is code for the onkey function to support using F9 to move to another section in the application. The NAVIGATE data item provides the location of movement.
function numeric OnKey(numeric keystroke)

   
if keystroke = 120 then // F9 to navigate among sections

       
numeric selection = accept( "What Section?",
                                   
"Section A",
                                   
"Section B",
                                   
"Section C",
                                   
"Section D",
                                   
"Section E");

       
if selection = 1 then // Section A
            JumpField = "Q_A1";
       
elseif selection = 2 then // Section B
            JumpField = "Q_B1";
       
elseif selection = 3 then // Section C
            JumpField = "Q_C1";
       
elseif selection = 4 then // Section D
            JumpField = "Q_D1";
       
elseif selection = 5 then // Section E
            JumpField = "Q_E1";
       
else // Escape
            OnKey = 0;
           
exit;
       
endif;

        JumpFlag = 
1;
       
move to NAVIGATE;

   
else
       
OnKey = keystroke;

   
endif;

end;


PROC NAVIGATE

onfocus

    $ = 
"Z"; // need to have a value in the field

postproc

   
if JumpFlag = 1 then
        JumpFlag = 
0;
       
move to JumpField;
   
endif;