?
Solved

Save to .tmp file???

Posted on 1998-02-08
12
Medium Priority
?
257 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
[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
  • 6
  • 6
12 Comments
 
LVL 3

Accepted Solution

by:
q2guo earned 80 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

762 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