Dereferencing control ids

Scott Rossi scott at
Mon Jan 27 16:39:03 EST 2014

Hi Pete:

Not sure if this will help but try putting the selObj into a variable first and working with that.

FWIW, I've often gotten mixed results or errors when trying to work with the selObj directly (unless simply trying to check its contents) and placing its contents into a variable has been more reliable for me (YMMV).


Scott Rossi
Creative Director
Tactile Media, UX/UI Design

-------- Original message --------
Subject: Dereferencing control ids 
From: Peter Haworth <pete at> 
To: How to use LiveCode <use-livecode at> 

Getting a problem trying to grab the topLeft of each control in the
selectedObjects.  Code is as follows:

repeat for each line rLine in the selectedObjects
   put the topLeft of rLine & return after sLocations
end repeat

I get a runtime error on the "put" statement:

(Chunk: error in object expression) near "field id 1004 of card id 1002 of
stack "test"", char 23.

The field reference is what's in rLine.

I've also tried using a do statement resulting in a slightly different
error - "error in source expression"

If I enter - put the topleft of field id 1004 of card id 1002 of stack
"test" - into the message box, I get a valid result.

I have a horrible feeling this is going to be something really obvious but
nevertheless, what am I doing wrong?

lcSQL Software <>
Home of lcStackBrowser <> and
SQLiteAdmin <>
use-livecode mailing list
use-livecode at
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

More information about the Use-livecode mailing list