Dereferencing control ids

Scott Rossi scott at tactilemedia.com
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).

Regards,


Scott Rossi
Creative Director
Tactile Media, UX/UI Design

-------- Original message --------
Subject: Dereferencing control ids 
From: Peter Haworth <pete at lcsql.com> 
To: How to use LiveCode <use-livecode at lists.runrev.com> 
CC:  

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?

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the Use-livecode mailing list