Problem setting anchors in code lazarus / 31-LCL ---------------------------------------------------------------------- flaza · 2015-02-05 20:46 Hi. I'm using Lazarus 1.24. I need a component in 3 forms so I made a new type. In the Create procedure I set many properties. Now in the Create procedure of the first Form I put the following codeCode: [Select]Grid := TStatusGrid.Create(Self); Grid.Parent := Self; Grid.AnchorSideTop.Control := Button1; Grid.AnchorSideTop.Side = asrBottom; Grid.AnchorSideLeft.Control := Self; Grid.AnchorSideRight.Control := Self; Grid.BorderSpacing.Left = 30; Grid.BorderSpacing.Top = 20; Grid.BorderSpacing.Right = 30; Compiling gives at first: Illegal expression for the lineCode: [Select]Grid.AnchorSideTop.Side = asrBottom;After blocking that line, I get the same error on the line Code: [Select]Grid.BorderSpacing.Left = 30 I searched the contents of the components and examples folders and I searched the net, but I have no answer on what is wrong and how it can be done. Or is it not possible? ---------------------------------------------------------------------- jmm72 · 2015-02-05 21:26 I stumble on this so many times that I wonder why it doesn't stick in my head. This is an expression: Code: [Select]Grid.AnchorSideTop.Side = asrBottom; This is a statement (an assigment): Code: [Select]Grid.AnchorSideTop.Side := asrBottom; Whenever I use = instead of := and the right side is an expression, I usually devote too much time trying to wonder why a perfectly good expression is rejected by the compiler... ---------------------------------------------------------------------- flaza · 2015-02-06 16:31 How blind one can be, the price of copying. Thanks ---------------------------------------------------------------------- Basile B. · 2015-02-06 22:07 Quote from: flaza on February 06, 2015, 05:31:54 pmHow blind one can be, the price of copying. Thanks Someone has theorized this, this is now known as the last line effect. In short, the guy has discovered that when copying/pasting code, the last paste is likely/more prone to contain an error.