How to get all the menu items of all buttons on one card
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
How to get all the menu items of all buttons on one card
Might be too simple to ask but I'm new
I'd like to get all the menu items (say, some has three choices, some has five choices) of all the buttons on a specific card. Say, I want to put them into a field. When I tested one out by
put the text of button id XXXX into field id XXXX
nothing showed in field id XXXX. What's the simple thing I'm missing^^?
I'd like to get all the menu items (say, some has three choices, some has five choices) of all the buttons on a specific card. Say, I want to put them into a field. When I tested one out by
put the text of button id XXXX into field id XXXX
nothing showed in field id XXXX. What's the simple thing I'm missing^^?
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: How to get all the menu items of all buttons on one card
Hi Cogito,
Welcome to this forum.
I dont understand why it doesn't work
you may try this:
I tested this and it works for me
Best regards
Jean-Marc
Welcome to this forum.
I dont understand why it doesn't work
you may try this:
Code: Select all
on getTextofAllBtns
put gettextBtns()
end getTextofAllBtns
function getTextBtns
put the num of btns into nbl
repeat with i = 1 to nbl
get the text of btn i
replace cr with "," in it
put the name of btn i & "," & it into line i of t
end repeat
return t
end getTextBtns
Best regards
Jean-Marc
https://alternatic.ch
Re: How to get all the menu items of all buttons on one card
Hi Jean-Marc, you're the best!!!! I can't thank you enough!
Thank you so much for offering such a wonderful solution!!
Thank you so much for offering such a wonderful solution!!
Re: How to get all the menu items of all buttons on one card
Just out of curiosity, if I have a list produced by Jean-Marc's script, will it be possible to reversely put back the choices of menu items into each of the buttons from the list^^?
I should put the (menu items) into "???" of each of the button? menuItem of the button?
I should put the (menu items) into "???" of each of the button? menuItem of the button?
Re: How to get all the menu items of all buttons on one card
Hi cogito (ergo sum?),
you can of course SET again what you have GET (gotten) before:
I will leave the extraction of the correct lines for your button(s) from the field up to you
Best
Klaus
you can of course SET again what you have GET (gotten) before:
Code: Select all
...
set the text of btn "xyz" to (line 1 to 3 of fld "the field with all the menu items")
...
Best
Klaus
Re: How to get all the menu items of all buttons on one card
Thanks a million, Klaus! Now besides cogito ergo sum, I also learned "I ask, therefore I will know"
-
- VIP Livecode Opensource Backer
- Posts: 9626
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: How to get all the menu items of all buttons on one card
Peto itaque ego novi?
Craig
Craig
Re: How to get all the menu items of all buttons on one card
Placueris populo, intelligo