Hi I'm currently using open edge 10.2b I've got a variable from a database filed that is an array 99 long. I want to display all of them in a browse but i dont want to hardcode all the labels in. I’ve got the following code at the moment lots of case statements is there a way to use the closure code rather having to do 99 case statements?
define variable chrDescription as character no-undo.
define variable intLength as integer no-undo.
for each closures where closures.close-code >= 1 and closures.close-code <= 99 no-lock:
chrDescription = "Closure Code " + string(closure.close-code) + " " + closures.description.
/*message chrDescription + " " + string(intClosureCode).*/
intLength = length(chrDescription).
case closure.close-code:
when 1 then
assign
ttRecs.close-allow[closures.close-code]:column-label in browse {&browse-name} = chrDescription.
/*ttRecs.close-allow[intClosureCode]:width in browse {&browse-name} = intLength.*/
when 2 then
assign
ttRecs.close-allow[2]:label in browse {&browse-name} = chrDescription
ttRecs.close-allow[2]:width in browse {&browse-name} = intLength.
when 3 then
assign
ttRecs.close-allow[3]:label in browse {&browse-name} = chrDescription
ttRecs.close-allow[3]:width in browse {&browse-name} = intLength.
when 4 then
assign
ttRecs.close-allow[4]:label in browse {&browse-name} = chrDescription
ttRecs.close-allow[4]:width in browse {&browse-name} = intLength.
define variable chrDescription as character no-undo.
define variable intLength as integer no-undo.
for each closures where closures.close-code >= 1 and closures.close-code <= 99 no-lock:
chrDescription = "Closure Code " + string(closure.close-code) + " " + closures.description.
/*message chrDescription + " " + string(intClosureCode).*/
intLength = length(chrDescription).
case closure.close-code:
when 1 then
assign
ttRecs.close-allow[closures.close-code]:column-label in browse {&browse-name} = chrDescription.
/*ttRecs.close-allow[intClosureCode]:width in browse {&browse-name} = intLength.*/
when 2 then
assign
ttRecs.close-allow[2]:label in browse {&browse-name} = chrDescription
ttRecs.close-allow[2]:width in browse {&browse-name} = intLength.
when 3 then
assign
ttRecs.close-allow[3]:label in browse {&browse-name} = chrDescription
ttRecs.close-allow[3]:width in browse {&browse-name} = intLength.
when 4 then
assign
ttRecs.close-allow[4]:label in browse {&browse-name} = chrDescription
ttRecs.close-allow[4]:width in browse {&browse-name} = intLength.