Solved

Save to .tmp file???

Posted on 1998-02-08
12
253 Views
Last Modified: 2010-04-10
How do I take the value of Edit1 and save it to a .tmp file???

thanks.
0
Comment
Question by:stevenc317
  • 6
  • 6
12 Comments
 
LVL 3

Accepted Solution

by:
q2guo earned 20 total points
ID: 1181344
ofstream OUTFILE("temp.tmp",ios::out);  // open file for                                                 // writing
OUTFILE << edit1;
OUTFILE.close();

By the way, what is edit1;
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1181345
It is not working.  I may need to include some headers, which should I use??  Also I have one more quick question.  What do I do so that I can display the contents??
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1181346
#include <fstream.h>

What compiler are you using?
Are you programming in windows or dos?
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 1

Author Comment

by:stevenc317
ID: 1181347
I am using Borland C++ Builder v1.0 (standard) for Win95.  It now works, but it is saving the information in hex.

how do I get it to be saved as ASCII???
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1181348
hex??  What are you trying to save?  What is 'edit1' in you
questioN?
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1181349
Edit1 (it is really Edit2, I made an error when I asked the question) anyway, it is a text blank. Just like the one you use to increase the points in Experts Exchange.
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1181350
Are you using visual C++?
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1181351
I am using Borland C++ Builder v1.0 for Win95
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1181352
So, edit2 is actually a editbox.
No wonder you were getting hex in the temp file.
Now, I have never used Borland C++ builder before.
But, there must be a member function that you can call
which will return the contain of the editbox.
Look up help in your Borland C++ builder under member function
of an editbox

assume the function is called getContent.

This is how you call it
OUTFILE << edit2.getContent();



0
 
LVL 1

Author Comment

by:stevenc317
ID: 1181353
error message..
[C++ Error] Options.cpp(24): Structure requires on left side of. or .*.

I used the following codes (that made that error)...


ofstream OUTFILE("temp.tmp",ios::out); // open file for writing
  OUTFILE << Edit2.getContent();
  OUTFILE.close();
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1181354
I was just giving you an example.  getContent() is not
a member function.  You should look up help for the actual
function.
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1181355
thanks
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

770 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