• <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
      • Batch Edit Statements
      • Numeric Functions
        • ABS Function
        • CMCode Function
        • CountNonSpecial Function
        • Exp Function
        • High Function
        • Inc Function
        • Int Function
        • Log Function
        • Low Function
        • Random Function
        • RandomIn Function
        • Round Function
        • Seed Function
        • Sqrt Function
        • Set Behavior SpecialValues Statement
      • 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>

Random Function

Format
i = random(min_value, max_value);
Description
The random function returns a uniformly distributed random number between the number expressions min_value and max_value inclusive.
By default the sequence of random numbers generated by repeated calls to random will always be the same. You can use the seed function to generate a different sequence.
Return Value
The function returns an integer random value. The function will return a value of default if min_value is greater than max_value or if either value is equal to one of the special values.
Example
NUMBER = random(1, 100);
See also: RandomIn Function, ValueSet.randomize Function, Seed Function, UUID Function