| McNeel Wiki | |||||
| edit · print · help · all topics | |||||
Main Pages
Languages
| Sample CodeThe following code sample demonstrates how to generate random numbers that fall within a specified range.
Function RandomNumber(nMin, nMax)
RandomNumber = Null
If Not IsNumeric(nMin) Then Exit Function
If Not IsNumeric(nMax) Then Exit Function
If nMin >= nMax Then Exit Function
Randomize
RandomNumber = Int((nMax - nMin + 1) * Rnd + nMin)
End Function
| ||||
| rename · changes · history · subscriptions · lost and found · references · file upload | |||||