Set the loc compilation error

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Set the loc compilation error

Post by doobox » Tue Jun 09, 2015 9:39 pm

Hi there,

I can't understand what I have ran into here.

I can do this :

Code: Select all

on mouseUp
   set the loc of the first label of this card to 78,88
end mouseUp
I can't do this :

Code: Select all

on mouseUp
   set the loc of label "globalHtmlPositionLabel" of this card to 78,88
end mouseUp
This produces a compilation error "Button : compilation error at line 2 (set: missing 'to'), char 19"
Kind Regards
Gary

https://www.doobox.co.uk

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

Re: Set the loc compilation error

Post by richmond62 » Tue Jun 09, 2015 9:53 pm

This is because a 'label' is NOT a LABEL it is a field.

Code: Select all

on mouseUp
   set the loc of fld "globalHtmlPositionLabel" of this card to 78,88
end mouseUp

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Set the loc compilation error

Post by doobox » Tue Jun 09, 2015 9:56 pm

OMG.. I need to take a break :-) Thank's for pointing that out. I have been going round in circles for at least 2 hours. And I doubt I'd have spotted my stupid mistake for another 2 either.
Kind Regards
Gary

https://www.doobox.co.uk

SparkOut
Posts: 1948
Joined: Sun Sep 23, 2007 4:58 pm

Re: Set the loc compilation error

Post by SparkOut » Tue Jun 09, 2015 9:58 pm

Yes but how can you

Code: Select all

set the loc of the first label of this card to 78,88
this may compile, but surely it doesn't work? Surely?

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Set the loc compilation error

Post by doobox » Tue Jun 09, 2015 10:04 pm

No that throws an execution error.
I was looking way past the wrongly naming a "field" - "label" and just baffling my self even further by the fact i could write : the first label of this card

I want to kick my self for calling a field a label :-)
Kind Regards
Gary

https://www.doobox.co.uk

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”