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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to solve this...

Status
Not open for further replies.

tougo

Technical User
Sep 9, 2002
27
GB
let's say i have this code:

void __fastcall Tx0y0::Button1Click(TObject *Sender)
{
double dxxz,dxyz,dyxz,dyyz;
dxxz = Value2->Text.ToDouble() - Value1->Text.ToDouble();
dxyz = Value3->Text.ToDouble() - Value1->Text.ToDouble();
dyxz = Value5->Text.ToDouble() - Value4->Text.ToDouble();
dyyz = Value6->Text.ToDouble() - Value4->Text.ToDouble();
}
void __fastcall Tx0y0::SaveAsClick(TObject *Sender)
{
if (SaveDialog1->Execute())
Memo1->Lines->SaveToFile(SaveDialog1->FileName);
}
i want to display the dxyz ect results to the memo1 so to save them later on a txt file
 
Use :

void __fastcall Tx0y0::Button1Click(TObject *Sender)
{
double dxxz,dxyz,dyxz,dyyz;
Memo1->Clear();
dxxz = Value2->Text.ToDouble() - Value1->Text.ToDouble();
dxyz = Value3->Text.ToDouble() - Value1->Text.ToDouble();
dyxz = Value5->Text.ToDouble() - Value4->Text.ToDouble();
dyyz = Value6->Text.ToDouble() - Value4->Text.ToDouble();
Memo1->Lines->Add(dxxz);
Memo1->Lines->Add(dxyz);
Memo1->Lines->Add(dyxz);
Memo1->Lines->Add(dyyz);
}

Bye.
 
or stop using the local scope variables and speed things up a bit ?

void __fastcall Tx0y0::Button1Click(TObject *Sender)
{
Memo1->Clear();
Memo1->Lines->Add(Value2->Text.ToDouble() - Value1->Text.ToDouble());
Memo1->Lines->Add(Value3->Text.ToDouble() - Value1->Text.ToDouble());
Memo1->Lines->Add(Value5->Text.ToDouble() - Value4->Text.ToDouble());
Memo1->Lines->Add(Value6->Text.ToDouble() - Value4->Text.ToDouble());
}
 
i could do this but in that way i cannot (iam not sure) ..i suppose i would have no way in using the values later in the program except perhaps if i access them from the memo
thank you tho
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top