Cableguy Expert Licensed User Longtime User Sep 20, 2007 #1 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??
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??
Erel B4X founder Staff member Licensed User Longtime User Sep 21, 2007 #2 You should change it to: return state instead of return (state)