× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Emily,

It would really help if you'd spell out a little more what you are trying to do with this code. Are you trying to generate a random number that can be up to 99 digits long?

There is some very odd coding going on here and it strikes me that it would hardly be surprising if you got strange results. Why divide the length of number by 4? You are generating individual numbers that range from 1 digit in length to 10 - so I'm having trouble seeing the significance of 4. Also, because you use %Char you will lose leading zeros, so the resulting generated number, will not have a true random distribution because sometimes you'll only be adding 1 character to the string and at other times 10 characters.

There is also the point that there are much better choices than 'rand' for generating random numbers including CEERAN0.

The subject of random number generation has been discussed at length particularly on the RPG400 list so you might want to check the archives. Also unless you really need all positions to be digits, you might be better off with using unique Ids - again discussed at length on RPG400 - which may be where David asks us to move this discussion.


Jon Paris

www.Partner400.com
www.SystemiDeveloper.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.