Menu

[r2017]: / trunk / Src / Help / HTML / snippet_kinds.htm  Maximize  Restore  History

Download this file

107 lines (106 with data), 4.0 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--
* $Rev$
* $Date$
*
* ***** BEGIN LICENSE BLOCK *****
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* The Original Code is snippet_kinds.htm
*
* The Initial Developer of the Original Code is Peter Johnson
* (http://www.delphidabbler.com/).
*
* Portions created by the Initial Developer are Copyright (C) 2009-2012 Peter
* Johnson. All Rights Reserved.
*
* ***** END LICENSE BLOCK *****
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text-html; charset=Windows-1252">
<title>
Snippet Kinds
</title>
<link rel="stylesheet" href="../css/codesnip.css" type="text/css">
</head>
<body>
<object
type="application/x-oleobject"
classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e"
>
<param name="ALink Name" value="SnippetKinds">
</object>
<h1>
<a name="snippet_kinds"></a>Snippet Kinds
</h1>
<p>
<em>CodeSnip</em> is more than just a simple repository for your code
snippets, it can do some other things like create compilable units and
test-compile your code that mean it needs to know something about your
code. For that reason each snippet must be identified as one of six
kinds, and there are rules governing the layout of the source code for
each kind. The four kinds are:
</p>
<ol>
<li>
A <em>routine</em><br>
This is simple function or procedure, not a method.<br>
<a href="snippet_routine.htm">Learn more</a>.
</li>
<li>
A <em>simple type</em> definition<br>
This is a basic type definition, not a class, object or advanced record.
<br>
<a href="snippet_type.htm">Learn more</a>.
</li>
<li>
A <em>constant</em> definition<br>
This is what it says &ndash; a definition of one or more constants or
typed constants.<br>
<a href="snippet_constant.htm">Learn more</a>.
</li>
<li>
A <em>class / advanced record</em> definition<br>
This is either a class or an advanced record (with methods). This type
of snippet has separate declaration and definition sections.<br>
<a href="snippet_class.htm">Learn more</a>.
</li>
<li>
A <em>unit</em><br>
This comprises a complete source code unit. A unit is test compiled on
its own and, for obvious reasons can't be inserted into generated units.
<br>
<a href="snippet_unit.htm">Learn more</a>.
</li>
<li>
<em>Freeform code</em><br>
A catch all for any snippet that is not one of the above types. Can
contain anything. Freeform code can't be included in a
generated unit and nether can it be test complied.<br>
<a href="snippet_freeform.htm">Learn more</a>.
</li>
</ol>
<p>
If you want to be able use all of <em>CodeSnip</em>'s functionality you
must designate each of your snippets as one of the the first five kinds.
Use the &quot;learn more&quot; links to find out what you need to do to
comply with the requirements. Another way to learn is to examine the code
from the main database, since it all conforms.
</p>
<p>
On the other hand if you only want to use <em>CodeSnip</em> as a
repository for your code snippets, and don't want test compiling, just
designate everything as freeform. Or mix and match.
</p>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.