About Code Template lazarus / 9-Editor ---------------------------------------------------------------------- yinhuajian · 2025-09-24 04:55 I created the following code snippet: [myTest | myTest] $(AttributesStart) EnableMakros=true $(AttributesEnd) $Param(test1,Sync=1) $Param(test2,Sync=2) $Param(test1,Sync=1) $Param(test2,Sync=2) When I use myTest, it automatically generates: test1 test1 test2 test2 And when I modify test1 or test2, the corresponding instances update synchronously. However, if I change the template to: [myTest | myTest] $(AttributesStart) EnableMakros=true $(AttributesEnd) $Param(test1,Sync=1) $Param(test1,Sync=1) $Param(test2,Sync=2) $Param(test2,Sync=2) Using myTest now generates: test1 test1 test1 test1 Why is this happening? ---------------------------------------------------------------------- n7800 · 2025-09-24 06:22 What version of Lazarus are you using? When I call the template (for trunk and 3.8), I get: Template 1: Code: [Select]test1 test2 test1 test2 Template 2: Code: [Select]test1 test1 test1 test1 ---------------------------------------------------------------------- yinhuajian · 2025-09-24 13:34 Lazarus:3,6 FPC:3.3.1 ---------------------------------------------------------------------- Martin_fr · 2025-10-12 09:24 You want the 2nd example to be Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $Param(test 1,Sync=1)$Param(test1,Sync=1)$Param(test2,Sync=3)$Param(test2,Sync=3) or Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $Param(test1)$Param(test1,Sync=1)$Param(test2)$Param(test2,Sync=3) You got 4 times "$Param". They are numbered from 1 to 4. So you want the last (4th "Param") to link to the 3rd. From the help (if you click "insert macro") Quote  if param("foo") > 0 and param("foo",sync=1) < 99 then Inserts 2 linked cells, editing either one, will change the other one too. The value "1" refers to the position of the other "param()", so if there are more params:   if param("bar") and param(foo) > 0 and param(foo,sync=2) < 99 then The 2nd and third are linked (the 3rd refers to "2").