<div dir="ltr">Dear Sihua,<div><br></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:14px">c = random(a(1), a(4))</span> . I think this code is the reason. You originally want to get a random number from 6,3,7,2,which is in the array a, but your code is to select a value randomly from 6 to 2, which means you get a random value from 2,3,4,5,6. and I wonder if you can successfully complie the code since random function needs the first parameter as min, the second parameter as max.</div>
<div>so I would recommend that you get a random value from 1,2,3,4 .I'd better give you codes:</div><div>t=random(1,4)</div><div>c=a(t);</div><div>s=random(1,3)</div><div>d=b(s)</div><div><br><div> </div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/11/8 sihua xu <span dir="ltr"><<a href="mailto:xusihua80@gmail.com" target="_blank">xusihua80@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="im"><span style="font-family:arial,sans-serif;font-size:14px">Hello everyone </span><div style="font-family:arial,sans-serif;font-size:14px"><br></div><div style="font-family:arial,sans-serif;font-size:14px">
I know how to define the array with the help of David and sally, and I get the value randomly according to way that they told me, but actually, I found the program do not get the value of the array randomly and i do not know the reason.</div>
<div style="font-family:arial,sans-serif;font-size:14px">I want to achieve the purpose of the following</div><div style="font-family:arial,sans-serif;font-size:14px"> to get one value from each array and decide to end or continue the program by comparing the size of the value from the two arrays. the script example just as follows</div>
<div style="font-family:arial,sans-serif;font-size:14px">dim a(1 to 4) as integer</div><div style="font-family:arial,sans-serif;font-size:14px">dim b (1 to 3) as integer</div><div style="font-family:arial,sans-serif;font-size:14px">
dim c as integer</div><div style="font-family:arial,sans-serif;font-size:14px">dim d as integer</div><div style="font-family:arial,sans-serif;font-size:14px">dim randompik as integer</div><div style="font-family:arial,sans-serif;font-size:14px">
a(1) = 6</div><div style="font-family:arial,sans-serif;font-size:14px">a(2) = 3</div><div style="font-family:arial,sans-serif;font-size:14px">a(3) = 7</div><div style="font-family:arial,sans-serif;font-size:14px">a(4) = 2</div>
<div style="font-family:arial,sans-serif;font-size:14px">b(1) = 2</div><div style="font-family:arial,sans-serif;font-size:14px">b(2)= 6</div><div style="font-family:arial,sans-serif;font-size:14px">b(3) = 4</div><div style="font-family:arial,sans-serif;font-size:14px">
c = random(a(1), a(4))</div><div style="font-family:arial,sans-serif;font-size:14px">d = random(b(1), b(3))</div><div style="font-family:arial,sans-serif;font-size:14px">if c>d then </div><div style="font-family:arial,sans-serif;font-size:14px">
randompik = 1</div><div style="font-family:arial,sans-serif;font-size:14px">else randompik =2</div><div style="font-family:arial,sans-serif;font-size:14px">end if</div><div style="font-family:arial,sans-serif;font-size:14px">
<br></div><div style="font-family:arial,sans-serif;font-size:14px"><div style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Arial,Helvetica,sans-serif;font-size:13px">I would be grateful if anybody could help me to find the reason why it can not achieve my purpose and modify that</div>
<div style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></div><div style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Arial,Helvetica,sans-serif;font-size:13px">
<br></div></div></div><div><div>Sihua Xu<br><br></div></div>
</div><div class="im">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:e-prime%2Bunsubscribe@googlegroups.com" target="_blank">e-prime+unsubscribe@googlegroups.com</a>.<br>
To post to this group, send email to <a href="mailto:e-prime@googlegroups.com" target="_blank">e-prime@googlegroups.com</a>.<br></div>
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/e-prime/CAPEBGuZKEQU9_P_o67iyLcPMhvy%2BYiMOQYVExDW27EXVKh2aGQ%40mail.gmail.com" target="_blank">https://groups.google.com/d/msgid/e-prime/CAPEBGuZKEQU9_P_o67iyLcPMhvy%2BYiMOQYVExDW27EXVKh2aGQ%40mail.gmail.com</a>.<div class="HOEnZb">
<div class="h5"><br>
For more options, visit <a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.google.com/groups/opt_out</a>.<br>
</div></div></blockquote></div><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.<br />
To post to this group, send email to e-prime@googlegroups.com.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/e-prime/CAJO0WNZ-t8oQ_HCLq84YJSf0Xdy7Bzq%2B7y_zjAA9rSRkZ75OJg%40mail.gmail.com">https://groups.google.com/d/msgid/e-prime/CAJO0WNZ-t8oQ_HCLq84YJSf0Xdy7Bzq%2B7y_zjAA9rSRkZ75OJg%40mail.gmail.com</a>.<br />
For more options, visit <a href="https://groups.google.com/groups/opt_out">https://groups.google.com/groups/opt_out</a>.<br />