|
Hi, I am having some trouble using the CEERAN0 API for generating random numbers. The problem is that I do get back some random numbers, but every time I run the program, it's the same 'random' numbers that are generated. Maybe I'm just overlooking some trivial thing, but here's (part of) the code. I want to generate 3 random numbers between 1 and 6, and use them to set on 3 indicators between 11-16, 21-26 and 31-36. D S S 2s 0 d indic s 2s 0 * D C0SEED S 5I 0 Inz(0) d C0RNDNBR S 8F c movea '000000' *in(11) c movea '000000' *in(21) c movea '000000' *in(31) * C DOU S >= 1 and s < 7 C CALLB 'CEERAN0' C PARM C0SEED C PARM C0RNDNBR C PARM *OMIT C EVAL S = %DECH(C0RNDNBR:30:29) * 7 C ENDDO * c eval indic = 10 + s c eval *in(indic) = *on * C DOU S >= 1 and s < 7 C CALLB 'CEERAN0' C PARM C0SEED C PARM C0RNDNBR C PARM *OMIT C ENDDO * c eval indic = 20 + s c eval *in(indic) = *on * C DOU S >= 1 and s < 7 C CALLB 'CEERAN0' C PARM C0SEED C PARM C0RNDNBR C PARM *OMIT C EVAL S = %DECH(C0RNDNBR:30:29) * 7 C ENDDO * c eval indic = 30 + s c eval *in(indic) = *on Any suggestions would be highly appreciated. Peter Colpaert Application Developer Honda Europe NV ---------- Program documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing. ----------
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.