...
Dim packet As String ' data from http socket perhaps or user input
' imaginary data
packet = "read:c:/temp/fred.txt"
Dim code As String = packet.SubString2(0,packet.IndexOf(":"))
Try
asJO(Me).RunMethod("_"& code , Array(packet.SubString(packet.IndexOf(":")+1)))
Catch
Log("no such sub found")
End Try
...
Sub asJO(o As JavaObject) As JavaObject
Return o
End Sub
Sub read(s As String)
' read the file c:/temp/fred.txt here
Log("magic it got here without any if ... then or switch statements")
Log(s)
End Sub