RAP Pascal - case statement problem
Hi.
I'm using RB 6.
I thought RAP was mean't to be a subset of object pascal. But for the
following case statement
case plSessionReport['ETTSubjectively'] of
0: LblETTSubjectively.caption :='Positive';
1: LblETTSubjectively.caption :='Negative';
2: LblETTSubjectively.caption :='Equivocal';
-1: LblETTSubjectively.caption := '';
end;
and others like it, it works just fine as a case statement in Delphi, but
doesn't work in RAP. RAP stops at the '-' sign and complains about that.
I need to have the case statement recognise the -1, because the 0, 1, 2,
and -1 correspond to itemindex settings for a radiogroup control, so these
are the only sensible numbers. I don't want to rewrite all my RAP to use
clumsy if/then constructs instead of case statements.
So what do I do to get the case staments to work properly in RAP?
Thanks!
Lauchlan M
I'm using RB 6.
I thought RAP was mean't to be a subset of object pascal. But for the
following case statement
case plSessionReport['ETTSubjectively'] of
0: LblETTSubjectively.caption :='Positive';
1: LblETTSubjectively.caption :='Negative';
2: LblETTSubjectively.caption :='Equivocal';
-1: LblETTSubjectively.caption := '';
end;
and others like it, it works just fine as a case statement in Delphi, but
doesn't work in RAP. RAP stops at the '-' sign and complains about that.
I need to have the case statement recognise the -1, because the 0, 1, 2,
and -1 correspond to itemindex settings for a radiogroup control, so these
are the only sensible numbers. I don't want to rewrite all my RAP to use
clumsy if/then constructs instead of case statements.
So what do I do to get the case staments to work properly in RAP?
Thanks!
Lauchlan M
This discussion has been closed.
Comments
I have researched this issue and have created a patch for RB 7.03. You must
have RB 7.03 to apply the patch.
A work around for this issue is to create a local variable as shown below.
(I tried implementing a work around with a const declaration rather than a
variable, but this is an issue also. This issue is address by the patch
mention above.).
var
liMinusOne: Integer;
begin
liMinusOne := -1'
case Value of
liMinusOne: {add code here}
end;
end;
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
I have also emailed you with a follow-up query at DM support.
Lauchlan Mackinnon
must
must
Where do I download this patch from?
Thanks
Lauchlan M
If you have ReportBuilder 7.03, send an email to
support@digital-metaphors.com requesting the patch and we'll send it right
out.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com