[fpc-devel] C style operator doesn't work with properties in 2.3.1

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Jul 17 09:31:51 CEST 2008


On Thu, Jul 17, 2008 at 9:05 AM, Micha Nelissen <micha at neli.hopto.org> wrote:
>> Simple one liners like the following:
>>
>>   inc(FDayList[itm.WeekDayNum].Rows[itm.Timeslot].AvailableSlots,
>> itm.CountSlots);
>> or
>>   FDayList[itm.WeekDayNum].Rows[itm.Timeslot].AvailableSlots +=
>> itm.CountSlots;
>>
>> now has to change to this ugly line...
>>
>>   FDayList[itm.WeekDayNum].Rows[itm.Timeslot].AvailableSlots :=
>>      FDayList[itm.WeekDayNum].Rows[itm.Timeslot].AvailableSlots +
>> itm.CountSlots;
>
> Or:
>
> tempRow := FDayList[itm.WeekDayNum].Rows[itm.Timeslot];
> tempRow.AvailableSlots := tempRow.AvailableSlots + itm.CountSlots;


And that's what I changed it to, just after I posted my message.  :-)
Either way, it's still two lines of code compared to one.  But, it will do.


Regards,
 - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list