Solved

Lvalue Required borland C++ builder

Posted on 2006-07-02
1
1,590 Views
Last Modified: 2013-11-17
sorry if i am unclear... i don't have much experience in C++, maybe 8 months, really don't know much about classes.
what i am trying to do.. .is get the text from a EditBox when i push a button(lets call it button1) and store it in a variable.

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TEnterHandleForm *EnterHandleForm;
//---------------------------------------------------------------------------
__fastcall TEnterHandleForm::TEnterHandleForm(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TEnterHandleForm::Button1Click(TObject *Sender)
{
 // below is the code, the error is now telling me "Lvalue required"
/*   not sure if it matters, but when i click on the "EditBox" it takes me to the function for the edit box (so i can code it)
but if there's no code (hence i didn't code anything in the edit box) the function just dissapears.
*/
  char buffer[40];
  buffer[0] = '\0';
  buffer = EditBoxForPersonsHandle->Text.c_str();

}
0
Comment
Question by:crims
1 Comment
 
LVL 11

Accepted Solution

by:
Jase-Coder earned 125 total points
Comment Utility
you must do one of the following

strcpy(buffer, EditBoxForPersonsHandle->Text.c_str());

of declare buffer as AnsiString and then do the following:

Buffer = EditBoxForPersonsHandle->Text;
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now