|
Subject:
|
Chapter 5 and 6 of Beg. VB.Net 2003
|
|
Posted By:
|
Koga
|
Post Date:
|
10/6/2004 9:07:01 AM
|
Can somebody please tell me what I did wrong because I followed the book and looked at the code in the Wrox website an it still does not solve my issue.
For chapters 5 and 6:
Chapter 5: Public ReadOnly Property SelectedCustomers() As Customer Get 'do we have a selection If lstCustomers.SelectedIndex <> -1 Then 'return the selected customer... Return lstCustomers.Items(lstCustomers.SelectedIndex) End Get End Property
Chapter 6: 'UpdateDisplay- update the display... Public Function UpdateDisplay() As String 'What text do we want to use? Dim strCountText As String = txtWords.Text Dim strResultText As String 'do we want to count words? If radCountWords.Checked = True Then 'count the words... Dim intWords As Integer = CountWords(strCountText) 'return the text... strResultText = intWords & "words" Else 'count the chars... Dim intChars As Integer = CountCharacters(strCountText) 'return the text... strResultText = intChars & "characters" End If 'update the display... lblResults.Text = strResultText End Function Every time I run and change this code to the book it says that my If statement needs a null set value set or all the possibilites will not be considered during runtime. I appreciate if anyone can tell me what I need to do and what I did wrong. Thanks.
|
|
Reply By:
|
Thearon
|
Reply Date:
|
10/9/2004 5:02:15 AM
|
The If statement for your code from Chapter 5 needs a closing End If statement. My question to you is have you downloaded and tried running the code samples from Chapters 5 and 6? I would do this and compare that code against the code that you created.
Thearon
|