Format Exception Error

Discussion in 'Questions (Windows Mobile)' started by Zenerdiode, Sep 3, 2008.

  1. Zenerdiode

    Zenerdiode Active Member Licensed User

    As part of an application (I want the user to be able to use fingers instead of the SIP) I have built a keypad. This is to input a decimal value and a tollerance of between 0 & 50%. On pressing 'Enter' it populates the button and the button value is used elsewhere.

    If the textbox is cleared with the 'C' button and 'Enter' is pressed; in the IDE debugger pressing 'Enter' does nothing - this is what I want. However when Optimised Compiled, on the Device it gives a 'FormatException' or on the desktop it gives 'Input string was not in a correct format'

    Where am I going wrong?

    Attached Files:

  2. agraham

    agraham Expert Licensed User

    Put this as line 40

    "If KeyDisp.Text ="" Then KeyDisp.Text = 0"

    An optimised app cannot convert an empty string to a number.
  3. Zenerdiode

    Zenerdiode Active Member Licensed User


    Top Man! - Thanks Andrew.

  4. efc_dev

    efc_dev Member Licensed User

    An optimised App could not handle a comparison with a null value.

    For example
    ' myValue comes from a dataset or something else
    ' if myValue has got a null value this returns an error

    if myValue>0 then ' <-- Format Exception

    ' do something
    end if
  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