Save to .tmp file???

How do I take the value of Edit1 and save it to a .tmp file???

thanks.
LVL 1
stevenc317Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

q2guoCommented:
ofstream OUTFILE("temp.tmp",ios::out);  // open file for                                                 // writing
OUTFILE << edit1;
OUTFILE.close();

By the way, what is edit1;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stevenc317Author Commented:
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
q2guoCommented:
#include <fstream.h>

What compiler are you using?
Are you programming in windows or dos?
0
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

stevenc317Author Commented:
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
q2guoCommented:
hex??  What are you trying to save?  What is 'edit1' in you
questioN?
0
stevenc317Author Commented:
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
q2guoCommented:
Are you using visual C++?
0
stevenc317Author Commented:
I am using Borland C++ Builder v1.0 for Win95
0
q2guoCommented:
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
stevenc317Author Commented:
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
q2guoCommented:
I was just giving you an example.  getContent() is not
a member function.  You should look up help for the actual
function.
0
stevenc317Author Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.