I am using 3.9.9.2538 which is the latest version of AHMIv399yBeta38.
But I was just lucky both times apparently.
Here is what I meant, below is an example that works:
Public Class U02_Station
Public Limits(1) As U01_Limit
Public Name20 As String
End Class
But this wont work:
Public Class U02_Station
Public Name20 As String
Public Limits(1) As U01_Limit
End Class
Since custom string is treated as a UDT. you will need to define it first:
Public Class String20
Public Length As Integer
Public Characters() As System.SByte
Public Sub New()
MyBase.New
Me.Characters = New System.SByte((20) - 1) {}
End Sub
Public Sub New(ByVal value As String)
MyBase.New
Me.Length = Math.Min(20, value.Length)
If (value.Length > 20) Then
value = value.Substring(0, 20)
End If
Dim TmpArray() As Byte = New Byte((20) - 1) {}
System.Text.ASCIIEncoding.ASCII.GetBytes(value).CopyTo(TmpArray, 0)
Me.Characters = CType(CType(TmpArray, Array), System.SByte())
End Sub
Public Overrides Function ToString() As String
Return System.Text.Encoding.ASCII.GetString(Array.ConvertAll(Characters, Function(a) CByte(a)))
End Function
End Class
then
Public Class U02_Station
Public Name20 As New String20
Public Limits(1) As U01_Limit
End Class