I try to pick up some random numbers ...
so I wrote a procedure ...

it produced differents numbers when i ran it inside the vfp.
but it didnt when it ran as a .exe file ...

anyone can resolve this??

thank you

Re: random numbers by Eric

Eric
Mon Jun 30 04:41:45 CDT 2003

Hello, finns!
You wrote on Mon, 30 Jun 2003 16:44:58 +0800:

f> it produced differents numbers when i ran it inside the vfp.
f> but it didnt when it ran as a .exe file ...

f> anyone can resolve this??

I think you need to share your code otherwise we can not help you fixing
your problem.
Are you using the RAND() function?

btw: please post to a single newsgroup instead of posting the same question
in multiple groups. Most people here read all groups so you'll probably
always get an answer.
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Re: random numbers by George

George
Mon Jun 30 08:26:57 CDT 2003

Are you using Rand(-1) before getting your numbers?

From the fox-help:

"If nSeedValue is negative the first time you issued RAND( ), a seed =
value from the system clock is used. To achieve the most random sequence =
of numbers, issue RAND( ) initially with a negative argument and then =
issue RAND( ) without an argument. "
"If you omit nSeedValue, RAND( ) uses a default seed value of 100,001."



"finns" <finns@ms1.hinet.net> wrote in message =
news:unyCnMuPDHA.2476@TK2MSFTNGP10.phx.gbl...
> I try to pick up some random numbers ...
> so I wrote a procedure ...
>=20
> it produced differents numbers when i ran it inside the vfp.
> but it didnt when it ran as a .exe file ...
>=20
> anyone can resolve this??
>=20
> thank you
>=20
>

RE: random numbers by Leemi

Leemi
Mon Jun 30 09:15:03 CDT 2003

Hi Finns:

Try compiling this code into a simple executable and see if it works:

136420 How to Create an Array of Unique Random Numbers
http://support.microsoft.com/?id=136420

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP8 HAS ARRIVED!! --*
Read about all the new features of VFP8 here:
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
Purchase VFP8 here:
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retires June 30th, 2003
- VFP6 Mainstream Support retires Sept. 30th, 2003

> I try to pick up some random numbers ...
> so I wrote a procedure ...
>
> it produced differents numbers when i ran it inside the vfp.
> but it didnt when it ran as a .exe file ...


Re: random numbers by David

David
Mon Jun 30 09:25:29 CDT 2003

Finns,

The set of calls to rand() in every VFP session will return the same
sequence of psuedorandom numbers. This is actually a good thing, it allows
repeatability so that you can reliably test code that uses random numbers.

You are seeing different results between your dev time and the runtime
because you've been making calls to rand() all along.

As George posted include a rand(-1) call at the beginning of your prg to
randomize the starting point of the sequence.

--
df - Microsoft MVP FoxPro http://www.geocities.com/df_foxpro

"finns" <finns@ms1.hinet.net> wrote in message
news:unyCnMuPDHA.2476@TK2MSFTNGP10.phx.gbl...
> I try to pick up some random numbers ...
> so I wrote a procedure ...
>
> it produced differents numbers when i ran it inside the vfp.
> but it didnt when it ran as a .exe file ...
>
> anyone can resolve this??