Solved

Save to .tmp file???

Posted on 1998-02-08
12
255 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 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
Industry Leaders: 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

Technology Partners: 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!

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

749 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