I have just started using vb.net 2003 and trying to convert an old vb program. The old defined datatype was:
Type OrderHeader
InvoiceNo As String * 10
CustomerNo As String * 6
End Type
I understand that it is now structured like:
Structure OrderHeader
Private InvoiceNo As String
Private CustomerNo As String
End Structure
but since vb.net will not handle a fixed string length is there any way around this
Thanks
Sammy

Type to Structure conversion
bopamax
Public Class OrderHeader
Private xInvoiceNo As String = Space(10) 'init the string.
Private xCustomerNo As String = Space(6) 'init the string.
Public Property InvoiceNo() As String
Get
Return xInvoiceNo
End Get
Set(ByVal value As String)
xInvoiceNo = value.Substring(0, 10) 'Limit to the first 10 chars.
End Set
End Property
Public Property CustomerNo() As String
Get
Return xCustomerNo
End Get
Set(ByVal value As String)
xCustomerNo = value.Substring(0, 6) 'Limit to the first 6 chars
End Set
End Property
End Class
Dustin.
EJG
Sammy
kscdavefl
I've always made classes.
In any case, my class would work too. Although a little more overhead. lol
Dustin.
IVRsurveys
ataparia
sparky62
Seth Veale
I'm glad I could help. :)
Dustin,
To be honest, you've known things that I haven't and I know things that you haven't. That'll continue, I suspect.
That's why we need each other. :)
(But jeez, what a complicated solution for a declaration ;) )