Freeform Snippets

Unlike the other snippet kinds, freeform code snippets can contain any kind of source code. The code can be in any language, does not need to be compilable and does not have to conform to any layout rules.

Because of the nature of freeform snippets, CodeSnip can make no assumptions about them and therefore cannot include the code in a compilable unit. This has two major implications:

  1. Freeform snippets are never included in generated units.
  2. The snippets cannot be test-compiled (because CodeSnip cannot generate a test unit).

If you can live without these features and just want to use CodeSnip as a simple code repository, freeform snippets are by far the easiest way to create your own snippets.

When should freeform be used?

You should use freeform snippets if:

How do I check if code is freeform?

Select the snippet in the Overview Pane and look in the Detail Pane. Look for the "Kind" section. (This section appears just below the source code unless the display layout has been customised.)

How do I change a freeform snippet to another kind?

Select the snippet in the Overview Pane then select the Snippets | Edit Snippet menu item to open the Edit Snippet dialogue box. On the Code tab select a suitable value in the Kind drop down list and press OK.

Warning: Don't change the kind unless you are happy that the snippet conforms to the requirements of the new kind. (Learn more).