Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-01

Code templates syntax

11 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Antonio Fortuny

Hi folks.

Does anyone know where I can find a syntax description and the usage rules of all keywords which appear in the source code templates ? And those which do not appear as well ;-)
Basically I did find the file "..\lazarus\ide\lazarus_dci_file.dci" and it already gives some self explanatory rules.
My purpose is to enriche as much as possible with code snippets that I use very often

Thanks a lot.

Antonio.

Reply by email

Martin
to Antonio Fortuny
Antonio Fortuny wrote 9 lines
Hi folks. Does anyone know where I can find a syntax description and the usage rules of all keywords which appear in the source code templates ? And those which do not appear as well ;-) Basically I did find the file "..\lazarus\ide\lazarus_dci_file.dci" and it already gives some self explanatory rules. My purpose is to enriche as much as possible with code snippets that I use very often

Have you tried "Insert Macro" In the code-template editor window ("Tools" Menu) ?

It lists them all + description

Reply by email

Howard Page-Clark
to Antonio Fortuny: Hi folks. Does anyone know where I can find a syntax description and the usage rules of…
Antonio Fortuny wrote 9 lines
Hi folks. Does anyone know where I can find a syntax description and the usage rules of all keywords which appear in the source code templates ? And those which do not appear as well ;-) Basically I did find the file "..\lazarus\ide\lazarus_dci_file.dci" and it already gives some self explanatory rules. My purpose is to enriche as much as possible with code snippets that I use very often

I would say that the Lazarus .dci file you mention is illuminating but not definitive, since Lazarus is derivative, based on the Free Pascal dialect. For that the most concise description of keywords etc. is the published Language Reference Guide documentation ://ftp.freepascal.org/pub/fpc/docs-pdf/ref.pdf

Also the language is (slowly) evolving through all the Delphi innovations, for-in loop notation, generics etc.

Reply by email

Mattias Gaertner
to Martin: Have you tried "Insert Macro" In the code-template editor window ("Tools" Menu) ? It…

Martin hat am 10. Januar 2012 um 15:04 geschrieben:

Show quoted text 15 lines
On 10/01/2012 13:29, Antonio Fortuny wrote: > Hi folks. > > Does anyone know where I can find a syntax description and the usage > rules of all keywords which appear in the source code templates ? > And those which do not appear as well ;-) > Basically I did find the file "..\lazarus\ide\lazarus_dci_file.dci" > and it already gives some self explanatory rules. > My purpose is to enriche as much as possible with code snippets that I > use very often Have you tried "Insert Macro" In the code-template editor window ("Tools" Menu) ? It lists them all + description?

The documentation is here:
http://wiki.lazarus.freepascal.org/IDE_Window:_Code_Templates ?
Mattias
?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120110/b917fdbd/attachment.html>

Reply by email

Mattias Gaertner
to Mattias Gaertner

Mattias Gaertner hat am 10. Januar 2012 um 15:33
geschrieben:

Show quoted text 24 lines
? ? Martin hat am 10. Januar 2012 um 15:04 geschrieben: > On 10/01/2012 13:29, Antonio Fortuny wrote: > > Hi folks. > > > > Does anyone know where I can find a syntax description and the usage > > rules of all keywords which appear in the source code templates ? > > And those which do not appear as well ;-) > > Basically I did find the file "..\lazarus\ide\lazarus_dci_file.dci" > > and it already gives some self explanatory rules. > > My purpose is to enriche as much as possible with code snippets that I > > use very often > > Have you tried "Insert Macro" In the code-template editor window > ("Tools" Menu) ? > > It lists them all + description? The documentation is here: http://wiki.lazarus.freepascal.org/IDE_Window:_Code_Templates

?
Martin, can you elaborate how the "param" macro works? The description is looks a bit confusing:
?
Inserts an editable Cell, with a default value
"",Sync=n (,S=n), to Sync with a previous cell (n=1 to highest prev cell "default",Sync, to Sync with a previous cell of equal default ?
Mattias
?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120110/af06f947/attachment.html>

Reply by email

Martin
to Mattias Gaertner
Mattias Gaertner wrote 40 lines
Mattias Gaertner hat am 10. Januar 2012 um 15:33 geschrieben: Martin hat am 10. Januar 2012 um 15:04 geschrieben: > On 10/01/2012 13:29, Antonio Fortuny wrote: > > Hi folks. > > > > Does anyone know where I can find a syntax description and the usage > > rules of all keywords which appear in the source code templates ? > > And those which do not appear as well ;-) > > Basically I did find the file "..\lazarus\ide\lazarus_dci_file.dci" > > and it already gives some self explanatory rules. > > My purpose is to enriche as much as possible with code snippets that I > > use very often > > Have you tried "Insert Macro" In the code-template editor window > ("Tools" Menu) ? > > It lists them all + description The documentation is here: http://wiki.lazarus.freepascal.org/IDE_Window:_Code_Templates Martin, can you elaborate how the "param" macro works? The description is looks a bit confusing: Inserts an editable Cell, with a default value "",Sync=n (,S=n), to Sync with a previous cell (n=1 to highest prev cell "default",Sync, to Sync with a previous cell of equal default

