Input String is wrong format

Discussion in 'Questions (Windows Mobile)' started by lairdre, May 22, 2007.

  1. lairdre

    lairdre Member Licensed User

    The following code fails at runtime on version 5, with the error message "Input string is wron format" What does this mean? Under version 4 of b4ppc property returned the string "LAN, GPRS, WI-FI,RAS,or blank"

    What changed? Do we now need to cast the return to a sting some how?

    Thanks,
    Ron

    property = getSelection()

    Sub getSelection
    x = cBBn.SelectedIndex
    Select x
    Case 0
    media = "LAN"
    Case 1
    media = "GPRS"
    Case 2
    media = "Wi-Fi"
    Case 3
    media = "RAS"
    Case -1
    media = "blank"
    End Select
    return media
    End Sub
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You should write: property = getSelection
    As there are no arguments.
     
  3. lairdre

    lairdre Member Licensed User

    Subs without parameters

    That was the problem. The answer was also right in the documentation

    "Subs syntax starts with "Sub SubName (Parameters)" and ends with "End Sub".If there are no parameters for the sub, then write "Sub SubName" without the parenthesis.There are no functions in Basic4ppc but instead every sub can return a value with the keyword "Return""

    Thanks,
    Ron
     
Loading...