Freeform Snippets

Unlike the other snippet kinds, freeform code snippets can contain any kind of source code. The code does not need to compilable, and nor does its layout need to conform to any 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 as there are no rules to conform to.

Note: You will never find freeform code in the online database.

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 below the source code.

How do I change the 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 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).