random (Function) |
Top Previous Next |
This function will generate a random number within a specified range.
The random number generated by this function must be in the range -2147483647 to +2147483647. Invalid parameters will return 0.
Input: lower : DINT Lower bound for the random number to be generated.
upper : DINT Upper bound for the random number to be generated.
Returns: DINT Random number X, where: lower <= X <= upper.
Declaration: FUNCTION random : DINT;
Example: //----------------------------------------------------------------------------- |