CHUI - Change VALIDATE RULES in a program

garym@camgar.ca

New Member
I have a CHUI V9 program that asks for a field for report selection.

I want to have the possible values be different based on the user's language code (a shared varaiable)
- If English, possible values are D,R,F,B
- If French, possible values ate "S,F,C,R"

I am not very familiar with attributes but did try the following that gave me Progress error 4052

Here is part of the code:

form sel-area
with frame gg.

DO WITH FRAME gg:
if w-user-language = "E" then
assign
sel-area:HELP = "D = DRY, R = REFREGIRATED F = FROZEN B = ROBOT"
sel-area:VALIDATE-EXPRESSION = "sel-area = '' or
can-do('D,R,F,B', sel-area)"
sel-area:VALIDATE-MESSAGE = 'Must be ...'
.
else
blah blah
end.


Thanks in advance.
 
Strange way to validate, but this works:

find first tablewithsel-area.

form sel-area with frame f1.

def var cfield as char no-undo.

do with frame f1:
if w-user-language = "E" then do:
assign cField = ",D,R,F,B"
sel-area:HELP = "D = DRY, R = REFREGIRATED F = FROZEN B = ROBOT" .
end.
else do:
assign cField = ",A,N,M"
sel-area:HELP = "A = Aap, N = Noot, M = Mies" .
end.
update sel-area validate (can-do(cField, input sel-area), 'Error').

end.
 
Back
Top