|
-
Apr 16th, 2001, 06:01 AM
#1
I have a class file that is basically a data record with all of the necessary property lets and property gets required for access. I also have methods for opening, closing, and writing the data record. The data record is a user-defined type.
What I need to do, is write this user-defined type to a disk file (not a database). The situation is something like this (simplified, as my actual record consists of several layers of user-defined types):
Public class dataRecord
option explicit
private type record
field1 as string * 10
field2 as string * 5
end type
dim rc_Record as record
Property Lets, Property Gets, (etc. etc.)....
Public Function Write_Rec() as Integer
'* This is where my problem is
End Function
What I want to do in the Write_Rec function is to write rc_Record as a whole group to a text file on disk that I have opened as Append. Right now I am doing the following:
Print #fnum, field1;field2;
Does anyone know how I can do this?
Also, along the same lines, I have an Initialize subroutine in this class to fill all fields on the record with spaces. I would like to move spaces to rc_Record instead of to each individual field. Can anyone tell me how this is done as well? And what if some of the items within the record eventually are integers, longs, etc?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|