Randomization problem

Adam Osth adamosth at gmail.com
Mon May 18 19:03:08 UTC 2009


I just realized when you sent this that it might be due to how the random
number is applied.

I have the randomization code to select a picture for presentation, so I did
this:
TestList.setAttrib counter, "Item", c.GetAttrib("Picture:drawno")

...in which one of the 8 files in the attribute "Picture" on another list is
randomly selected.

Is it defaulting to zero because this isn't syntactically valid?

Adam

On Mon, May 18, 2009 at 2:59 PM, David McFarlane <mcfarla9 at msu.edu> wrote:

>
> Adam,
>
> Hmm, that bit of code works perfectly for me.  I suspect the problem
> lies somewhere else in the script.  Just to be clear, try the
> following and see what happens:
>
> Dim drawno As Integer
> Dim i as Integer
> For i = 1 to 8
>     drawno = Random(0, 7)
>     MsgBox drawno
> Next i
>
> -- David McFarlane, Professional Faultfinder
>
>
> >I'm having a little problem with randomization code in Ebasic. I
> >have this code:
> >
> >Dim drawno As Integer
> >drawno = Random(0, 7)
> >
> >...and yet, drawno is initialized to '0' every time. This code is
> >used for 8 repetitions in the program, and each time "0" comes up.
> >Even with "Randomize" in front, the same thing happens.
> >
> >Is there something I'm doing wrong?
> >
> >Adam
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en
-~----------~----~----~----~------~----~------~--~---

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20090518/9333376a/attachment.htm>


More information about the Eprime mailing list