|
-
Nov 9th, 2011, 07:33 PM
#24
Re: Timer delay
When you get that particular message, take a close look at the line that is causing the error. The only way that can happen is if one of the objects is Nothing. Find the object that is Nothing, and all will be well. In this case, there are only two objects in the statement: SerialPort and testArray. Highlight each in turn and you will find that one of them is Nothing (you may have to highlight it and press Shift+F9, because the tooltip seems to often fail when an object is Nothing). I would guess that testArray is Nothing when the error occurs. After all, if SendQueue.Count = 0, then testArray won't be set to anything, which means it will be Nothing, which means that the error is coming from testArray.Length. The reason is that if testArray is Nothing, you can't call a property of it, because Nothing has no properties. So you only want that Write statement inside the If block, because there is nothing to write if there is nothing in the queue.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|