Page 1 of 1

A question about Borland C++ 6 builder

Posted: Sat May 12, 2007 9:49 am
by LtForce
This question is not about RF, but I'm learning to program with C++ now and I can't figure out this problem. Here's the script:

Code: Select all

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

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
Edit1:Text="Hello";
}
//---------------------------------------------------------------------------
This is supposed to di this: when I press button 1 Edit1's text is supposed to turn "Hello", but it doens't. It all happens wrong - the main window's name turns Hello. If you don't understand what I'm talking about (I don't yet know how to speak english about programming very well) I'll post some screens

Posted: Sat May 12, 2007 1:46 pm
by QuestOfDreams
I don't have bc++6 so I can only guess... it probably should be

Code: Select all

Edit1->Text = "Hello";
or

Code: Select all

Edit1->SetText("Hello");
or something like that...

Posted: Sat May 12, 2007 2:46 pm
by LtForce
Thanks!