I am trying to use the @Random function but it is not working for me. I have this code in a computed field, what it is suppose to give me is from 1 to 4; this code is giving me from 1 to 5…
randomNum := @Round( 4 *@Random +1);
@Text(randomNum);
If I remove the +1 from the code then I get from 0 to 4…
How can I make this function work so that I get the value from 1 to 4… the 4 is a value that is dynamic… the field that goes there is MaxNumber and is computed, in this example it is 4
The answer is staring at you, but sometimes it takes a second set of eyes. If you are adding one to make certain the lowest number is always one, you must subtract to make certain the top is never more than 4…so: randomNum := @Round( (4-1) *@Random +1); @Text(randomNum);