For Programmers: Free Programming Magazines  


Home > Archive > Cobol > January 2005 > Re Does anybody how to use the RANDOM function of VS COBOL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re Does anybody how to use the RANDOM function of VS COBOL
HonestPerson

2005-01-20, 3:55 pm

I mean VS COBOL II.

My problem is this:

I want to create a randomizer subprogram, passing MinNo, MaxNo,OutputNo,ReturnCode where the randomizer will pick a number between MinNo and MaxNo only and return that number to the OutputNo. And give the return code to the ReturnCode variable.

I tried to call the function Random with argument but it only return 1 or 0.


--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-

Richard

2005-01-20, 3:55 pm

> I tried to call the function Random with argument but it only return
1 or 0.

It returns between 0 and 1 (eg 0.456702)
You need to multiply by the range and add the offset.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com