• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
        • Accept Function
        • Advance Statement
        • Ask Statement
        • ChangeKeyboard Function
        • Connection Function
        • DeMode Function
        • Display Orientation
        • EditNote Function
        • EndLevel Statement
        • EndGroup Statement
        • Enter Statement
        • GetCaptureType Function
        • GetCaseLabel Function
        • GetDeviceID Function
        • GetImage Function
        • GetNote Function
        • GetOperatorId Function
        • GetOS Function
        • GetRecord Function
        • GetUserName Function
        • GPS Function
        • Interactive GPS Modes
        • HideOcc Function
        • Highlighted Function
        • InAdvance Function
        • IsPartial Function
        • IsVerified Function
        • Move Statement
        • NoInput Statement
        • OnChangeLanguage Global Function
        • OnChar Global Function
        • OnKey Global Function
        • OnStop Global Function
        • OnSystemMessage Global Function
        • Prompt Function
        • Protect Function
        • PutNote Function
        • RandomizeVS Function
        • Reenter Statement
        • SavePartial Function
        • SelCase Function
        • Set Attributes Statement
        • Set Behavior CanEnter Statement
        • SetCapturePos Function
        • SetCaptureType Function
        • SetCaseLabel Function
        • Set ErrMsg Statement
        • SetFont Function
        • SetOperatorId Function
        • Show Function
        • ShowArray Function
        • ShowOcc Function
        • Skip Statement
        • Userbar Function
        • VisualValue Function
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization 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>

SelCase Function

 

Format:

b = selcase([heading,]ext-dict-name,alphanumeric-expression[,offset])

[include(dictionary-item])] [where logical-expression];

 

 

 [ ] indicates that this part is optional.

 

Description:

The selcase function allows a data entry operator to select and load a case from an external file. This function can only be used in data entry applications. It searches the index of the external file named by "ext-dict-name" for all cases whose keys match the criterion specified by "alphanumeric-expression." If two or more matching keys are found, they will be presented to the entry operator in a display box. Using a highlight bar, the operator can select one of the keys. The case identified by that key is then read into memory.

 

The "offset" tells CSPro the number of characters, beginning with the first character of the ID items for the external file, that should be suppressed if multiple matches are found.

 

• alphanumeric-expression: can be a literal or a CSPro expression. The matching is case sensitive. If an empty string is passed, all cases in the external file are returned.

 

• include: tells CSPro to list additional items from the specified dictionary in the display box.

 

• where: applies the logical expression to all cases returned by the selcase statement. The resulting display box will only show cases in which the logical expression evaluated to true (returning a nonzero value).

 

It is possible, by specifying dictionary access parameters after the dictionary name, to limit the cases that the selcase function processes.

Return value:

The function returns a logical value of true (1) if a case is found or selected by the entry operator and false (0) otherwise.

 

Example 1:

OK = selcase(LOOKUP,concat(PROV, DIST));

 

 

Example 2:

OK = selcase(OCCUPATION_DICT, "Plantation");

 

will return cases whose key begins with "Plantation."

 

 

 

Example 3:

OK = selcase(OCCUPATION_DICT, "Plantation")

include(OCCUPATION_CODE, OCCUPATION_SUMMARY_LEVEL);

 

 

 

Example 4:

OK = selcase(OCCUPATION_DICT, "")

include(OCCUPATION_CODE, OCCUPATION_SUMMARY_LEVEL)

where OCCUPATION_CODE >= 631 and OCCUPATION_CODE <= 633;

 

will result in the same screen as appeared in Example 3.