|
-
July 4th, 1999, 04:28 AM
#1
Writing to sequential text file
Im having a small problem writing my udt array back to a text file with the comma delimted format, loading the file into the array first time is fine but when i write it back to the file the formatting disappears and the text file is lined up in columns instead of comma delimited.
Dim intFileNum as Integer
intFileNum = FreeFile
Open "a:\vb501\quest1.txt" for Output as intFileNum
for intPosn = 1 to intTotalRecords
print #intFileNum, PhoneArray(intPosn).Firstname, _
PhoneArray(intPosn).LastName, _
PhoneArray(intPosn).Home, _
PhoneArray(intPosn).Work, _
PhoneArray(intPosn).Mobile, _
PhoneArray(intPosn).Address, _
PhoneArray(intPosn).Email
next
Close intFileNum
thats the code im using to write the array back to the file in my save function, like i said before it is writing it back without the commas and is lining it all up in columns so next time it doesnt open properly, any help would be appreciated.
-
July 4th, 1999, 10:09 PM
#2
Re: Writing to sequential text file
try the following :
PhoneArray(intPosn).Firstname, & "," & _
PhoneArray(intPosn).LastName, & "," & _
PhoneArray(intPosn).Home, & "," & _
PhoneArray(intPosn).Work, & "," & _
PhoneArray(intPosn).Mobile, & "," & _
PhoneArray(intPosn).Address, & "," & _
PhoneArray(intPosn).Email
EFD
-
July 5th, 1999, 01:09 AM
#3
Re: Writing to sequential text file
Thankyou i needed to remove the commas after the variables to, Thanks again.
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
|