This may sound silly, but your program isn't smart. It will only do what you tell it to do.
So when you say, "Why isn't this thing working?" the answer is almost always, "Because you told it not to."
Working incrementally toward an objective is a good idea. By this, I mean I've found that taking small steps is a good strategy. Instead of building the entire program and seeing if it works, make the building blocks work as you're creating your program.
Visual Basic may not be quite so easy. You may need to build up the foundation before you can test your program.
Here are some tips I hope will be helpful.
- Use break points (in Visual Studio). At certain points within your code, you'll expect things to happen. You may expect an array to be populated, a variable to be filled or a counter to be incremented. Using a break point to inspect the contents just may give you the clue you need.
- Use var_dump(). In PHP, var_dump() is not to be underestimated. Knowing the state of objects and the contents of variables is never more than an echo statement away. For example, instead of using echo "$variableOne"; you should use echo var_dump($variableOne);. If you had instead used an echo statement, you will receive no output if the contents of $variableOne are null. Using var_dump(), you will either see that the variable's contents are null, or a description of the variable itself and also the contents.
- Finish everything that you start. When creating tag pairs in HTML or XML, create the pair and then fill in the text and attributes. This should keep you from later inspecting each element from line 1 down, looking for an elusive closing tag.
- Use a good text editor. You can write code in any language with notepad. However, it won't help you with indents. Or color coding. Or tag matching. Using a text editor like Komodo-Edit (http://www.activestate.com/komodo-edit/downloads), NotePad++ (http://notepad-plus-plus.org/download) or JEdit (http://www.jedit.org/index.php?page=download) will save you time and errors. These are not the only full-featured text editors, but they should get you started.
Hopefully this is enough to get you started.