• <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>

Seed Function

Format
b = seed(numeric_expression);
Description
The seed function is used to determine the first value generated by the random function. If you want to reproduce a series of random numbers, then for best results, the numeric_expression should be set to a prime number, such as 1009. However, if you want different random numbers for each run of your program, the systime and timestamp functions return good seed values.
Versions of CSPro 6.0 and greater will return different random numbers, given the same seed value, than earlier versions of CSPro. If you expect a certain sequence to the random numbers and want to match a previously recorded sequence, then you will want to use an old version of CSPro to run your application.
Return Value
The function returns a logical value of 1 (true) if the seeding is successful, and 0 (false) otherwise.
Example
seed(systime());

numeric randomAge = random(1,99);