Format exeption - why?

Discussion in 'Questions (Windows Mobile)' started by Agrartec, May 27, 2007.

  1. Agrartec

    Agrartec Member Licensed User

    Hello,
    :sign0013: i have a small problem, but can`t find the solution since hours.

    I wrote a very small GPS-program and try to convert the speedoverground to Km/h.

    this works fine:

    textbox1.text = gps.speedoverground

    this doesn`t:

    textbox1.text = gps.speedoverground * 1.852


    I recieve "format exeption". I tried several other ways, but always the same.

    Thanks for answers.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    This problem happens when there is no navigation data from the GPS.
    In that case gps.SpeedOverGround returns "".
    You can solve it with:
    If gps.speedoverground = "" then textbox1.text = "0" else textbox1.text = gps.speedoverground * 1.852
     
  3. Agrartec

    Agrartec Member Licensed User

    Thank a lot, now I could go on very fast.

    Btw, if there is a farmer speaking German here, please tell me. It would be nice to have someone who could test and understand my programs. ;)
     
  4. lucifer1

    lucifer1 Member

    Im not a farmer But I speak german and have a GPS...
     
Loading...