gnucobol-users
[Top][All Lists]
Advanced

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

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


From: John Culleton
Subject: [open-cobol-list] How to use RANDOM function.
Date: Wed, 10 Nov 2010 16:50:45 -0500
User-agent: KMail/1.11.4 (Linux/2.6.29.6-smp; KDE/4.2.4; i686; ; )

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



reply via email to

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