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: FourthWorld, heatherlaine, Klaus, kevinmiller
-
hamlynart
- Posts: 101
- Joined: Wed Mar 19, 2008 7:10 pm
-
Contact:
Post
by hamlynart » Mon Aug 17, 2009 12:53 am
Hi again,
any thoughts about this little conundrum:
Code: Select all
on mouseUp
answer the number of lines in the selectedObject
answer the selectedObject
end mouseUp
if 3 fields are selected the first dialog says "1" but the second dialog shows each one on a new line (as indicated in the documentation)??
Jim H
-
jmburnod
- VIP Livecode Opensource Backer

- Posts: 2729
- Joined: Sat Dec 22, 2007 5:35 pm
-
Contact:
Post
by jmburnod » Mon Aug 17, 2009 8:10 am
Hi Jim,
No problem with the function selectedobject but i think it return empty because
you make it empty when you set the tool to browse to send a mouseup.
If you place an handler in the card script and you call it by the message box
the handler work
best
Jean-Marc
-
Klaus
- Posts: 14191
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Mon Aug 17, 2009 9:44 am
Hi Jim,
I have no idea why this does not work, but I just tested a bit and foud this workaround (two buttons selected):
...
put the selectedobjects into tSelObj
put the num of lines OF the selectedobjects
## Got 0!!???
answer the num of lines of tSelObj
## I got "2"
...
Best
Klaus
-
hamlynart
- Posts: 101
- Joined: Wed Mar 19, 2008 7:10 pm
-
Contact:
Post
by hamlynart » Mon Aug 17, 2009 9:48 am
The reason I need the script to be in a button is because I'm making a plugin. At the moment it works fine for single objects but I need it to cycle through ALL the selected objects.
I had the hope that this would work:
Code: Select all
on mouseUp
repeat with x=1 to the number of lines in the selectedObject
set the text of (line x of the selectedObject) to fld "Replacement"
end repeat
end mouseUp
But because the lines of the selected object are not recognised it doesn't work?
Jim H
-
hamlynart
- Posts: 101
- Joined: Wed Mar 19, 2008 7:10 pm
-
Contact:
Post
by hamlynart » Mon Aug 17, 2009 9:49 am
Hi Klaus,
That makes a lot of sense - I'll try it out.
Thanks
Jim
-
hamlynart
- Posts: 101
- Joined: Wed Mar 19, 2008 7:10 pm
-
Contact:
Post
by hamlynart » Mon Aug 17, 2009 10:18 am
it works!!
on mouseUp
put the selectedObject into tSelObj
repeat with x=1 to the number of lines in tSelObj
set the text of (line x of tSelObj) to fld "Replacement"
end repeat
end mouseUp
Thanks again
Jim H