Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the property Text of TEdit

Status
Not open for further replies.

ricoswave

MIS
Joined
Aug 18, 2004
Messages
2
Location
NL
Hello Everybody,

Since last week I'm began to pick up the skills of C++ Builder (Borland).

I thought I could write a simple program where input with Tedit component would be stored in a file.

In previous version I used this to take the input that is typed in the Tedit box:

writetofile << Edit1->Text;

Without conversions the input was written to the file.

But now in version 6 of Builder, this is not working. The compiler gives an error with is not member of AnsiString.

Can somebody help me how I can take the userinput (mostly text) to a file. For the file operations I use iostream.h .

Please some advise or help.

Thank in advance,

Rico
 
Try
Code:
writetofile << (Edit1->Text).c_str()
or
Code:
AnsiString MyInput = Edit1->Text;
writetofile << MyInput.c_str();
You are supposed to be able to include some header that will give you this ability but I don't remember what it is right now. I use the above method all the time anyway.

James P. Cottingham
-----------------------------------------
To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.
 
James,

Thank you very very much; it works.

After all it seems so simple and obvious...


thanx again!


Rico
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top