If there is a textfield “TextField1” and you do
dim TextField1 as string
shouldn’t this create a warning in the “Analysis warnings”? This came up here: https://forum.xojo.com/38591-help and I was astonished to see no warning.
If there is a textfield “TextField1” and you do
dim TextField1 as string
shouldn’t this create a warning in the “Analysis warnings”? This came up here: https://forum.xojo.com/38591-help and I was astonished to see no warning.
It’s a local variable and take precedence.
You can still refer to the control via self.TextField1
Antonio:
the question is valid because some Xojo newbies (but not computer developer newbies) used this “syntax” and asked why this does not works.
and your answer is valid too
Antonio’s answer is correct though. Try removing the Dim from that statement and try again.
TextField1 = "s"
[quote=314872:@Greg O’Lone]Antonio’s answer is correct though. Try removing the Dim from that statement and try again.
TextField1 = "s"
Should be:
TextField1.Text = "s"
[quote=314874:@Simon Berridge]Should be:
TextField1.Text = "s"
Not for the original question on why you don’t get a compiler warning.