Solved

Save to .tmp file???

Posted on 1998-02-08
12
251 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
 
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now