Case statement
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
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
This discussion has been closed.
Comments
This is currently not supported for RAP. We will consider adding support
for case statement ranges for a later release.
Your suggested workaround is recommended.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com