|
-
Jun 20th, 2010, 03:45 PM
#4
Re: [RESOLVED] what is wrong with this? Not checking at all?
You're welcome! 
I have one more recommendation for you that will make your life a lot easier, especially when working with larger projects. Take up and use a naming convention for variables and controls. Adding prefixes like txt to text boxes, lbl to Lables, lst to Listboxes etc. So you have something like:
txtUsername
lblTitle
lstItems
Same goes for variables, you can use one letter prefixes, but I like to use three, for example
Dim lngI As Long
Dim strUsername As String
The point of this is that then you know the control or variable type just by looking at the name, and you don't have to check the declaration. So when you see "bolFound" in the code, you immediately know that it's a Boolean type variable.
It makes debugging a lot easier. For example if this line of code was giving you a Type mismatch error:
users = "something"
(assuming 'users' an Integer) You need to poke around to figure out why, but if you declared with a prefix you would have
intUsers = "something"
and will instantly know that the problem is that you are trying to assign a string value to an integer variable.
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
|