Question

But it is not a great way to write, see the code below

stringVar Fld := "";
IF ({#RTotal0}=1)
then
 Fld:="A"
ELSE IF ({#RTotal0}=2)
then
Fld:="B"
ELSE IF ({#RTotal0}=3)
then
 Fld:="C"
ELSE IF ({#RTotal0}=4)
then
Fld:="D"
ELSE IF ({#RTotal0}=5)
then
Fld:="E"
ELSE IF ({#RTotal0}=6)
 then
Fld:="F"
ELSE IF ({#RTotal0}=7)
then
Fld:="G"
else
 Fld:="H";

there is any better way to achieve it."{#RTotal}" is a running total.

Était-ce utile?

La solution

Yes, for more clarity, you can use the CASE..ELSE block;

select {#RTotal}
 case 1 : "A"
 case 2 : "B" 
..
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top