Hi Jeff,
Thanks for the example. It took me a bit of time and investigation to remember how the multi-select works.
The first thing to bear in mind is that there's not direct Clarion equivalent for a multi-select, the way there is for a string or number. So _what_ you want to do with the multi-select is kind of up to you. Some people store them in a string, as a comma separated list or something - others write them in an array, and others write them to a child file.
So, the idea is you will need to decide how you are going to store them, and then write some appropriate embed code to do that.
The embed code goes into the ValidateValue::fieldEquate routine for the field, right at the top before the generated code.
In this case ValidateValue::MAI:AutoResponseText. (Be careful to get the right one - your naming of equates in the example is backwards, so could lead to confusion.)
- the call p_web.GetPicture('MAI:AutoResponseText') returns the number of items in the result. (For example if you selected 3 items, this would be set to 3.)
- the individual items are stored as the field name, plus the index number. For example, MAI:AutoResponseText1 and MAI:AutoResponseText2.
So the code could look something like this;
if MAI:AutoResponseText = ';|;multiple;|;'
n = p_web.GetPicture('MAI:AutoResponseText')
MAI:AutoResponseText = ''
loop x = 1 to n
MAI:AutoResponseText = clip(MAI:AutoResponseText) & ',' & p_web.GetValue('MAI:AutoResponseText' & x)
end
end
I probably don't recommend you putting a Text box, and a multi-line select on the same form with the same name. They'll both "submitting" their value into the same variable, so there's likely to be some unexpected behavior at some point. but I assume you're just doing this for debugging purposes.
Cheers
Bruce