-
Notifications
You must be signed in to change notification settings - Fork 8
/
enumerationloops.htm
75 lines (74 loc) · 6.31 KB
/
enumerationloops.htm
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
<!DOCTYPE HTML>
<html id="hs-topic-p">
<!-- saved from url=(0025)http://www.helpsmith.com/ -->
<head>
<title>Enumeration Loops</title>
<meta charset="windows-1252" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="HelpSmith 9.8 (Build 23.1026)" />
<link type="text/css" rel="stylesheet" href="../css/topics/style.css" />
<script type="text/javascript" src="../js/jquery-3.7.1.min.js"></script>
<style type="text/css" media="screen">
html {
height: 100%;
}
body {
margin: 0;
}
</style>
<script type="text/javascript" src="../js/settings.js?d3532453"></script>
<script type="text/javascript" src="../js/core.min.js?adb9c364"></script>
<script type="text/javascript" src="../js/topic.min.js?adb9c364"></script>
<script type="text/javascript">
var topicContext = 1870;
</script>
<!-- Web Help Topic -->
<!-- HTML Help (CHM) Topic -->
</head>
<body class="nsa-wrapper">
<div id="nsa-box" class="nsa-content0">
<h1 class="hd0"><span class="ts0">Enumeration Loops</span></h1>
</div>
<div id="sa-box">
<div id="content-box" class="sa-content0">
<p> </p>
<p class="ps1"><span class="ts2">An enumeration loop is a </span><a href="templatefiles.htm" class="hs2">template file</a><span class="ts2"> construct which allows you to iterate through the collection of enumerations that CodeGen has information about. In order to use an enumeration loop your repository must include at least one enumeration definition. If the repository does not contain any enumerations then the enumeration loop is ignored.</span></p>
<p class="ps1"><span class="ts2">Enumeration loops are delimited by a matching pair of </span><span class="ts4"><ENUM_LOOP></span><span class="ts2"> and </span><span class="ts4"></ENUM_LOOP></span><span class="ts2"> tags that surround the template code to be inserted for each enumeration.</span></p>
<p class="ps1"><span class="ts2">Enumeration loop tokens are tokens that can only be used within an enumeration loop:</span></p>
<p class="ps0"><span style="font-size: 14pt; line-height: 0; vertical-align: middle; color: Black">•</span><span style="display: inline-block; width: 18px"></span><a href="enumerationloopexpansiontokens.htm" class="hs2">Enumeration Loop Expansion Tokens</a></p>
<p class="ps0"><span style="font-size: 14pt; line-height: 0; vertical-align: middle; color: Black">•</span><span style="display: inline-block; width: 18px"></span><a href="enumerationloopexpressiontokens.htm" class="hs2">Enumeration Loop Expression Tokens</a></p>
<p class="ps1"><span class="ts2">There are three types of enumeration loop, multi-line enumeration loops, in-line enumeration loops, and structure enumeration loops.</span></p>
<h2 class="hd1"><span class="ts1">Multi-line Enumeration Loops</span></h2>
<p class="ps1"><span class="ts2">Multi-line enumeration loops occur when the opening and closing key loop tags appear on separate lines in a template file, and delimit one or more entire lines of template code, like this:</span></p>
<p class="ps9"><span class="ts3">[code]</span></p>
<p class="ps9"><span class="ts4"><ENUM_LOOP></span><br /><span class="ts4">code</span><br /><span class="ts4"></ENUM_LOOP></span></p>
<p class="ps9"><span class="ts3">[code]</span></p>
<p class="ps1"><span class="ts2">Multi-line enumeration loops generate one or more lines of output code for each enumeration that is processed.</span></p>
<h2 class="hd1"><span class="ts1">In-Line Enumeration Loops</span></h2>
<p class="ps1"><span class="ts2">In-line enumeration loops exist when the opening and closing enumeration loop tags appear on the same line in a template file, and delimit part of a line of template code, like this:</span></p>
<p class="ps9"><span class="ts3">[code] </span><span class="ts4"><ENUM_LOOP> code </ENUM_LOOP></span><span class="ts3"> [code]</span></p>
<p class="ps1"><span class="ts2">In-line enumeration loops generate code into the current output line only.</span></p>
<p class="ps1"><span class="ts2">The code between the opening and closing tags of an enumeration loop is repeated for each enumeration in the repository.</span></p>
<p class="ps1"><span class="ts2">The code within an enumeration loop can contain generic tokens, and can also contain special enumeration loop tokens, which are discussed later.</span></p>
<p class="ps1"><span class="ts2">Enumeration loop tokens can only be used inside an enumeration loop, and an enumeration loop can’t be declared within any other loop construct.</span></p>
<h2 class="hd1"><a id="STRUCTURE_ENUM_LOOPS"></a><span class="ts1">Structure Enumeration Loops</span></h2>
<p class="ps1"><span class="ts2">A structure enumeration loop is similar to an enumeration loop, except that only enumerations that are referenced by fields in the repository structure that is being processed are included. As with enumeration loops, CodeGen supports both multi-line and in-line structure enumeration loops.</span></p>
<p class="ps1"><span class="ts2">A multi-line structure enumeration loop looks like this:</span></p>
<p class="ps9"><span class="ts3">[code]</span></p>
<p class="ps9"><span class="ts4"><ENUM_LOOP_STRUCTURE></span><br /><span class="ts4">code</span><br /><span class="ts4"></ENUM_LOOP_STRUCTURE></span></p>
<p class="ps9"><span class="ts3">[code]</span></p>
<p class="ps1"><span class="ts2">And an in-line structure enumeration loop looks like this:</span></p>
<p class="ps9"><span class="ts3">[code] </span><span class="ts4"><ENUM_LOOP_STRUCTURE> code </ENUM_LOOP_STRUCTURE></span><span class="ts3"> [code]</span></p>
<p class="ps1"><span class="ts2">Multi-line structure enumeration loops generate one or more lines of output code for each enumeration that is processed, whereas in-line structure enumeration loops generate code into the current output line only.</span></p>
<p class="ps1"><span class="ts2"> </span></p>
<p><span class="ts2"> </span></p>
<p><span class="ts2"> </span></p>
<div class="hr-wrapper">
<hr class="hline1" />
</div>
<p class="ps8"><span class="ts10">Copyright © 2021 Synergex International, Inc.</span></p>
</div>
</div>
</body>
</html>