Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Case statement

edited May 2010 in RAP
Delphi 6, RB Ent 11.08.

Does the Case statement in RAP handle range values, e.g.

case Value of
0..19: var19.AsInteger := var19.AsInteger + 1;
20..24: var24.AsInteger := var24.AsInteger + 1;
etc
end;

On my report, Value displays as the correct figure on the report, but this
Case statement always evaluates as the first option, in this case 0..19.

I changed my code to read:

if (Value <= 19) then
var19.AsInteger := var19.AsInteger + 1
else if (Value >= 20) and (Value <= 24) then
var24.AsInteger := var24.AsInteger + 1
etc

and it now works correctly.

Thanks,
Jason.

--
Jason Sweby
Software Development Manager,
Carval Computing Limited, Plymouth, UK

Payroll - HR - T&A - Access Control

Comments

This discussion has been closed.