return issue

Discussion in 'Questions (Windows Mobile)' started by Cableguy, Sep 20, 2007.

  1. Cableguy

    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??
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You should change it to:

    return state
    instead of
    return (state)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice