if the label of button convertFromOptionMenu is "Please choose."
then
return ("Please choose.")
end if
For some reason LiveCode is returning error:
Compilation error at line 11: (Properties expecting ‘of’) near “label”, char 7
I don’t get why its giving me this error.
I tried rewriting it etc.
I'm running LC 9 .5 .1 on windows 10
Any ideas?
function testLabel
if the label of button convertFromOptionMenu is "Please choose." then
return "Please choose."
else
return "label is not = Please choose."
end if
end testLabel
hi, I was probably not clear… the problem is that LC is throwing me an error for not putting ‘of’ after label even though its written…
sorry for not being clear, and thanks for your answer
PS
I have run this code about a month now, and I didn’t do any changes and suddenly its throwing me this error
Certainly good practice dictates that quotes be used as you stated. But LC, like HC before it, is loosey goosey about this, as you know. Unless there is a name conflict, LC will "find" the unquoted button.
I suspect, again assuming no conflict, that something else is amiss.
Jean-Marc's example has moved "then" to the end of the first line rather than putting it on the next line. LC is very flexible about this and your method should work, but try moving it to see if that helps.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Ok, thanks for your answers
I will try and put the name inside “” I probably missed it
About the then it is on a different line just a problem of copying the code…
I did restart LC and my whole computer…
Ill the name inside “” and see.
THANK YOU VERY MUCH!
Yes, putting it inside “” works!
It’s weird because I’ve bean running this code for some time now and it didn’t seem to care…
Anyways, thanks
PS
I’ve been finding 9 .5 .1 buggy… where can I report these? Stuff like LC not finishing functions and more (for exm. Function XXX LC some decides not to do end XXX)
Well, bug reports go there, but is this technically a 'bug' ? After all, AGC studios had variable checking on in the editor, and an unquoted name, which looks to Lc like...like...well, like a variable. Examples might be ..