11 January 2011

Random Generation of number

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()));
}

1 comment:

  1. Create in class Global method

    static 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);

    ReplyDelete

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...