vb6 printing to text file from array data

Need code module to convert array data to delimited text in note oad o

Page 1 of 1

3 Replies - 13805 Views - Last Post: 06 February 2007 - 11:20 PM Rate Topic: -----

#1 leo1937ca  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 06-February 07

vb6 printing to text file from array data

Posted 06 February 2007 - 07:30 PM

I am creating a lottery program that creates (3) arrays one is compiled in a manner that I would like to print to a space delimited Text File with a txt extension that can be used in notepad, but I cannot find any code examples that help solve the problem of converting the array data to Text File Text. The Program in written using vb6.

Any help will be appreciated..

Thank You In Advance

This post has been edited by leo1937ca: 06 February 2007 - 07:39 PM

Is This A Good Question/Topic? 0
  • +

Replies To: vb6 printing to text file from array data

#2 Louisda16th  Icon User is offline

  • dream.in.assembly.code
  • member icon

Reputation: 15
  • View blog
  • Posts: 1,967
  • Joined: 03-August 06

Re: vb6 printing to text file from array data

Posted 06 February 2007 - 07:40 PM

If you want to save data to a file, use file system objects:
Click Here

This post has been edited by Louisda16th: 06 February 2007 - 07:40 PM

Was This Post Helpful? 0
  • +
  • -

#3 leo1937ca  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 06-February 07

Re: vb6 printing to text file from array data

Posted 06 February 2007 - 08:18 PM

View PostLouisda16th, on 6 Feb, 2007 - 07:40 PM, said:

If you want to save data to a file, use file system objects:
Click Here


Thanks Louisda16th based on the MSDN data you sterred me to I think I can put it all together.. Your Help Is deeply appreciated.. Thanks again..

leo1937ca
Was This Post Helpful? 0
  • +
  • -

#4 m2s87  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 390
  • Joined: 28-November 06

Re: vb6 printing to text file from array data

Posted 06 February 2007 - 11:20 PM

:ph34r: Depending on what basic are you using, it would look like:
vb 8 a la vb.net:
		Try
			My.Computer.FileSystem.WriteAllText("C:\FileToSave.EXTENTION", Join(myarray, " "), False)
		Catch ex As IO.IOException
			MsgBox("System was unable to save to the file!")
		End Try


vb 6 a la vb classic:
you need a snippet from here.
if sisu_v("C:\FileToSave.EXTENTION", Join(myarray, " ")) = false then Msgbox("System was unable to save to the file!")


This community likes to see you try, before helping you. But i guess it is just 1-liner, so it would not hurt.

Hope it helped :D

This post has been edited by m2s87: 06 February 2007 - 11:21 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1