[Solved] Inc limitation lazarus / 31-LCL ---------------------------------------------------------------------- Windsurfer · 2013-11-06 21:57 When I used Inc(ProgressBar1.Position) rather than ProgressBar1.Position := ProgressBar1.Position + 1 I received  the error message 'Error: Can't take the address of constant expressions'. Is this expected behaviour? In the help file Inc seems to handle various integer types declared as constants. ---------------------------------------------------------------------- engkin · 2013-11-06 22:44 ProgressBar1.Position is a property, while inc expects a variable. In case of a property, typically, the compiler provides its value by calling a function, and assigns a new value through a procedure: Code: [Select]  TProgressBar = class(TCustomProgressBar) ...   published ...     property Position; Code: [Select]  TCustomProgressBar = class(TWinControl) ...   public ...     property Position: Integer read GetPosition write SetPosition default 0; ---------------------------------------------------------------------- Deepaak · 2013-11-07 04:20 This is coding error. Inc function cannot be used for incrementing the progressbar.position. Because It is a property which is incremented or decremented by the help of seperate function/procedure. So for updating your progressbar.position please use variable with Inc to acheive this. ---------------------------------------------------------------------- Windsurfer · 2013-11-07 08:24 Thanks for the helpful comments - so much to know, and so little time... Component building is on my todo list. ---------------------------------------------------------------------- marcov · 2013-11-07 08:55 Note that in old (pre 2.6) versions this was possible if the property refered to a field. This was unintended behaviour and removed. ---------------------------------------------------------------------- Zoran · 2013-11-07 11:40 Quote from: marcov on November 07, 2013, 09:55:37 amNote that in old (pre 2.6) versions this was possible if the property refered to a field. This was unintended behaviour and removed. Actually, it was removed in 2.4: http://wiki.freepascal.org/User_Changes_2.4.0#Treating_direct- mapped_properties_as_regular_fields