I hope I can explain this. I am coming from the PHP world and somehting that his easy in PHP I am not sure is possible in B4A. I have the code below. It is a number pad for a special calulator i am making. My question is can I set the label name with a variable. So in effect if active cell=1 then LabelVariable = lblDriveEfficiency and if active_cell=2 then LabelVariable = lblDriveEfficiency.
Then for example, I wouldn't have to retype the code below for every label (input) I have. I could just have any of the statements be
{Label_Variable}.text.Text = {Label_Variable}.Text & Send.Tag
Instead of having to code for every label (input) I have.
Thanks,
David
Then for example, I wouldn't have to retype the code below for every label (input) I have. I could just have any of the statements be
{Label_Variable}.text.Text = {Label_Variable}.Text & Send.Tag
Instead of having to code for every label (input) I have.
Thanks,
David
B4X:
Dim Send As Button
Send = Sender
Select Send.Tag
Case "BS"
If lblDriveEfficiency.Text.Length >0 Then
lblDriveEfficiency.Text = lblDriveEfficiency.Text.SubString2(0,lblDriveEfficiency.Text.Length - 1)
End If
Case "." 'Check for and disallow multipole decimal points
If lblDriveEfficiency.Text.Contains(".") Then
Else
lblDriveEfficiency.Text = lblDriveEfficiency.Text & Send.Tag
End If
Case Else
lblDriveEfficiency.Text = lblDriveEfficiency.Text & Send.Tag
End Select