PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Radio button
Radio button
Débuté par Jan de Bruin, 30 mar. 2005 11:03 - 7 réponses
Posté le 30 mars 2005 - 11:03
Goodday everyone
This is my first time I use the WD Forum because I am still learning and analysing the examples. I really love to work with WD !!! It is a great product
I work with WD 8
I have a very small problem….
In the Analyse a can define a item (lets say CHOICE.ANIMAL) as a Radio-button with the content Dog, Cat, Mouse, Horse
When a choose for Dog the value 1 will be saved in CHOICE.ANIMAL
When a choose for Cat the value 2 will be saved in CHOICE.ANIMAL
etc etc
So far all well
But now my (small) problem
When I make a string for example
Choice = “John has chosen for a ” + CHOICE.ANIMAL
Then I get then value John has chosen for a 2
I want to have John has chosen for a Cat
I know I can make a another variable with the values Dog,Cat etc but I don’t want to do that the value’s are inside the analyse and I want to use them. But How !!??
Best regards and thanks for helping
Jan
Posté le 30 mars 2005 - 11:52
Hello Jan,
do a simple
Radio1[Radio1..Value]..Text
do get what you want.
HTH
Raimund
Goodday everyone
This is my first time I use the WD Forum because I am still learning and analysing the examples. I really love to work with WD !!! It is a great product
I work with WD 8
I have a very small problem….
In the Analyse a can define a item (lets say CHOICE.ANIMAL) as a Radio-button with the content Dog, Cat, Mouse, Horse
When a choose for Dog the value 1 will be saved in CHOICE.ANIMAL
When a choose for Cat the value 2 will be saved in CHOICE.ANIMAL
etc etc
So far all well
But now my (small) problem
When I make a string for example
Choice = “John has chosen for a ” + CHOICE.ANIMAL
Then I get then value John has chosen for a 2
I want to have John has chosen for a Cat
I know I can make a another variable with the values Dog,Cat etc but I don’t want to do that the value’s are inside the analyse and I want to use them. But How !!??
Best regards and thanks for helping
Jan



http://www.invitec.com
Posté le 30 mars 2005 - 11:55
Hi Jan
One way of doing it is to code:
Switch CHOICE.ANIMAL
case 1: Choice = “John has chosen for a dog"
case 2: Choice = “John has chosen for a cat"
end
Regards
Marius
Goodday everyone
This is my first time I use the WD Forum because I am still learning and analysing the examples. I really love to work with WD !!! It is a great product
I work with WD 8
I have a very small problem….
In the Analyse a can define a item (lets say CHOICE.ANIMAL) as a Radio-button with the content Dog, Cat, Mouse, Horse
When a choose for Dog the value 1 will be saved in CHOICE.ANIMAL
When a choose for Cat the value 2 will be saved in CHOICE.ANIMAL
etc etc
So far all well
But now my (small) problem
When I make a string for example
Choice = “John has chosen for a ” + CHOICE.ANIMAL
Then I get then value John has chosen for a 2
I want to have John has chosen for a Cat
I know I can make a another variable with the values Dog,Cat etc but I don’t want to do that the value’s are inside the analyse and I want to use them. But How !!??
Best regards and thanks for helping
Jan
Posté le 30 mars 2005 - 12:15
Jan,
if you want this string in a window (I guess this would work in a report), then you can:
- drag the radio button from the analysis to the window (it will appear as a normal radio button with the labels displayed)
- set it not visible
- assign the value of the text control or string to the value of the radio button control subscripted by the number from the file eg:
ORG_CATEGORY_TEXT = Org_Category[Person_Position_Q.Org_Category]..Text
where ORG_CATEGORY_TEXT is an edit control in the window
Org_Category is the radio button control in the window
Person_Position_Q.Org_Category is the HF item that you wish to translate from a number to a string.
In this case, if Person_Position_Q.Org_Category is 1, ORG_CATEGORY_TEXT will display "Local Council", if it is 2, ORG_CATEGORY_TEXT will display "Home Address", and so on.
Hope this helps,
Andy
In the Analyse a can define a item (lets say CHOICE.ANIMAL) as a Radio-button with the content Dog, Cat, Mouse, Horse
When a choose for Dog the value 1 will be saved in CHOICE.ANIMAL
When a choose for Cat the value 2 will be saved in CHOICE.ANIMAL
etc etc
So far all well
But now my (small) problem
When I make a string for example
Choice = “John has chosen for a ” + CHOICE.ANIMAL
Then I get then value John has chosen for a 2
I want to have John has chosen for a Cat
I know I can make a another variable with the values Dog,Cat etc but I don’t want to do that the value’s are inside the analyse and I want to use them. But How !!??
Posté le 30 mars 2005 - 12:20
Hello Jan,
WinDev uses the Analysis information to build a proper option control for your, but this doesn't mean that these texts are parts of the table field.
Regards
Raimund

