This code isn't working, and I didn't expect it to. I'm using it to try and describe what I'm trying to do. I would like to store a method as one would store a variable. Is this possible? Is it bad practice?
Code:Private Delegate Sub ParseMethod(segment As String) Private Sub Parse(x12 As String, delimiter As Char) For Each segment In x12.Split(delimiter) Select Case segment.Substring(0, 2) Case "HL" ParseMethod = AddressOf ParseHl Case "CL" ParseMethod = AddressOf ParseCL Case "SV" ParseMethod = AddressOf ParseSV Case Else ParseMethod(segment) End Select Next End Sub Private Sub ParseHl(segment As String) End Sub Private Sub ParseCL(segment As String) End Sub Private Sub ParseSV(segment As String) End Sub




Reply With Quote