static void RandomGenerateEg(Args _args)
{
RandomGenerate objRG = new RandomGenerate();
Random objRandom = new Random();
;
//This generates random numbers specified within the given range
//info(int2Str(objRG.randomInt(10,55)));
//This generates random numbers
info(int2Str(objRandom.nextInt()));
}
Create in class Global method
ReplyDeletestatic int RandomGenerator(int _from, int _to)
{
return xGlobal::randomPositiveInt32() mod (_to - _from + 1) + _from;
}
then call it from any place like
i = RandomGenerator(-99, 56);