how do i change a label text using an if then statement...basically, the if statement should change label.text to "LEFT" if conditions met,otherwise "RIGHT".
If leftish Then labe1l.text = "LEFT" Else label1.text = "RIGHT"
If hand = "left" Then label1.text = "LEFT" Else label1.text = "RIGHT"
You've very nearly written it! If using the desktop IDE then you can get hints as soon as you start typing.
I'd expect to use something like:
B4X:If leftish Then labe1l.text = "LEFT" Else label1.text = "RIGHT"
(Where "leftish" is either a variable which is True for the "left" condition and False for "right", or is replaced by something like:
)B4X:If hand = "left" Then label1.text = "LEFT" Else label1.text = "RIGHT"
BTW If you expect to have several labels on your form it may be better to ignore the suggested names "Label1" etc and replace them with something more descriptive such as "LabHand" ...
HTH, Mike.
There's nothing I can see wrong with that statement,it works if I cut and paste it, so the problem is probably with Label3.If sin(((a*10)-b)*cPI/180)*c <0 Then Label3.text="RIGHT" Else Label3.text="LEFT"
If Sin(((a*10)-b)*cPI/180)*c = 0 Then
Label3.text="RIGHT"
Else
Label3.text="LEFT"
End If
For e.g Add 1800 hrs 55 min 'shud appear as 1800:55
and 2500 hrs 40 min 'shud appear as 2500:40