The variable NewIdx used in the DrawDay procedure in
procedure TEsCustomCalendar.Paint may not be
initialized. The relevant code snippet (starting line 1304)
is:
if not Grayed or FShowInactive then
NewIdx := ((R-2) * 7) + Succ
(C); {!!.11}
OldIdx := clFirst + Pred
(clDay); {!!.11}
if Assigned(FOnDrawItem)
then {!!.11}
FOnDrawItem(Self, FDate+(NewIdx-OldIdx),
clRowCol[R,C]) {!!.11}
else
{!!.11}
DrawText(Canvas.Handle, @S[1], Length(S),
clRowCol[R,C],
DT_SINGLELINE or DT_CENTER or
DT_VCENTER);
Should there perhaps be a begin/end block including all
the above lines after "if not Grayed or FShowInactive
then"? The pattern of code indentation suggests that.
Stephen Aberle
stephena@unipharm.com
Logged In: YES
user_id=23191
I get the same warning, and it definitely looks like it
should be a begin/end block