GoTo Random Record script?? - FileMaker

Can someone help me come up with what should be an obvious filemaker script to go to a random record between 1 and the last one in my database (about 500?) I can't figure out how to use the "random" function to give me a random integer between 1 and 500. Its driving me nuts! Reply [email]jwitkincts.com[/email] appreciated!! Joe W....

1. GoTo Random Record script??

Can someone help me come up with what should be an obvious filemaker script
to go to a random record between 1 and the last one in my database (about
500?)

I can't figure out how to use the "random" function to give me a random
integer between 1 and 500. Its driving me nuts!

Joe W.

Joseph Witkin Guest 2. Re: GoTo Random Record script??

* Joseph Witkin <jwitkincts.com>:
>
> I can't figure out how to use the "random" function to give me a random
> integer between 1 and 500. Its driving me nuts!
Tha Random function returns a random value between 0 and 1. Before you
start thinking that its 0 or 1 think about the number of possibilities
in terms of decimal values between 0 and 1.

Now in terms of finding a value to go to a record in your db I suppose
you could use the middle function and pull a couple of numbers from the
random result, however, I bet another one of the fine people in this
group have a fabulous mathematical answer for you.

lou
Lou Lesko Guest 3. Re: GoTo Random Record script??

In article <9bLjb.24303\$Z86.21276twister.socal.rr.com>, "Joseph Witkin"
<jwitkincts.com> wrote:
>Can someone help me come up with what should be an obvious filemaker script
>to go to a random record between 1 and the last one in my database (about
>500?)
>
>I can't figure out how to use the "random" function to give me a random
>integer between 1 and 500. Its driving me nuts!
>
>
>Joe W.
Round(500*random,0)

--

Greg Dember Guest 4. Re: GoTo Random Record script??

In article <slrnbov15f.2ft.louleskosdf.lonestar.org>, Lou Lesko
<loulesko> wrote:
> * Joseph Witkin <jwitkincts.com>:
> >
> > I can't figure out how to use the "random" function to give me a random
> > integer between 1 and 500. Its driving me nuts!
>
> Tha Random function returns a random value between 0 and 1. Before you
> start thinking that its 0 or 1 think about the number of possibilities
> in terms of decimal values between 0 and 1.
>
> Now in terms of finding a value to go to a record in your db I suppose
> you could use the middle function and pull a couple of numbers from the
> random result, however, I bet another one of the fine people in this
> group have a fabulous mathematical answer for you.
>
> lou
Random
will give you a "random" decimal number between 0 and 1.

Which means that
Random * 499
will give you a "random" decimal number between 0 and 499.

Therefore,
(Random * 499) + 1
will give you a "random" decimal number between 1 and 500.

Then
Int((Random * 499) + 1)
will remove the decimal digits, leaving you with a "random" whole
number between 1 and 500.

One problem here: computer Random functions are never really random,
but it depends what you're trying to do as to whether that's a real
problem or not.

"Just trying to help whenever I can." :o) 5. Re: GoTo Random Record script??

round ((random*499)+1),0)

Joe

"Greg Dember " <gregdemREMOVEberdatabase.calm> wrote in message
news:greg-1610032304320001ava17.drizzle.com...
> In article <9bLjb.24303\$Z86.21276twister.socal.rr.com>, "Joseph Witkin"
> <jwitkincts.com> wrote:
>
> >Can someone help me come up with what should be an obvious filemaker
script
> >to go to a random record between 1 and the last one in my database (about
> >500?)
> >
> >I can't figure out how to use the "random" function to give me a random
> >integer between 1 and 500. Its driving me nuts!
> >
> >
> >Joe W.
>
> Round(500*random,0)
>
> --
>

Joseph Witkin Guest 6. Re: GoTo Random Record script??

> In article <slrnbov15f.2ft.louleskosdf.lonestar.org>, Lou Lesko
> <loulesko> wrote:
>
> > * Joseph Witkin <jwitkincts.com>:
> > >
> > > I can't figure out how to use the "random" function to give me a random
> > > integer between 1 and 500. Its driving me nuts!
> >
> > Tha Random function returns a random value between 0 and 1. Before you
> > start thinking that its 0 or 1 think about the number of possibilities
> > in terms of decimal values between 0 and 1.
> >
> > Now in terms of finding a value to go to a record in your db I suppose
> > you could use the middle function and pull a couple of numbers from the
> > random result, however, I bet another one of the fine people in this
> > group have a fabulous mathematical answer for you.
> >
> > lou
>
> Random
> will give you a "random" decimal number between 0 and 1.
>
>
> Which means that
> Random * 499
> will give you a "random" decimal number between 0 and 499.
>
>
> Therefore,
> (Random * 499) + 1
> will give you a "random" decimal number between 1 and 500.
>
>
> Then
> Int((Random * 499) + 1)
> will remove the decimal digits, leaving you with a "random" whole
> number between 1 and 500.
>
>
>
> One problem here: computer Random functions are never really random,
> but it depends what you're trying to do as to whether that's a real
> problem or not.
>
> "Just trying to help whenever I can." :o)
Int((Random * Status (CurrentRecordCount) - 1) + 1)

--
Henk B
Henk B Guest  Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•