While working on a new article about Overloads, Overrides, and Shadows (look for it soon), I ran across some additional information that extends an earlier article about instantiating the Form object. The earlier article is:
Multiple Form Instantiation in VB.NET
The added information is in a new Quick Tip that you can find on the site here:
The VB.NET Form as a Class
The basis of inheritance!
The plan is to feature a whole new series of articles about using classes in VB.NET! The first one is already on the site:
Base and Derived Classes
The main idea with classes is that you can adapt them to what you need through inheritance. This article explains this concept "from the ground up" ... it's written for beginners so you don't have to already understand the answer before you read it!
You might not be using class diagrams in Visual Studio Professional. I seldom see them as part of technical presentations or even in articles. They're not required ... unless, of course, you want to get the very most out of Visual Studio!
A new article on the site introduces the Class Designer in Visual Studio .NET Professional. "Professional" is the mid-priced model that has most of the really useful stuff, but not the high-priced extras. A different class diagram tool is in the Ultimate version of Visual Studio and nearly all of the Microsoft documentation applies to the expensive spread. (I wonder why?) I decided to provide where Microsoft does not.
The Class Diagram Tool in Visual Studio
The Sequel!
In which your intrepid guide finds out that the Udacity professor can write code in Python lots better than he can.
Just to complete the story (see below and this link), my Python code worked and passed the automated tests in the class, but when I consulted the approved answer, I discovered that it didn't have to be that hard. So ... just to get as much as I could from this lesson, I also translated the "approved" version of the Python solution to a VB.NET program.
Private Sub btnCheck_Click(
sender As System.Object, e As System.EventArgs
) Handles btnCheck.Click
Dim theString As String = txtString.Text
Dim theStringIndex As Integer = 0
CheckState(txtString.Text, 1)
End Sub
Private Sub CheckState(
theString As String, current As Integer)
' The "approved" Python solution:
' def(fsmsim(String, current, edges, accepting)):
' if string == "":
' return current in accepting
' else:
' letter = string[0]
' if (current, letter) in edges:
' destination = edges[(current, letter)]
' remaining_string = string[1:]
' return fsmsim(remaining_string, destination, edges, accepting)
' else:
' return False
' print (fsmsim("aaa111",1,edges,accepting))
' The VB.NET translation
If theString = "" Then
If current = accepting Then
lblMatch.Text = "True"
Else
lblMatch.Text = "False"
End If
Exit Sub
Else
Dim letter As Char = Strings.Left(theString, 1)
Dim checkKey As New state(current, letter)
If edges.ContainsKey(checkKey) Then
Dim destination As Integer = edges(checkKey)
Dim remaining_string =
Strings.Right(theString, Len(theString) - 1)
CheckState(remaining_string, destination)
Else
lblMatch.Text = "False"
Exit Sub
End If
End If
End Sub