Results 1 to 8 of 8

Thread: Trap Type-Mismatch Error - Resolved

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    Tulsa,Ok
    Posts
    262

    Trap Type-Mismatch Error - Resolved

    Guys,

    I am having a problem trapping an error and VB error handling is not helping me out at all.

    I have the computer connected to a device located on the comm port. It is sending information back to the computer. Occasionally, the device sending data sends back garbage and the vb program crashes.

    I have a sub that is basically like so

    VB Code:
    1. On Error Goto errHandler
    2.  
    3. Select Case Message
    4.  
    5. Case 'blah'
    6.  
    7. Case 'blah blah'
    8.  
    9. End Select
    10.  
    11. Exit Sub
    12.  
    13. errHandler:
    14.   end sub

    It all works fine until I get an extra charicter or a bit flips over the commport. I have a line in the Case statement that looks for certain values and then converts them to normal numbers so a person can read them

    so I have this

    VB Code:
    1. IsNumeric(CInt("&H" & tempCommand))

    If tempCommand comes in like "1E" then all is good
    If it comes in like "1R", I get a type mismatch error.

    Why wont this go to the errHandler?

    Jerel
    Last edited by Phenglai; Nov 20th, 2003 at 01:38 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width