• <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
        • List Statement
        • List.add Function
        • List.insert Function
        • List.seek Function
        • List.remove Function
        • List.removeDuplicates Function
        • List.removeIn Function
        • List.clear Function
        • List.length Function
        • List.show Function
        • List.sort Function
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • 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>

List.show Function

Format
i = list_name.show(ʃheadingʅ);
Description
The List.show function displays the values from a List and returns the index of the operator's selection. An optional string expression, heading, specifies the title of the window that displays the values. The function is similar to the accept function but with the options taken from the List's values.
Return Value
The function returns the index of the item selected: 1 for the first value, 2 for the second value, etc. The value 0 is returned if the escape key (or back button) is pressed and none of the values is chosen.
Example
List string drink_options = "Water", "Milk", "Soda", "Coffee", "Tea";

numeric favorite_drink_index = drink_options.show("What is your favorite drink?");

if favorite_drink_index <> 0 then
   
errmsg("You like %s the most!", drink_options(favorite_drink_index));
endif;
See also: List Object, List.sort Function, Accept Function, Show Function, ShowArray Function, ValueSet.show Function