Author Topic: what is CodeSnippets for?  (Read 5164 times)

Offline ahlongxp

  • Multiple posting newcomer
  • *
  • Posts: 22
what is CodeSnippets for?
« on: October 11, 2006, 04:24:21 pm »
I don't know how to make use of it.
can someone give me a small sample?
ubuntu 8.04
wxWidget 2.8

Offline BCCISProf

  • Multiple posting newcomer
  • *
  • Posts: 60
    • Professor Langsam's Home Page
Re: what is CodeSnippets for?
« Reply #1 on: October 11, 2006, 04:52:07 pm »
CodeSnipppets allows you to create a 'library' of snippets of code that you want to resuse.

For example, lets say that you start each program with an elaborate comment. Rather than have to type it over and over, you simply highlight the comment (or any number of lines) and drag it into the codesnippets window. It will then allow you to give it a name.

Open a new file and double click on the name you chose for the snippet, and it will place that code at the cursor.

Its like a clipboard that can hold any number of 'snippets' of code that you can reuse at anytime.

Very useful!

Offline ahlongxp

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: what is CodeSnippets for?
« Reply #2 on: October 12, 2006, 07:34:39 am »
CodeSnipppets allows you to create a 'library' of snippets of code that you want to resuse.

For example, lets say that you start each program with an elaborate comment. Rather than have to type it over and over, you simply highlight the comment (or any number of lines) and drag it into the codesnippets window. It will then allow you to give it a name.

Open a new file and double click on the name you chose for the snippet, and it will place that code at the cursor.

Its like a clipboard that can hold any number of 'snippets' of code that you can reuse at anytime.

Very useful!

thanks a lot.
but there's a problem. can I preview the selected code snippet beside applying it
ubuntu 8.04
wxWidget 2.8

Offline BCCISProf

  • Multiple posting newcomer
  • *
  • Posts: 60
    • Professor Langsam's Home Page
Re: what is CodeSnippets for?
« Reply #3 on: October 12, 2006, 03:16:35 pm »
Apparently not. However, you can name each snippet. Probably designed for small pieces of code, so you can drag them into the editor, and if its not to your liking delete it.

Perhaps you can suggest this as an enhancement to the developer.

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
Re: what is CodeSnippets for?
« Reply #4 on: October 12, 2006, 03:38:13 pm »
but there's a problem. can I preview the selected code snippet beside applying it

No you can't, yet.