Hi All,
I was looking through some example code for .NET GIS libary and came acros this:
If cmd = "" Then
Return
Else
If System.String.Compare(cmd, 0, "#", 0, 1, True) = 0 Then
Return
Else
If System.String.Compare(cmd, 0, "select ", 0, 7, True) = 0 Then
DoSelect(cmd)
Else
If System.String.Compare(cmd, 0, "insert ", 0, 7, True) = 0 Then
DoNonQuery(cmd)
Else
If System.String.Compare(cmd, 0, "update ", 0, 7, True) = 0 Then
DoNonQuery(cmd)
Else
If System.String.Compare(cmd, 0, "delete ", 0, 7, True) = 0 Then
DoNonQuery(cmd)
Else
If System.String.Compare(cmd, 0, "ExecuteScalar ", 0, 14, True) = 0 Then
DoExecuteScalar(cmd)
Else
If System.String.Compare(cmd, 0, "open ", 0, 5, True) = 0 Then
DoOpen(cmd)
Else
If System.String.Compare(cmd, 0, "close ", 0, 6, True) = 0 Then
DoClose(cmd)
Else
If System.String.Compare(cmd, 0, "help", 0, 4, True) = 0 Then
DoHelp()
Else
If System.String.Compare(cmd, 0, "set ", 0, 4, True) = 0 Then
DoSet(cmd)
Else
If System.String.Compare(cmd, 0, "prepare ", 0, 8, True) = 0 Then
DoPrepare(cmd)
Else
If System.String.Compare(cmd, 0, "schema", 0, 6, True) = 0 Then
DoGetSchemaTable()
Else
If System.String.Compare(cmd, 0, "path ", 0, 5, True) = 0 Then
DoSetPath(cmd)
Else
If System.String.Compare(cmd, 0, "pack ", 0, 5, True) = 0 Then
DoPack(cmd)
Else
_output.WriteLine(("Unknown command: " + cmd))
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
I don't think they knew how to use a Case statment, I know that the above code will do the same as a Select Case but a least case statments make your code a hell of a lot easier to read.
Happy coding
Nathan