The RANDOM function within OpenEdge Architect 10.2B

Posted by MBeynon on 15-Jul-2015 05:44

Hi,

I noticed that if I run the following in a procedure editor I get the expected output:

MESSAGE RANDOM(1,9999)
VIEW-AS ALERT-BOX TITLE PROGRAM-NAME(1).


which is a random number between 1 and 999.

If I run the same from within Architect I get the same number every time! According to the Progress help I need to use the -rand n startup parameter:

"This function returns a number from a pseudorandom sequence of numbers rather than a truly random sequence.

The Alternate Random Number Generator (-rand) parameter determines whether the same sequence of random numbers is generated for each session. For information on this parameter, see OpenEdge Deployment: Startup Command and Parameter Reference."

I've placed the -rand with the value 1 in the statup parameters in my Architect run configurations but no joy.
Have I missed something here?

Thanks,

Mark.

All Replies

Posted by James Palmer on 15-Jul-2015 05:47

I believe you want -rand 2

Posted by Brian K. Maher on 15-Jul-2015 05:48

Use -rand 2.  Using -rand 1 is the same as not specifying the parameter at all (i.e. it is the default).
 
[collapse]
From: MBeynon [mailto:bounce-MBeynon@community.progress.com]
Sent: Wednesday, July 15, 2015 6:45 AM
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] The RANDOM function within OpenEdge Architect 10.2B
 
Thread created by MBeynon

Hi,

I noticed that if I run the following in a procedure editor I get the expected output:

MESSAGE RANDOM(1,9999)
VIEW-AS ALERT-BOX TITLE PROGRAM-NAME(1).


which is a random number between 1 and 999.

If I run the same from within Architect I get the same number every time! According to the Progress help I need to use the -rand n startup parameter:

"This function returns a number from a pseudorandom sequence of numbers rather than a truly random sequence.

The Alternate Random Number Generator (-rand) parameter determines whether the same sequence of random numbers is generated for each session. For information on this parameter, see OpenEdge Deployment: Startup Command and Parameter Reference."

I've placed the -rand with the value 1 in the statup parameters in my Architect run configurations but no joy.
Have I missed something here?

Thanks,

Mark.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by MBeynon on 15-Jul-2015 05:52

Sorry, typo on my part I meant -rand 2. However, this seems to have no effect. I've seen other posts on here about different random number generation in the 4GL. Should I be looking at these rather than the built in RANDOM function.

Posted by Brian K. Maher on 15-Jul-2015 06:07

add this code:
 
message session:startup-parameters view-as alert-box.
 
Then look at the results and see whether the parameter took effect.  Sometimes things can get overridden based on where you specified the value.
 
[collapse]
From: MBeynon [mailto:bounce-MBeynon@community.progress.com]
Sent: Wednesday, July 15, 2015 6:53 AM
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] The RANDOM function within OpenEdge Architect 10.2B
 
Reply by MBeynon

Sorry, typo on my part I meant -rand 2. However, this seems to have no effect. I've seen other posts on here about different random number generation in the 4GL. Should I be looking at these rather than the built in RANDOM function.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by MBeynon on 15-Jul-2015 06:25

Yeah it's definately in there! I can get this to work once if I set my Run Configuration to use the current AVM and not spawn a new one but it then hangs!

Posted by Brian K. Maher on 15-Jul-2015 06:29

hmmm .. at this point i think it is best to open a support case so we can look into it more in depth.
 
[collapse]
From: MBeynon [mailto:bounce-MBeynon@community.progress.com]
Sent: Wednesday, July 15, 2015 7:27 AM
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] The RANDOM function within OpenEdge Architect 10.2B
 
Reply by MBeynon

Yeah it's definately in there! I can get this to work once if I set my Run Configuration to use the current AVM and not spawn a new one but it then hangs!

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by MBeynon on 15-Jul-2015 10:13

Unfortunately this is within OpenEdge 10.2A.05. I'm pretty sure this is no longer supported.

We're due to goto 11X shortly however.

Posted by gus on 15-Jul-2015 15:42

fyi, -rand 2 has been there since version 6.

Posted by Frank Meulblok on 16-Jul-2015 03:54

[quote user="MBeynon"]

Unfortunately this is within OpenEdge 10.2A.05. I'm pretty sure this is no longer supported.

[/quote]

Retired releases still get support, as the Product Lifecycle states:

"Although Service Packs and Hot Fixes are not available for Retired products Progress will provide commercially reasonable efforts to resolve customer issues and answer customer questions on Retired Phase products covered under maintenance. However, the knowledge and skills required to resolve issues on Retired Phase products is NOT guaranteed "

[quote user="MBeynon"]

We're due to goto 11X shortly however.

[/quote]
 
Make sure it's 11.3.1 or later (well, the current 11.5.1 is preferred from the support point of view, as that's the active release).
The -rand being ignored is actually part of the issue described here:
http://knowledgebase.progress.com/articles/Article/000041863?q=000041863&l=en_US&fs=Search&pn=1
 

This thread is closed