I hope you donât mid if I make this easier to read:
Code:
Public Type JobInfo
tmpLastname As String * 25
tmpFirstName As String * 20
tmpAddress As String * 45
tmpCity As String * 20
tmpState As String * 3
etc....
and the MyRTF As Long
End Type
Processed like this:
Code:
Public Sub SaveRandomData(ByVal sFilename As String, _
myData As udtRandomData, _
MyRTF As String)
Dim b() As Byte
Open sFilename For Binary As #1
Put #1, , myData
If myData.SizeRTF Then
b = MyRTF ' Cast string to Byte Array
Put #1, , b
End If
Close #1
End Sub
Public Sub LoadRandomData(ByVal sFilename As String, _
myData As udtRandomData, _
MyRTF As String)
Dim b() As Byte
Open sFilename For Binary As #1
Get #1, , myData
If myData.SizeRTF Then
ReDim b(myData.SizeRTF * 2 - 1) As Byte
Get #1, , b
MyRTF = b ' Cast byte array to string.
End If
It is a bad idea to hardcode file numbers. You really should use FreeFile to obtain a known-good filenumber. reduces the potential for collisions...
I don't follow your question. Do you want to add an argument to the argument list of the sub(s)?
If that's it, you could add an optional argument (so you could add a value there sometimes, and not add it other times), and then test for the presence of a second value, and process accordingly.
Alternately, you could change the signature to
Code:
Public Sub LoadRandomData(ByVal sFilename As String, _
myData As udtRandomData, _
MyRTF() As String)
and count how many elements there are in the array, repeating the processing for each element.
What say you?