updated:

'Inserts an editable Cell. Cells can be navigated using the tab key.%0:s' +
'The "param" macro takes a list of comma separated arguments.%0:s' + 'The first argument is the default value.%0:s' +
'The 2nd argument (optional) can be used to link the cell to another cell (syncro edit)%0:s' +
'%0:s' +
' while param("foo") do param(foo);%0:s' +
'Inserts 2 independent cells, both with the default text "foo"%0:s' + 'The quotes are optional%0:s' +
'%0:s' +
' if param("foo") > 0 and param("foo",sync=1) < 99 then%0:s' + 'Inserts 2 linked cells, editing either one, will change the other one too%0:s' +
'The value "1" refers to the position of the other "param()", so if there are more params:%0:s' +
' if param("bar") and param(foo) > 0 and param(foo,sync=2) < 99 then%0:s' +
'The 2nd and third are linked. (the 3rd refers to "2") %0:s' + '%0:s' +
'"sync can be shortened to "s":%0:s' +
' if param("foo") > 0 and param("foo",s=1) < 99 then%0:s' + '%0:s' +
' if param("bar") and param("foo") > 0 and param("foo",sync) < 99 then%0:s' +
'The 2nd and third are linked.%0:s' +
'Note: "Sync has no position and no "=", so it syncs to the previous cell with the same default (in this case "foo")' ;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120110/fc96e4c5/attachment-0001.html>

Reply by email

Antonio Fortuny
to Martin: Have you tried "Insert Macro" In the code-template editor window ("Tools" Menu) ? It…

Le 10/01/2012 15:04, Martin a ?crit :

Show quoted text 15 lines
On 10/01/2012 13:29, Antonio Fortuny wrote: > Hi folks. > > Does anyone know where I can find a syntax description and the usage > rules of all keywords which appear in the source code templates ? > And those which do not appear as well ;-) > Basically I did find the file "..\lazarus\ide\lazarus_dci_file.dci" > and it already gives some self explanatory rules. > My purpose is to enriche as much as possible with code snippets that > I use very often Have you tried "Insert Macro" In the code-template editor window ("Tools" Menu) ? It lists them all + description

Yes, absolutely. I did see it without using bacause a lack of how to use them.
I've tried a little bit and it looks OK.
Thanks

Show quoted text 7 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Antonio Fortuny
to Howard Page-Clark: I would say that the Lazarus .dci file you mention is illuminating but not definitive,…

Le 10/01/2012 15:05, Howard Page-Clark a ?crit :

Show quoted text 19 lines
On 10/1/12 1:29, Antonio Fortuny wrote: > Hi folks. > > Does anyone know where I can find a syntax description and the usage > rules of all keywords which appear in the source code templates ? > And those which do not appear as well ;-) > Basically I did find the file "..\lazarus\ide\lazarus_dci_file.dci" and > it already gives some self explanatory rules. > My purpose is to enriche as much as possible with code snippets that I > use very often I would say that the Lazarus .dci file you mention is illuminating but not definitive, since Lazarus is derivative, based on the Free Pascal dialect. For that the most concise description of keywords etc. is the published Language Reference Guide documentation . ftp://ftp.freepascal.org/pub/fpc/docs-pdf/ref.pdf Also the language is (slowly) evolving through all the Delphi innovations, for-in loop notation, generics etc.

I'm OK with Pascal language. Little misunderstanding I guess

Show quoted text 9 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Antonio Fortuny
to Mattias Gaertner: Martin hat am 10. Januar 2012 um 15:04 geschrieben: The documentation is here:…

Le 10/01/2012 15:33, Mattias Gaertner a ?crit :

Show quoted text 25 lines
Martin hat am 10. Januar 2012 um 15:04 geschrieben: > On 10/01/2012 13:29, Antonio Fortuny wrote: > > Hi folks. > > > > Does anyone know where I can find a syntax description and the usage > > rules of all keywords which appear in the source code templates ? > > And those which do not appear as well ;-) > > Basically I did find the file "..\lazarus\ide\lazarus_dci_file.dci" > > and it already gives some self explanatory rules. > > My purpose is to enriche as much as possible with code snippets that I > > use very often > > Have you tried "Insert Macro" In the code-template editor window > ("Tools" Menu) ? > > It lists them all + description The documentation is here: http://wiki.lazarus.freepascal.org/IDE_Window:_Code_Templates

Got it. Very simple.

Show quoted text 10 lines
Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120110/27b67c80/attachment.html>

Reply by email

Antonio Fortuny
to Martin: updated: 'Inserts an editable Cell. Cells can be navigated using the tab key.%0:s' + 'The…

Le 10/01/2012 16:16, Martin a ?crit :

