davman2002
Programmer
I need to know if it is possible to assign a value to a label using a variable. For example I would like to be able to create a function that will except an int and if that integer is 1 then the caption of Label1 can be assigned. here is my code
Thanks
void __fastcall TfrmMain::ShowPosition(int VPos, int HPos,int lblNum)
{
if (HPos == 5)
if (VPos == 1)
Label + lblNum->Caption = "UP";
else
Label + lblNum->Caption = "DOWN";
else
if (HPos == 3)
Label + lblNum->Caption = "LEFT";
else
Label + lblNum->Caption = "RIGHT";
}
Thanks
void __fastcall TfrmMain::ShowPosition(int VPos, int HPos,int lblNum)
{
if (HPos == 5)
if (VPos == 1)
Label + lblNum->Caption = "UP";
else
Label + lblNum->Caption = "DOWN";
else
if (HPos == 3)
Label + lblNum->Caption = "LEFT";
else
Label + lblNum->Caption = "RIGHT";
}