Welcome to Dream.In.Code
Become a VB Expert!

Join 137,229 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,880 people online right now. Registration is fast and FREE... Join Now!




vb6 printing to text file from array data

 
Reply to this topicStart new topic

vb6 printing to text file from array data, Need code module to convert array data to delimited text in note oad o

leo1937ca
6 Feb, 2007 - 06:30 PM
Post #1

New D.I.C Head
*

Joined: 6 Feb, 2007
Posts: 2


My Contributions
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: 6 Feb, 2007 - 06:39 PM
User is offlineProfile CardPM
+Quote Post

Louisda16th
RE: Vb6 Printing To Text File From Array Data
6 Feb, 2007 - 06:40 PM
Post #2

 
Group Icon

Joined: 3 Aug, 2006
Posts: 1,790



Thanked: 1 times
Dream Kudos: 755
My Contributions
If you want to save data to a file, use file system objects:
Click Here

This post has been edited by Louisda16th: 6 Feb, 2007 - 06:40 PM
User is offlineProfile CardPM
+Quote Post

leo1937ca
RE: Vb6 Printing To Text File From Array Data
6 Feb, 2007 - 07:18 PM
Post #3

New D.I.C Head
*

Joined: 6 Feb, 2007
Posts: 2


My Contributions
QUOTE(Louisda16th @ 6 Feb, 2007 - 07:40 PM) *

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
User is offlineProfile CardPM
+Quote Post

m2s87
RE: Vb6 Printing To Text File From Array Data
6 Feb, 2007 - 10:20 PM
Post #4

D.I.C Regular
Group Icon

Joined: 28 Nov, 2006
Posts: 390



Thanked: 1 times
Dream Kudos: 1225
My Contributions
ph34r.gif Depending on what basic are you using, it would look like:
vb 8 a la vb.net:
CODE
        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.
CODE
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 biggrin.gif

This post has been edited by m2s87: 6 Feb, 2007 - 10:21 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 03:11PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month