Show quoted text 75 lines
On 10/01/2012 14:41, Mattias Gaertner wrote: > > > Mattias Gaertner hat am 10. Januar 2012 > um 15:33 geschrieben: > > > Martin hat am 10. Januar 2012 um 15:04 > geschrieben: > > > On 10/01/2012 13:29, Antonio Fortuny wrote: > > > Hi folks. > > > > > > Does anyone know where I can find a syntax description and > the usage > > > rules of all keywords which appear in the source code > templates ? > > > And those which do not appear as well ;-) > > > Basically I did find the file > "..\lazarus\ide\lazarus_dci_file.dci" > > > and it already gives some self explanatory rules. > > > My purpose is to enriche as much as possible with code > snippets that I > > > use very often > > > > Have you tried "Insert Macro" In the code-template editor window > > ("Tools" Menu) ? > > > > It lists them all + description > > The documentation is here: > > http://wiki.lazarus.freepascal.org/IDE_Window:_Code_Templates > > Martin, can you elaborate how the "param" macro works? The > description is looks a bit confusing: > > Inserts an editable Cell, with a default value > "",Sync=n (,S=n), to Sync with a previous cell (n=1 to highest prev cell > "default",Sync, to Sync with a previous cell of equal default > > updated: 'Inserts an editable Cell. Cells can be navigated using the tab key.%0:s' + 'The "param" macro takes a list of comma separated arguments.%0:s' + 'The first argument is the default value.%0:s' + 'The 2nd argument (optional) can be used to link the cell to another cell (syncro edit)%0:s' + '%0:s' + ' while param("foo") do param(foo);%0:s' + 'Inserts 2 independent cells, both with the default text "foo"%0:s' + 'The quotes are optional%0:s' + '%0:s' + ' if param("foo") > 0 and param("foo",sync=1) < 99 then%0:s' + 'Inserts 2 linked cells, editing either one, will change the other one too%0:s' + 'The value "1" refers to the position of the other "param()", so if there are more params:%0:s' + ' if param("bar") and param(foo) > 0 and param(foo,sync=2) < 99 then%0:s' + 'The 2nd and third are linked. (the 3rd refers to "2") %0:s' + '%0:s' + '"sync can be shortened to "s":%0:s' + ' if param("foo") > 0 and param("foo",s=1) < 99 then%0:s' + '%0:s' + ' if param("bar") and param("foo") > 0 and param("foo",sync) < 99 then%0:s' + 'The 2nd and third are linked.%0:s' + 'Note: "Sync has no position and no "=", so it syncs to the previous cell with the same default (in this case "foo")' ;

Tahnks Martin. I deducted looking at some code snippets. Sounds much more clear now.
Thanks

Show quoted text 8 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120110/caa68802/attachment.html>

Reply by email

Mattias Gaertner
to Martin: updated: 'Inserts an editable Cell. Cells can be navigated using the tab key.%0:s' + 'The…
Show quoted text 73 lines
On 10/01/2012 14:41, Mattias Gaertner wrote: > > > Mattias Gaertner hat am 10. Januar 2012 um > 15:33 geschrieben: > > > Martin hat am 10. Januar 2012 um 15:04 > geschrieben: > > > On 10/01/2012 13:29, Antonio Fortuny wrote: > > > Hi folks. > > > > > > Does anyone know where I can find a syntax description and the > usage > > > rules of all keywords which appear in the source code templates ? > > > And those which do not appear as well ;-) > > > Basically I did find the file > "..\lazarus\ide\lazarus_dci_file.dci" > > > and it already gives some self explanatory rules. > > > My purpose is to enriche as much as possible with code > snippets that I > > > use very often > > > > Have you tried "Insert Macro" In the code-template editor window > > ("Tools" Menu) ? > > > > It lists them all + description > > The documentation is here: > > http://wiki.lazarus.freepascal.org/IDE_Window:_Code_Templates > > Martin, can you elaborate how the "param" macro works? The description > is looks a bit confusing: > > Inserts an editable Cell, with a default value > "",Sync=n (,S=n), to Sync with a previous cell (n=1 to highest prev cell > "default",Sync, to Sync with a previous cell of equal default > > updated: 'Inserts an editable Cell. Cells can be navigated using the tab key.%0:s' + 'The "param" macro takes a list of comma separated arguments.%0:s' + 'The first argument is the default value.%0:s' + 'The 2nd argument (optional) can be used to link the cell to another cell (syncro edit)%0:s' + '%0:s' + ' while param("foo") do param(foo);%0:s' + 'Inserts 2 independent cells, both with the default text "foo"%0:s' + 'The quotes are optional%0:s' + '%0:s' + ' if param("foo") > 0 and param("foo",sync=1) < 99 then%0:s' + 'Inserts 2 linked cells, editing either one, will change the other one too%0:s' + 'The value "1" refers to the position of the other "param()", so if there are more params:%0:s' + ' if param("bar") and param(foo) > 0 and param(foo,sync=2) < 99 then%0:s' + 'The 2nd and third are linked. (the 3rd refers to "2") %0:s' + '%0:s' + '"sync can be shortened to "s":%0:s' + ' if param("foo") > 0 and param("foo",s=1) < 99 then%0:s' + '%0:s' + ' if param("bar") and param("foo") > 0 and param("foo",sync) < 99 then%0:s' + 'The 2nd and third are linked.%0:s' + 'Note: "Sync has no position and no "=", so it syncs to the previous cell with the same default (in this case "foo")' ;

Thanks. Much better.

Mattias

Reply by email