Recent

Author Topic: "Code Templates" how to add new template?  (Read 4815 times)

rabiuls

  • Newbie
  • Posts: 2
"Code Templates" how to add new template?
« on: March 24, 2014, 10:19:41 am »
Hello,

Greetings to all.

I am using Lazarus, version 1.0.12.

I want to know the correct procedure to add a "new template" to the "Code Templates", which can be found inside Tools menu.

I have read this page:

http://wiki.lazarus.freepascal.org/IDE_Window:_Code_Templates

I could not understand how to do it, specially the line:

"In the source below fill in "

I could not found anything like "source" box.

For example, I want to create a template for "ShowMessage('');", the token would be say "sh". Now when I type sh and press CTRL+J, it should insert ShowMessage('');.

I don't know if I was able to describe what I want correctly. If so, please let me know if should give more information.

If anyone has a solution, please let me know.

Kind regards,

Rabiul.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: "Code Templates" how to add new template?
« Reply #1 on: March 24, 2014, 11:30:47 am »
I could not understand how to do it, specially the line:
"In the source below fill in "
I could not found anything like "source" box.

Your Code Templates dialog is not showing at its full extent for some reason (Lazarus IDE layout is sometimes a bit buggy).
Drag the bottom of the dialog downwards to reveal the edit box you need. Then it is straightforward to add the text "ShowMessage('|');" that you require.

rabiuls

  • Newbie
  • Posts: 2
Re: "Code Templates" how to add new template?
« Reply #2 on: March 29, 2014, 05:25:51 am »
Very sorry for the delay of my response, I was out of home. And many thanks to howardpc. I followed his instruction and it worked. I dragged the bottom of the "Code Templates" window, and found a 'Memo' box, pasted ShowMessage('|'); here and it worked :).

Thanks to all.

Best regards.

 

TinyPortal © 2005-2018