Application behaves differently in PPC

Discussion in 'Questions (Windows Mobile)' started by mozaharul, Jul 30, 2008.

  1. mozaharul

    mozaharul Active Member Licensed User

    Hi,

    I’m running the program in desktop and in PPC in gives error message only in PPC. The message happens with the lost focus of a test box. The message is like :

    “An error occurred on sub_txtname_ lostfocus
    FormatException
    Continue ?”

    The code for the sub_txtname_ lostfocus is :

    Sub txtname_LostFocus ' Mother entred before child and checking the sex against the mother-number entred.
    If txtmn.Text > 0 AND txtmn.Text < txtmemno.text Then
    mperid=txthhidm.Text*100 + txtmn.Text ' mperid is a global variable to hold run-time generated mother's perm_pid.
    cmd.CommandText="select name,sex,dob,perm_pid from member where perm_pid ="&mperid&""
    cmd.ExecuteTable("table15",0)
    sexmother = table15.Cell("sex",0)
    If sexmother = 1 Then
    Msgbox("Wrong mother number '" & table15.cell("name",0) & "' is male, so cannot be mother")
    txtmn.Text=""
    txtmn.Focus
    Return
    Else
    i=Msgbox ("Is ' " & table15.Cell("name",0) & " ' the mother of ' "& txtname.Text&" ' being entered now?","Mother of Member",cmsgboxyesno,cmsgboxquestion)
    If i=cyes Then
    cmbsex.Focus
    Return
    Else
    txtmn.Focus
    Return
    End If
    End If
    End If
    End Sub

    I know that only the above lines are not enough to make sense. But expecting help.


    regards,
     
  2. agraham

    agraham Expert Licensed User

    Debugging on a PPC is much more difficult than on the desktop. You can find which line is giving the error by putting lines such as "msgbox("line 23") at one or more places in your code or use the Tracer object in my debug library http://www.basic4ppc.com/forum/additional-libraries/2328-debug-library.html to output trace messages to a separate window. You can then edit and run your code, altering the position and content of these messages, on the device and so get some indication as to what is happening.
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Another thing you can try is to run your code from the device IDE and see the exact line that raises the error.
     
  4. mozaharul

    mozaharul Active Member Licensed User

    Thank both of you very much.

    I got the point generating the error message!

    regards,
     
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