I just realized when you sent this that it might be due to how the random number is applied.<br><br>I have the randomization code to select a picture for presentation, so I did this:<br>TestList.setAttrib counter, "Item", c.GetAttrib("Picture:drawno")<br>
<br>...in which one of the 8 files in the attribute "Picture" on another list is randomly selected.<br><br>Is it defaulting to zero because this isn't syntactically valid?<br><br>Adam<br><br><div class="gmail_quote">
On Mon, May 18, 2009 at 2:59 PM, David McFarlane <span dir="ltr"><<a href="mailto:mcfarla9@msu.edu">mcfarla9@msu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Adam,<br>
<br>
Hmm, that bit of code works perfectly for me. I suspect the problem<br>
lies somewhere else in the script. Just to be clear, try the<br>
following and see what happens:<br>
<br>
Dim drawno As Integer<br>
Dim i as Integer<br>
For i = 1 to 8<br>
drawno = Random(0, 7)<br>
MsgBox drawno<br>
Next i<br>
<br>
-- David McFarlane, Professional Faultfinder<br>
<div><div></div><div class="h5"><br>
<br>
>I'm having a little problem with randomization code in Ebasic. I<br>
>have this code:<br>
><br>
>Dim drawno As Integer<br>
>drawno = Random(0, 7)<br>
><br>
>...and yet, drawno is initialized to '0' every time. This code is<br>
>used for 8 repetitions in the program, and each time "0" comes up.<br>
>Even with "Randomize" in front, the same thing happens.<br>
><br>
>Is there something I'm doing wrong?<br>
><br>
>Adam<br>
<br>
<br>
</div></div><br>
</blockquote></div><br>
<br>
--~--~---------~--~----~------------~-------~--~----~<br>
You received this message because you are subscribed to the Google Groups "E-Prime" group. <br> To post to this group, send email to e-prime@googlegroups.com <br> To unsubscribe from this group, send email to e-prime+unsubscribe@googlegroups.com <br> For more options, visit this group at http://groups.google.com/group/e-prime?hl=en<br>
-~----------~----~----~----~------~----~------~--~---<br>
<br>