return issue

Cableguy

Expert
Licensed User
Hi,guys

I have a sub calling another sub several times in order to give me a random on/off state, like this:

sub setup
....
image1.image=rnd_img(state)&".png"
....
image2.image=rnd_img(state)&".png"
....
End Sub

Sub rnd_img
x=rnd(0,2)
if x= 0 then state="ON" Else state="OFF"
retun(state)
End Sub

The return keyword errors with a "FormatException" so nothing is passed to the calling sub...
Why??
 
Top