gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] How to use RANDOM function.


From: Sergey Kashyrin
Subject: Re: [open-cobol-list] How to use RANDOM function.
Date: Wed, 10 Nov 2010 16:59:54 -0500

Hi John,

the unix/c "random" function has been designed to work this way.
usually people are seeding it with a time() - which are the seconds... :-)

Regards,
SK

----- Original Message ----- From: "John Culleton" <address@hidden>
To: <address@hidden>
Sent: Wednesday, November 10, 2010 4:50 PM
Subject: [open-cobol-list] How to use RANDOM function.


I want to have a certain number randomly chosen every time a certain program runs.

I have this in WORKING-STORAGE:
       77  RANDUM PICTURE S9V9(10).
I have this statement:
COMPUTE RANDUM = FUNCTION RANDOM(0).
Every time I run the program the value of RANDUM is the same. If I change the seed then I get a different number but that is repetitious also. If I leave off the seed it acts as if the seed was zero.
--
John Culleton, Wexford Press


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list



reply via email to

[Prev in Thread] Current Thread [Next in Thread]