MajorGeeks Support Forums

Go Back   MajorGeeks Support Forums > ----------= PC, Desktop and Laptop Support =---------- > Software
Register FAQ Members List Calendar Casino Mark Forums Read

Software Software such as operating systems like Windows XP, Windows Vista, Windows 7 etc., or specific programs.


Reply
 
Thread Tools Display Modes
  #1  
Old 05-25-06, 09:47
ceal21c ceal21c is offline
Private First Class
 
Join Date: Mar 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default Saving strings as csv files in VB6

Hey Guys,

How can I save a string (or array) as a comma seperated value? I can read csv files and store the data as a string or an array but when I try to save the data after I have edited it, it looses the csv format and is saved as one long line.

This is the code I use to read the data:
Open "c:\XFER\Users\users.csv" For Binary As #1
strUserList = Input(LOF(1), #1)
Close

And this is the code I use to write data:
Open "c:\XFER\Users\users.csv" For Output As #1
Write #1, strUpdatedUserList

Where am I going wrong?
Reply With Quote
Sponsored links
  #2  
Old 05-25-06, 10:43
ceal21c ceal21c is offline
Private First Class
 
Join Date: Mar 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Cool Re: Saving strings as csv files in VB6

Found that using Print #1, strUpdatedUserList instead of Write #1, strUpdatedUserList works GREAT!
Reply With Quote
  #3  
Old 05-25-06, 19:48
Kodo's Avatar
Kodo Kodo is offline
SNATCHSQUATCH
 
Join Date: Jan 2002
Location: Syracuse NY, USA
Posts: 11,502
Thanks: 17
Thanked 72 Times in 49 Posts
Default Re: Saving strings as csv files in VB6

use the Scripting.Filesystem Object for your file I/O operations in VB6. it will save you much time. Yes.. I said scripting.. it will still work in VB6..
__________________
"The American people will never knowingly adopt Socialism..." -Norman Thomas
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:18.

MajorGeeks.Com Menu

MajorGeeks.Com \ All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ NEW! PC Games \ System Tools \ Macintosh \ Demonews.Com \ Top Downloads

MajorGeeks.Com \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds


All content Copyright MajorGeeks.com source code Powered by vBulletin® Version 3.8.4
Copyright © 2009 vBulletin Solutions, Inc. All rights reserved.
Ad Management by RedTyger