• <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.remove Function

Format
b = list_name.remove(index);
Description
The List.remove function removes the value at the position in the List referenced by the numeric expression index. List index values are one-based, so the index must be between 1 and the length of the List.
Return Value
The function returns a logical value of 1 (true) if the value is successfully removed, and 0 (false) otherwise, which indicates that the index is not valid. If the List is read-only, the function returns default.
Example
List string eligible_heads;

// ...

numeric eligible_head_index = eligible_heads.show("Select the head");

if eligible_head_index <> 0 and eligible_heads.length() > 1 then

    eligible_heads.
remove(eligible_head_index);

   
numeric secondary_head_index = eligible_heads.show("Select someone who could also be a head");

endif;
See also: List Object, List.clear Function, List.removeDuplicates Function, List.removeIn Function