5 Replies - 2335 Views - Last Post: 01 November 2012 - 08:07 AM Rate Topic: -----

#1 kspeck06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 31-October 12

Read&Write text files from textboxes

Posted 31 October 2012 - 04:50 PM

Hey, Im new with VB6 so bear with me. Im trying to make a program that will take text from 6 different textboxes and save them to a .txt document. The first textbox will get added into a listbox, and when in the listbox that name is selected, and later when the command button "load" is clicked, it will load that .txt file and place all of the text back in their appropriate textboxes. Im sure this is probably really basic, but im trying to learn it on my own. Ill show you what little I already have.
 ' Get a free file number
FileNum = FreeFile

' Create Test.txt
Open App.Path & itemname.Text + ".txt" For Output As FileNum

' Write the contents of TextBox1 to Test.txt
Write #FileNum, itemname.Text
Write #FileNum, user.Text
Write #FileNum, pass.Text
Write #FileNum, commentbox.Text
Write #FileNum, datebox.Text
Write #FileNum, time.Text

' Close the file
Close FileNum


Thanks for helping guys!

Is This A Good Question/Topic? 0
  • +

Replies To: Read&Write text files from textboxes

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5522
  • View blog
  • Posts: 11,830
  • Joined: 02-June 10

Re: Read&Write text files from textboxes

Posted 31 October 2012 - 05:31 PM

If you're new, are you sure you're doing VB6? Seems unlikely that a new coder would pick out a long out of date language like VB6. Do you perhaps mean VB.NET?
Read this: http://www.dreaminco...his-is-old-vb6/

If you do really mean VB6 - WHY? Why would you go to this dead legacy language? At least go to VB.NET to start with.


Next: You haven't described any problem, or question or error... What do you want from the volunteers here?
Was This Post Helpful? 0
  • +
  • -

#3 kspeck06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 31-October 12

Re: Read&Write text files from textboxes

Posted 31 October 2012 - 05:43 PM

Yeah, Im sure Im using VB6.0. I've been using it because its the language my friend uses, so thats where I started. Secondly my problem is, Ive been searching the web for a few days now, and I can seem to figure out how to save a series of text boxes into the same folder, but I cant figure out how to load them line by line from the text file back into their corresponding textboxes.
On a side note, being a fairly new person in this language, which language would you recommend to start with?
Was This Post Helpful? 0
  • +
  • -

#4 kspeck06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 31-October 12

Re: Read&Write text files from textboxes

Posted 31 October 2012 - 05:48 PM

series of textboxes into the same file*
Was This Post Helpful? 0
  • +
  • -

#5 kspeck06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 31-October 12

Re: Read&Write text files from textboxes

Posted 31 October 2012 - 06:55 PM

I solved the problem, I needed to split my arrays after I saved my text files, Ill upload the code after Im done, and ll see what my queston was. haha
Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5522
  • View blog
  • Posts: 11,830
  • Joined: 02-June 10

Re: Read&Write text files from textboxes

Posted 01 November 2012 - 08:07 AM

As for language, its all equally new to you. So don't spend hundreds of hours on a language that nobody hires for anymore. Its a silly waste of your time. I prefer C#. You might consider VB.NET so you can get some help from your friend who already knows some ancient VB6 while at the same time you can help him move up to a modern language. You can help each other.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1