Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Saving Data to disk

Posted on 2000-03-06
5
Medium Priority
?
149 Views
Last Modified: 2010-05-02
I need to save data, namely text, to disk. How do I do this. What command do I use?
0
Comment
Question by:R_N_WARD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
pit_ earned 200 total points
ID: 2588684
The easiest way to save text to a file is to first, open a file on the disk, then write the text out, and then close the file.


Dim ff As Integer
Dim strFileName as String

ff = FreeFile
strFileName = "data.txt"

Open strFileName For Output As ff
Print #ff, strData
Print #ff, strData2
  ...
Close ff
0
 
LVL 2

Expert Comment

by:danelroisman
ID: 2588709
'Save text into the file:
Dim number As Integer
number = FreeFile

Open "Text.txt" & MyIndex For Output As number
   Write #number, "This is a sample."
Close #number

0
 

Author Comment

by:R_N_WARD
ID: 2588712
Thank you.  A++.  Now could you tell me how to loud the data back to the textbox?
0
 
LVL 1

Expert Comment

by:pit_
ID: 2588730
Pretty much the same way, except instead of opening the file for Output, open it for Input and use Input #ff, ...


ex.

Open strFileName For Input As ff
Input #ff, strData
Close

txtBox.Text = strData
0
 

Author Comment

by:R_N_WARD
ID: 2588746
Thanks for all the help
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question