Why is this seen as a BUG?
There is not a single product on the market who remembers earlier values
after the database has been closed and connected again.
The only possible way is to load every obtained value in a table (single
column) that does not accept duplicates.
(RANDOM(1000)) continues until a value is accepted

SET ERR VAR verr
WHILE #date IS NOT NULL THEN
SET VAR vtest = (RANDOM(1000)
 LOAD RANDOMTAB
  .vtest
 END
 IF verr = 0  THE
  BREAK
 ENDI
ENDW

Another method is to use RANDOM in conjunction with values extracted from
DATE and TIME variables, but even then you cannot quarantee a unique result.

Jouke

----- Original Message -----
From: Manuel de Aguiar <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 23, 2001 6:51 PM
Subject: Re: Randomly generated unique numbers - Razzak's Reply


> Hello Rich,
> I think you just found a bug.
> Using RBase for Windows V6.5++ Build: 1.840gxRT03 I tried your command
line
> verbatim seven time and got the following number:
> 10
> 3
> 335
> 33
> 355
> 217
> 536
> I then exit RBase, open RBase again SIX TIMES and got the same numbers.
Since
> you discover it, please report it to RDCC so that the Dream Team can
correct
> this problem.
> Thank you,
> Manuel de Aguiar
> M|D Enterprises
>
> rich wrote:
>
> > One item to watch out for:
> > 1. If you set a variable to a random number like: set var vrand =
> > (random(1000)) it will generate a number.
> > 2. if you exit rbase and restart it, define the variable again you will
get
> > the same random number.
> >
> > rich
> > ----- Original Message -----
> > From: "A. Razzak Memon" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, April 23, 2001 10:35 AM
> > Subject: Re: Randomly generated unique numbers - Razzak's Reply
> >
> > >
> > > Bob,
> > >
> > > Use the R:BASE (RANDOM(value)) Function!
> > >
> > > http://www.RSyntax.com
> > >
> > > Enjoy!
> > >
> > > Very Best Regards,
> > >
> > > Razzak.
> > >
> > > At 10:05 AM 4/23/2001 -0400, Bob Powell wrote:
> > > >
> > > >Does anyone know how to randomly generate a nine
> > > >digit number that is always unique?
> > >
> > >
> > > ===================================-============================
> > > R:BASE Developers's Conference: http://www.rbase.com/conference
> > > Official R:BASE List Server:    mailto:[EMAIL PROTECTED]
> > > RBTI Events/Training:      http://www.rbase2000.com/events
> > > R:DCC Members:      http://www.rbase2000.com/rdcc
> > > ================================================================
> > > R:BASE, Oterro & R:Tango are registered trademarks of RBTI.
> > > ==================================-=============================
>

Reply via email to