not finding 'of'

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
AGC studios
Posts: 21
Joined: Thu Apr 23, 2020 1:49 pm

not finding 'of'

Post by AGC studios » Thu Apr 23, 2020 2:02 pm

Hi, I'm running this code:

Code: Select all

   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?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: not finding 'of'

Post by jmburnod » Thu Apr 23, 2020 3:25 pm

Hi,
Quickly:

Code: Select all

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
Best regards
Jean-Marc
https://alternatic.ch

AGC studios
Posts: 21
Joined: Thu Apr 23, 2020 1:49 pm

Re: not finding 'of'

Post by AGC studios » Thu Apr 23, 2020 3:45 pm

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: not finding 'of'

Post by richmond62 » Thu Apr 23, 2020 3:49 pm

I think your problem is a "problem":

Code: Select all

if the label of button "convertFromOptionMenu" is "Please choose."

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: not finding 'of'

Post by Klaus » Thu Apr 23, 2020 3:57 pm

Nope, not putting NAMES (object- and filenames) into quotes is just "sloppy" scripting, but the engine usually does not complain! 8)

The syntax is definitively correct, did you quit and restart LC and/or your machine?
Often these kind of non-errors will go away then.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: not finding 'of'

Post by dunbarx » Thu Apr 23, 2020 4:00 pm

Richmond.

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.

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: not finding 'of'

Post by jacque » Thu Apr 23, 2020 4:24 pm

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

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: not finding 'of'

Post by Thierry » Thu Apr 23, 2020 5:08 pm

dunbarx wrote: I suspect, again assuming no conflict, that something else is amiss.
Good catch Craig :)

I do believe, as your button name is not quoted,
that you have set "Variable Checking" in the SE option.

Either quote the name, or uncheck this option.

SE window active, Menu Edit-> Options -> Variable Checking

sunnYscrrenshot 2020-04-23 à 18.00.40.png

Does it work after that?

Regards,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

AGC studios
Posts: 21
Joined: Thu Apr 23, 2020 1:49 pm

Re: not finding 'of'

Post by AGC studios » Thu Apr 23, 2020 7:15 pm

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! :D :D

AGC studios
Posts: 21
Joined: Thu Apr 23, 2020 1:49 pm

Re: not finding 'of'

Post by AGC studios » Thu Apr 23, 2020 7:23 pm

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)

AGC studios
Posts: 21
Joined: Thu Apr 23, 2020 1:49 pm

Re: not finding 'of'

Post by AGC studios » Thu Apr 23, 2020 7:27 pm

I tried @‘Thierry’ idea and indeed it was on…

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: not finding 'of'

Post by Klaus » Thu Apr 23, 2020 7:27 pm

Bug reports go here: https://quality.livecode.com

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: not finding 'of'

Post by bogs » Thu Apr 23, 2020 7:58 pm

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 ..

Code: Select all

button tmpName
button tmpCol
button isThisAbug?!#@
:twisted:
Image

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: not finding 'of'

Post by Thierry » Thu Apr 23, 2020 8:10 pm

bogs wrote:
Thu Apr 23, 2020 7:58 pm
is this technically a 'bug' ? :twisted:
@bogs, agree with you; don't see this as a bug

My thinking came out of this OP statement:
I have run this code about a month now, and I didn’t do any changes and suddenly its throwing me this error
Best,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

Post Reply

Return to “Talking LiveCode”