G
Guest
VB6 allowed you to define User types that you could write to file using the
[Put] statement. This is a nice way to generate fixed length text files. See
Below. VB.NET does not support UserTypes with fixed length strings in the
same way.
How do you do this in VB.NET?
Thanks,
Ken
============
Code Snipit
============
Private Type DAlloc
Code As String * 1
Amount As String * 10
Filler As String * 2
End Type
Dim Debit As DAlloc
Dim i as Integer
Dim iOutFile as Integer
iOutFile = FreeFile
Open msOutFile For Random As #iOutFile Len = Len(Debit)
Debit.Filler = VbCr
For i = 1 To 5
Debit.Code = i
Debit.Amount = CStr(i *2)
Put #iOutFile, , Debit
Next
============
[Put] statement. This is a nice way to generate fixed length text files. See
Below. VB.NET does not support UserTypes with fixed length strings in the
same way.
How do you do this in VB.NET?
Thanks,
Ken
============
Code Snipit
============
Private Type DAlloc
Code As String * 1
Amount As String * 10
Filler As String * 2
End Type
Dim Debit As DAlloc
Dim i as Integer
Dim iOutFile as Integer
iOutFile = FreeFile
Open msOutFile For Random As #iOutFile Len = Len(Debit)
Debit.Filler = VbCr
For i = 1 To 5
Debit.Code = i
Debit.Amount = CStr(i *2)
Put #iOutFile, , Debit
Next
============