09 August, 2009

Chapter 8 project

In the btnClear_Click event handler, nine lines of code are used to change various labels, buttons, text boxes and list boxes from visisble to not visible. Isn't there a way of doing this in one line of code, i.e. so that you can say Me.(this and this and this and this).Visible = False??

Session 6

* Today we talked about the Try-Catch set of statements as well as the various types of exceptions used when handling errors.
* An exception is a class of objects.
* All exceptions share certain characteristics.
* Some of the possible exception types include:
1. ArgumentNullException - a variable that has no value is passed to a procedure;
2. DivideByZeroException - a value is divided by zero;
3. FormatException - a variable is converted to another type that is not possible;
4. NullReferenceException - a procedure is called when the result is not possible;
5. OverflowException - a value exceeds its assigned data type;
6. SystemException - used to catch all generic exceptions.

03 August, 2009

Session 5

* After the test we started working through Chapter 8, Using Procedures and Exception Handling.
* We talked about the fact that it's good to break your code into multiple small procedures so that they are easy to maintain and re-use.
* We recapped the difference between procedures and functions (a function returns a value).
* An example of procedure might be (the keyword sub tells us it is a procedure):
Public Sub MyProcedure()
'Do Something
End Sub
* An example of a function might be:
Public Function MyFunction() As Boolean
'Do Something
End Function
* Function is the keyword, MyFunction is the name, Boolean is the value.
* The data type or value stipulated depends on what the code is looking for.
* An example of a function is the IsNumeric function - it is a common task for which code has been written and added to the VB library so that it can be reused.
* We also briefly touched on the parameters ByVal and ByRef.
* When you enter arguments into a function, intellisense automatically adds in one of these parameters for each of the arguments.
* ByVal passes the actual object to the function (a duplicate is created), ByRef passes a reference to the object to the function.

02 August, 2009

Chapter 7 Test.

Just finished studying for the Chapter 7 test. Don't know if it's just me, but the multiple choice questions seemed a bit more "duh'uh" than normal, e.g. Which property of a CheckBox indicates that it has been checked? Erm, the Checked property??!! And which object shows the days organised by month relevant to the year? Erm, Calendar anyone??!! Or am I just being a smart arse ...

Chapter 7 project

This was a horrible project as the Guided Program Development had lots of confusing and omitted information. Once I got past the part where you had to resize and position the div elements it got a bit better. Spent a lot of time looking back in the chapter for information that seemed to be missed out though, for example the Guided Program Development omitted to tell you what to name the Calendar object so I had errors in my code. Luckily it was pretty easy to correct.

Session 4

* Last Tuesday we started off by talkign about string functions:
.Length - finds the length of strings
.ToLower() - converts the string to all lower case
.ToUpper() - converts the string to all upper case

* We also talked about Validation Controls, e.g. The RequiredFieldValidator.
* The RFV can be assigned a TextBox to "watch" or we can code the validation ourselves.

* Finally we worked on the Chapter 7 project ...

I Tweeted!

In session 3 we also set up Twitter accounts! My user name is Chippyandme.

We then opened up the Twitterizer.Framework file and imported the framework so that we could update our Twitter posts direct from our VB program - very cool!!