| 
                    
 This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com  | 
            ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
                 
                
    
    
                 | 
                
					
                    
                         
    4D v20.6
 
Random 
                                
                                
        
 | 
                |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Random -> Function result | ||||||||
| Parameter | Type | Description | ||||||
| Function result | Longint | 
             
         | 
        Random number | |||||
Random returns a random integer value between 0 and 32,767 (inclusive).
To define a range of integers from which the random value will be chosen, use this formula:
 (Random%(vEnd-vStart+1))+vStartThe value vStart is the first number in the range, and the value vEnd is the last.
The following example assigns a random integer between 10 and 30 to the vlResult variable:
 vlResult:=(Random%21)+10
	Product:  4D
	Theme:  Math
	Number:  
        100
        
        
        
	
	Created:  < 4D v6
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	4D Language Reference ( 4D v20)
	
	
	4D Language Reference ( 4D v20.1)
	
	
	
	4D Language Reference ( 4D v20.2)
	
	4D Language Reference ( 4D v20.3)
	
	4D Language Reference ( 4D v20.4)
	
	
	4D Language Reference ( 4D v20.5)
	4D Language Reference ( 4D v20.6)
	
	
	
Add a comment