Hi guys,
I was wondering how I might go about getting the responses users make from option menus into a field. In order to create a unique ID for the limited (30 or so) people who will end up using the program, I ask them to identify certain letters of their name and the day of their birth to generate a random sequence of letters and numbers for an ID, and then I've created a button that will compile those responses and transfer them to the text field where I want them. However, when I go to try this out, it seems that I can only get numerical options to transfer to the field, while letter options remain unrecognized; for example, if the sequence is MAPA6, only "6" is transferred to the field. Any suggestions on how to fix this?
getting option menu responses into a field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: getting option menu responses into a field
Hi,
to be honest, I have no idea what you are trying to do,
so it might help if you could show:
1. the content and names of your option button(s)
2. the script you are currently using
Best
Klaus
to be honest, I have no idea what you are trying to do,
so it might help if you could show:
1. the content and names of your option button(s)
2. the script you are currently using

Best
Klaus
Re: getting option menu responses into a field
Hmmm.
Do you know how to get information from an option menu? In other words, do you know about such concepts as the "menuHistory" or the "selectedText" as they relate to such a control?
For (at least part of) the other question, are you familiar with the concept of, say:
That sort of thing? This is known as "chunking" and is a pillar of LC.
In other words, we will help you with technique and knowledge, but will (try to) leave it to you to develop your application.
So write back with specific questions all day. But break them down into smaller pieces.
Craig Newman
Do you know how to get information from an option menu? In other words, do you know about such concepts as the "menuHistory" or the "selectedText" as they relate to such a control?
For (at least part of) the other question, are you familiar with the concept of, say:
Code: Select all
answer char 5 of "MAPA6" -- a number
answer char 3 of "MAPA6" -- a letter
answer the last char of "MAPA6"
In other words, we will help you with technique and knowledge, but will (try to) leave it to you to develop your application.
So write back with specific questions all day. But break them down into smaller pieces.
Craig Newman
Re: getting option menu responses into a field
Ok, I'll try to be more clear.
There are five questions I'm asking participants on this card. Four of them can be answered by choosing a letter of the alphabet, the other by choosing a number from 1-31. Once they are done, they should click a button I have on the card that will put the 5-character combination that they have chosen into a text field somewhere else on the card. The code I currently have written for the button will only allow me to transfer the answer to the final question (the number) into the text field. Is there some script I need to write to get the text field to recognize letters? Or am I doing something else wrong? I have been using option menus to display the possible choices for each question, perhaps that is not necessary or not the best way of doing that?
There are five questions I'm asking participants on this card. Four of them can be answered by choosing a letter of the alphabet, the other by choosing a number from 1-31. Once they are done, they should click a button I have on the card that will put the 5-character combination that they have chosen into a text field somewhere else on the card. The code I currently have written for the button will only allow me to transfer the answer to the final question (the number) into the text field. Is there some script I need to write to get the text field to recognize letters? Or am I doing something else wrong? I have been using option menus to display the possible choices for each question, perhaps that is not necessary or not the best way of doing that?
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: getting option menu responses into a field
This is my first experiment with option menus, But I was able to accomplish (i think) what you are looking for pretty easily. In my sample stak I made four option menus with A-Z as their options, and 1 with the numbers 1-31. I named them Menu1,menu2,menu3,menu4, and menu5. I created a Field named "result", and a buttton with this script:
And it seems to be working. Let me know if this helps at all..
--Sefro
Code: Select all
on mouseUp
put empty into fld "result"
repeat with x = 1 to 5
put the label of btn ("menu"&x) after fld "result"
end repeat
end mouseUp
--Sefro