In my case CHOICE.ANIMAL[CHOICE.ANIMAL..VALUE]..TEXT does not work..
With normal radio-buttons it works but with items not??

Hello Jan,
do a simple
Radio1[Radio1..Value]..Text
do get what you want.
HTH
Raimund
Goodday everyone
This is my first time I use the WD Forum because I am still learning and analysing the examples. I really love to work with WD !!! It is a great product
I work with WD 8
I have a very small problem….
In the Analyse a can define a item (lets say CHOICE.ANIMAL) as a Radio-button with the content Dog, Cat, Mouse, Horse
When a choose for Dog the value 1 will be saved in CHOICE.ANIMAL
When a choose for Cat the value 2 will be saved in CHOICE.ANIMAL
etc etc
So far all well
But now my (small) problem
When I make a string for example
Choice = “John has chosen for a ” + CHOICE.ANIMAL
Then I get then value John has chosen for a 2
I want to have John has chosen for a Cat
I know I can make a another variable with the values Dog,Cat etc but I don’t want to do that the value’s are inside the analyse and I want to use them. But How !!??
Best regards and thanks for helping
Jan



http://www.invitec.com
Posté le 30 mars 2005 - 12:59
That was the trick
How simple things can be
Thanks !!
Posté le 30 mars 2005 - 15:45
Hi Raimund,
Thanks. I have been using arrays to hold the text values. (string=text+array[radio]) This is so simple but I never thought of using it. You will make my efforts much easier.
Bert
Hello Jan,
do a simple
Radio1[Radio1..Value]..Text
do get what you want.
HTH
Raimund
Goodday everyone
This is my first time I use the WD Forum because I am still learning and analysing the examples. I really love to work with WD !!! It is a great product
I work with WD 8
I have a very small problem….
In the Analyse a can define a item (lets say CHOICE.ANIMAL) as a Radio-button with the content Dog, Cat, Mouse, Horse
When a choose for Dog the value 1 will be saved in CHOICE.ANIMAL
When a choose for Cat the value 2 will be saved in CHOICE.ANIMAL
etc etc
So far all well
But now my (small) problem
When I make a string for example
Choice = “John has chosen for a ” + CHOICE.ANIMAL
Then I get then value John has chosen for a 2
I want to have John has chosen for a Cat
I know I can make a another variable with the values Dog,Cat etc but I don’t want to do that the value’s are inside the analyse and I want to use them. But How !!??
Best regards and thanks for helping
Jan
Posté le 31 mars 2005 - 00:38
In my case CHOICE.ANIMAL[CHOICE.ANIMAL..VALUE]..TEXT does not work..
With normal radio-buttons it works but with items not??

Hello Jan,
do a simple
Radio1[Radio1..Value]..Text
do get what you want.
HTH
Raimund
Goodday everyone
This is my first time I use the WD Forum because I am still learning and analysing the examples. I really love to work with WD !!! It is a great product
I work with WD 8
I have a very small problem….
In the Analyse a can define a item (lets say CHOICE.ANIMAL) as a Radio-button with the content Dog, Cat, Mouse, Horse
When a choose for Dog the value 1 will be saved in CHOICE.ANIMAL
When a choose for Cat the value 2 will be saved in CHOICE.ANIMAL
etc etc
So far all well
But now my (small) problem
When I make a string for example
Choice = “John has chosen for a ” + CHOICE.ANIMAL
Then I get then value John has chosen for a 2
I want to have John has chosen for a Cat
I know I can make a another variable with the values Dog,Cat etc but I don’t want to do that the value’s are inside the analyse and I want to use them. But How !!??
Best regards and thanks for helping
Jan