I have been trying to script the creation of a text field but without success. When I use the following I receive an error message "No such object" with "rlabel" being identified as the offending object:
create field "rlabel"
set the location of field "rlabel" to x1+200,y1-27
scripting the creation of text fields
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
After the engine executes the 'create' command, the 'it' variable contains the long id of the freshly created object.
You may want to wrap it in a 'lock messages'/'unlock messages' pair to prevent the Revolution IDE from tampering with your new object. This will also prevent the phenomenon where you leave 'browse' mode after such a create statement.
Also check 'the result' and 'it' right after the call to 'create' - that might provide additional clues.
Hope this helped,
Jan Schenkel.
You may want to wrap it in a 'lock messages'/'unlock messages' pair to prevent the Revolution IDE from tampering with your new object. This will also prevent the phenomenon where you leave 'browse' mode after such a create statement.
Also check 'the result' and 'it' right after the call to 'create' - that might provide additional clues.
Hope this helped,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Hi Alistair,
I just tried the following script:
and it works fine. Perhaps you could post your complete handler and let us check whether there are any errors in it.
Best,
Mark
I just tried the following script:
Code: Select all
on mouseUp
put 1 into x1
put 2 into y1
create fld "rlabel"
set the location of field "rlabel" to x1+200,y1-27
end mouseUp
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode