<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Structured Authoring &#187; ACL</title>
	<atom:link href="http://structuredauthoring.org/category/acl/feed/" rel="self" type="application/rss+xml" />
	<link>http://structuredauthoring.org</link>
	<description>Learning Structured Authoring - Tools and Processes</description>
	<lastBuildDate>Tue, 17 Aug 2010 15:03:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Wiki Help Files</title>
		<link>http://structuredauthoring.org/sa/wiki-help-file/</link>
		<comments>http://structuredauthoring.org/sa/wiki-help-file/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 15:00:15 +0000</pubDate>
		<dc:creator>douglaspaulwade</dc:creator>
				<category><![CDATA[ACL]]></category>
		<category><![CDATA[Arbortext Editor]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Structured Authoring]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://structuredauthoring.org/?p=409</guid>
		<description><![CDATA[One thing that I think about all the time is how to improve documentation. One thing I would like to have is documentation that is context sensitive in Arbortext and collaborative.  At work we have a style guide which determines &#8220;what&#8221; we are to do but rather than &#8220;how&#8221; to do it.  Many years ago, [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that I think about all the time is how to improve documentation. One thing I would like to have is documentation that is context sensitive in Arbortext and collaborative.  At work we have a style guide which determines &#8220;what&#8221; we are to do but rather than &#8220;how&#8221; to do it.  Many years ago, I placed all of the &#8220;how to&#8221; documentation into Microsoft Word, saved it out as PDF, yet I struggled with this. Next, I desired to work more in XML, so I adopted Docbook. All the Microsoft documents were converted to Docbook which I pushed out, HTML pages, PDF files, and Microsoft Help (.chm) files.</p>
<p>The biggest issue was that I was the single bellybutton to all the documentation. I strived for a collaborative solution. I worked with Wiki&#8217;s and set out to install one. Our corporate structure would not allow me to install one. The company had just created one, and they only wanted one in the company culture. I was not sure that I wanted all my documentation out there for all to see. Because I work for a large aerospace company. However, I got over it; it was more important to have collaborative tools rather than my pride. I imported all the docbook information into our Wiki.</p>
<p>The biggest complaint of the wiki was its weak search. I wanted a way for a writer who is authoring in a SGML/XML file, to hit the help button and go to an exact area in the documentation. The Arbortext Editor has the Shift-F1 to present a customized help. I played with it trying to add hyperlinks to those files. With the help of the <a href="http://portal.ptcuser.org/l/pw/rs">adepters</a> mailing list and <a href="mailto:chelberg@terraxml.com">Clay Helberg</a> (a Arbortext guru), he mentioned a few things, one being of which is remapping the Shift-F1 key. The other is how to open a file. So, I used the <em>browse_url</em> function which launches a HTML page, in my case a Wiki page. I needed to add more information in the URL based on the two things: the DTD name and element name. In the Wiki, I am using subpages which are like a collection. All pages will be a subpages grouped in &#8220;Structured-Elements&#8221; and also &#8220;38784&#8243; (the DTD name) followed by the tag name. The tag is found using the ACL functions of  <em>oid_name(oid_caret())</em>. The <em>oid_caret</em> is the cursor position and <em>oid_name</em> is the name of the element. So below is the code snippet: I placed it inside my ACL file located at  (&lt;arbortext-home&gt;/custom/editinit) which gets sourced when a document is opened.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$dtd</span> = public_id<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">if</span> <span class="br0">&#40;</span>match<span class="br0">&#40;</span><span class="re0">$dtd</span>,<span class="st0">&quot;38784&quot;</span> <span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<a href="http://perldoc.perl.org/functions/map.html"><span class="kw3">map</span></a> shift-f1 <span class="br0">&#123;</span> browse_url<span class="br0">&#40;</span><span class="st0">&quot;http://wiki.yourcompany.com/wiki/Structured-Elements/&quot;</span> . &nbsp;<span class="st0">&quot;38784/&quot;</span> . oid_name<span class="br0">&#40;</span>oid_caret<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<p>When the writers place the cursor inside an element, for example,  &lt;title&gt;, and then does a Shift-F1, the Arbortext Editor will open to a Wiki page by element and DTD name.</p>
<p>That was the easy part, now is the hard part; populating the Wiki with content on the elements. With Mil-Spec DTD&#8217;s (some of our work uses them), we have a TDT file (it contains all the element names and attributes with descriptions). My co-worker, Joe, our other Software Engineer, wrote a Perl script to convert each element to a Wiki page. I will import a couple of hundred new Wiki pages here in the next few days.</p>
<p>The final part is adding extra links in these new pages to the established Wiki pages, therefore linking the entire project together.</p>
]]></content:encoded>
			<wfw:commentRss>http://structuredauthoring.org/sa/wiki-help-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing Unused Graphics</title>
		<link>http://structuredauthoring.org/sa/removing-unused-graphics/</link>
		<comments>http://structuredauthoring.org/sa/removing-unused-graphics/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 23:35:32 +0000</pubDate>
		<dc:creator>douglaspaulwade</dc:creator>
				<category><![CDATA[ACL]]></category>
		<category><![CDATA[Structured Authoring]]></category>
		<category><![CDATA[Arbortext Editor]]></category>

		<guid isPermaLink="false">http://structuredauthoring.org/?p=388</guid>
		<description><![CDATA[In SGML files graphics are declared. Once they are declared they can be referenced in elements such as &#60;graphic&#62; or whatever your DTD declares. Often during the development of the files, some graphic declarations are created but never used. It is a good practice to remove graphic declarations that are not required. I came across [...]]]></description>
			<content:encoded><![CDATA[<p>In SGML files graphics are declared. Once they are declared they can be referenced in elements such as <strong>&lt;graphic&gt; </strong>or whatever your DTD declares. Often during the development of the files, some graphic declarations are created but never used. It is a good practice to remove graphic declarations that are not required.</p>
<p>I came across this ACL file from Karl Johan Kleist (original code by Rune Kallhovd) on <a title="Adepters.org" href="http://www.adepters.org/aclhowtoremoveunusedgraphicentitesfromad" target="_blank">Adepters</a> website, listed below.</p>
<p>I named that code below as <strong>removeUnusedGraphics.acl </strong>and placed it in <strong>&lt;arbortext home&gt;/custom/scripts</strong> folder. I tied it to a menu on init ACL file (<strong>&lt;arbortext home&gt;/custom/editinit</strong>) that runs when a document is opened. It has these items added in the menu. First, the file is sourced. second, call the function, <strong>clean_unused_gfxents()</strong> when the menu item is selected.</p>
<div id="attachment_391" class="wp-caption alignnone" style="width: 263px"><img class="size-full wp-image-391 " title="Remove Unused Graphic Menu Pick" src="http://structuredauthoring.org/wp-content/uploads/2009/11/menu.png" alt="Remove Unused Graphic Menu Pick" width="253" height="348" /><p class="wp-caption-text">Remove Unused Graphic Menu Pick</p></div>
<p>Items to add to the Menu<strong>*</strong></p>
<div class="dean_ch" style="white-space: wrap;">source removeUnusedGraphics.acl<br />
menu_add <span class="st0">&quot;.TechData.&quot;</span> <span class="st0">&quot;Remove all unused graphic entities&quot;</span> -cmd <span class="br0">&#123;</span> clean_unused_gfxents<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#125;</span></div>
<p>Code File</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1"># Rune Kallhovd and Karl Johan Kleist</span><br />
<span class="co1"># Posted 2006-06-18 to adepters.org</span></p>
<p>function clean_unused_gfxents<span class="br0">&#40;</span>doc,op<span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/local.html"><span class="kw3">local</span></a> entArr<span class="br0">&#91;</span><span class="br0">&#93;</span>, gfxArr<span class="br0">&#91;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/local.html"><span class="kw3">local</span></a> entArrlen = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/local.html"><span class="kw3">local</span></a> gfxCnt = <span class="nu0">1</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>op != <span class="nu0">2</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/return.html"><span class="kw3">return</span></a> <span class="nu0">0</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p><span class="co1"># Building an Array of declared entities:</span></p>
<p>&nbsp; &nbsp; entArrlen = graphic_entity_names<span class="br0">&#40;</span>entArr, doc<span class="br0">&#41;</span>;</p>
<p><span class="co1"># Building an Array of used entities:</span></p>
<p>&nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>o = oid_first<span class="br0">&#40;</span>doc<span class="br0">&#41;</span>; oid_valid<span class="br0">&#40;</span>o<span class="br0">&#41;</span>; o = oid_forward<span class="br0">&#40;</span>o<span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1"># Do we have a Graphic tag?</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>graphic_tag<span class="br0">&#40;</span>oid_name<span class="br0">&#40;</span>o<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1"># Get the attribute name holding the ENTITY</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/local.html"><span class="kw3">local</span></a> gfxentnam = graphic_entity_attr_name<span class="br0">&#40;</span>oid_name<span class="br0">&#40;</span>o<span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>gfxentnam != <span class="st0">&quot;&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gfxArr<span class="br0">&#91;</span>gfxCnt<span class="br0">&#93;</span> = oid_attr<span class="br0">&#40;</span>o, gfxentnam<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gfxCnt++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p><span class="co1"># Iterate over declared entities, and delete unused ones:</span></p>
<p>&nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>i = <span class="nu0">1</span>; i &lt;= entArrlen; i++<span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/local.html"><span class="kw3">local</span></a> found = <span class="nu0">0</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; ent = entArr<span class="br0">&#91;</span>i<span class="br0">&#93;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>gfx in gfxArr<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>gfxArr<span class="br0">&#91;</span>gfx<span class="br0">&#93;</span> == ent<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; found = <span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>!found<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; undeclare_entity <span class="re0">$ent</span>; &nbsp;<span class="co1"># NOTE: dollar sign needed here / kjk</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="co1"># Add the following to e.g. a init() function:</span><br />
doc_add_callback<span class="br0">&#40;</span><span class="nu0">0</span>, <span class="st0">&#8216;save&#8217;</span>, <span class="st0">&#8216;cor_utils::clean_unused_gfxents&#8217;</span>, <span class="st0">&#8216;PREPEND&#8217;</span><span class="br0">&#41;</span>;</div>
<p><strong>*</strong> Menu article coming soon&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://structuredauthoring.org/sa/removing-unused-graphics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting with Arbortext&#8217;s ACL Language &#8211; Part 4</title>
		<link>http://structuredauthoring.org/sa/starting-arbortexts-acl-language-part-4/</link>
		<comments>http://structuredauthoring.org/sa/starting-arbortexts-acl-language-part-4/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 14:45:35 +0000</pubDate>
		<dc:creator>douglaspaulwade</dc:creator>
				<category><![CDATA[ACL]]></category>
		<category><![CDATA[Arbortext Editor]]></category>
		<category><![CDATA[Structured Authoring]]></category>
		<category><![CDATA[arbortext]]></category>
		<category><![CDATA[array]]></category>

		<guid isPermaLink="false">http://structuredauthoring.org/?p=376</guid>
		<description><![CDATA[ACL, Arbortext&#8217;s Command Language, it is similar to Perl which is the programming language I prefer. See Part 1, Part 2 and Part 3. Arrays Arrays are special variables with multiple &#8220;compartments&#8221;. Each compartment holds a value. Arrays consist of names and indexes. ACL has two types of one-dimensional arrays: Normal arrays are indexed by [...]]]></description>
			<content:encoded><![CDATA[<p>ACL, Arbortext&#8217;s Command Language, it is similar to Perl which is the programming language I prefer. See <a title="ACL Part 1" href="http://structuredauthoring.org/arbortext-editor/arbortexts-acl-language/" target="_blank">Part 1</a>, <a title="ACL Part 2" href="http://structuredauthoring.org/arbortext-editor/arbortexts-acl-language-part-2/" target="_blank">Part 2</a> and <a href="http://structuredauthoring.org/sa/starting-arbortexts-acl-language-part-3/">Part 3</a>.</p>
<h2>Arrays</h2>
<p>Arrays are special variables with multiple &#8220;compartments&#8221;. Each compartment holds a value. Arrays consist of names and indexes. ACL has two types of one-dimensional arrays:</p>
<p><strong>Normal </strong>arrays are indexed by integers subscripts.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$array</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> = <span class="st0">&quot;tester&quot;</span>;</div>
<p><strong>Associative </strong>arrays are indexed by arbitrary strings or keys.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$array</span><span class="br0">&#91;</span><span class="st0">&quot;tester&quot;</span><span class="br0">&#93;</span> = <span class="st0">&quot;debug&quot;</span>;</div>
<h2>Declaring Arrays</h2>
<p>Arrays can be defined as local or global. Define them like a variable, ($) name, square brackets, semicolon. Arrays can be set to a dimension such as having ten values, $array[10].  The square brackets [ ] are used to address or retrieve the elements of an array.</p>
<h2>Accessing Array</h2>
<p>Accessing the keys of an array, use the <strong>for </strong>loop, as in: <em>for (key in array)</em>.<br />
For example, the code below iterates over the two elements of the associative array <strong>color </strong> twice, once with Associative and once with Normal:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1">#&#8211; Associative Array</span><br />
<span class="re0">$color</span><span class="br0">&#91;</span><span class="st0">&quot;red&quot;</span><span class="br0">&#93;</span> = <span class="st0">&quot;red&quot;</span>;<br />
<span class="re0">$color</span><span class="br0">&#91;</span><span class="st0">&quot;blue&quot;</span><span class="br0">&#93;</span> = <span class="st0">&quot;blue&quot;</span>;<br />
<span class="kw1">for</span> <span class="br0">&#40;</span><span class="re0">$hue</span> in <span class="re0">$color</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;response<span class="br0">&#40;</span><span class="st0">&quot;the color is &quot;</span> . <span class="re0">$color</span><span class="br0">&#91;</span><span class="re0">$hue</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></p>
<p>unsetvar color; <span class="co1">#&#8211; the color array undeclared</span></p>
<p><span class="co1">#&#8211; Normal Array</span><br />
<span class="re0">$color</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> = <span class="st0">&quot;red&quot;</span>;<br />
<span class="re0">$color</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> = <span class="st0">&quot;blue&quot;</span>;<br />
<span class="kw1">for</span> <span class="br0">&#40;</span><span class="re0">$hue</span> in <span class="re0">$color</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;response<span class="br0">&#40;</span><span class="re0">$color</span><span class="br0">&#91;</span><span class="re0">$hue</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
]]></content:encoded>
			<wfw:commentRss>http://structuredauthoring.org/sa/starting-arbortexts-acl-language-part-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Starting with Arbortext&#8217;s ACL Language &#8211; Part 3</title>
		<link>http://structuredauthoring.org/sa/starting-arbortexts-acl-language-part-3/</link>
		<comments>http://structuredauthoring.org/sa/starting-arbortexts-acl-language-part-3/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 21:38:12 +0000</pubDate>
		<dc:creator>douglaspaulwade</dc:creator>
				<category><![CDATA[ACL]]></category>
		<category><![CDATA[Structured Authoring]]></category>
		<category><![CDATA[arbortext]]></category>

		<guid isPermaLink="false">http://structuredauthoring.org/?p=341</guid>
		<description><![CDATA[ACL is Arbortext&#8217;s Command Language. It is similar to Perl, which I really like. See Part 1 and Part 2. Variables A variable is a keyword or phrase that is linked to a &#8220;value&#8221; stored in memory or an expression that can be evaluated. For instance, a variable might be called &#8220;total_count&#8221; and contains a [...]]]></description>
			<content:encoded><![CDATA[<p>ACL is Arbortext&#8217;s Command Language. It is similar to Perl, which I really like. See <a title="ACL Part 1" href="http://structuredauthoring.org/arbortext-editor/arbortexts-acl-language/" target="_blank">Part 1</a> and <a title="ACL Part 2" href="http://structuredauthoring.org/arbortext-editor/arbortexts-acl-language-part-2/" target="_blank"> Part 2</a>.</p>
<h2>Variables</h2>
<p>A variable is a keyword or phrase that is linked to a &#8220;value&#8221; stored in memory or an expression that can be evaluated. For instance, a variable might be called &#8220;total_count&#8221; and contains a number. Variables are usually defined in ACL beginning with a dollar sign ($), they do not have to, but it is very good practice. The variable is on the left side and the value is on the right of the assignment operator (=). When assigning variables, it best to read right to left.  For example, assigning the string or text, &#8220;red&#8221; with the equal sign (=), to a variable &#8220;color&#8221;. It is a good practice to end your assignments with a semi-colon (;).</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$color</span> = red;</div>
<p>Some common variable assignments using expressions.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1">#&#8212; Machine Name</span><br />
<span class="re0">$machine</span> = <span class="re0">$main</span>::<span class="me2">ENV</span><span class="br0">&#91;</span><span class="st0">&#8216;COMPUTERNAME&#8217;</span><span class="br0">&#93;</span>;</p>
<p><span class="co1">#&#8212; User&#8217;s Name</span><br />
<span class="re0">$user</span> = username<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
<h2>Variable Scope</h2>
<p>Variables exist in two locations or scopes, Global and Local.</p>
<p>The default is Local. It is a good practice to define the minimum amount of scope needed or limiting your variables. This is helpful in maintaining the code and debugging it. For example, it may be confusing if a variable is a Global $A and a Local variable called $A are both being used in a For-Each loop.</p>
<p>Global variables are accessible anywhere in the ACL code.</p>
<p><strong>Tip:</strong> If defining a Global Variable, pick a naming convention such as all caps. This will be helpful when mixing Local and Global variables in code. For Local variables, choose, for example, Camel Case.</p>
<div class="dean_ch" style="white-space: wrap;">global <span class="re0">$DEBUG</span> = <span class="nu0">1</span>;</div>
<div class="dean_ch" style="white-space: wrap;"><a href="http://perldoc.perl.org/functions/local.html"><span class="kw3">local</span></a> <span class="re0">$UserName</span> =<span class="st0">&quot;Tester&quot;</span>;</div>
<p>Local variables can be limited by a block of code (code inside the { }). When variables are assigned, inside blocks are local or limited just to that block. Blocks can be found in functions and items inside conditionals, such as an if statement.</p>
<div class="dean_ch" style="white-space: wrap;">function findTMnumberName <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;mark -<a href="http://perldoc.perl.org/functions/select.html"><span class="kw3">select</span></a> end<br />
&nbsp; &nbsp;<span class="re0">$tmname</span> = <span class="re0">$selection</span> <span class="co1">#local variable</span><br />
&nbsp; &nbsp;gsub<span class="br0">&#40;</span><span class="st0">&#8216;^P&#8217;</span>, <span class="st0">&#8221;</span>,  <span class="re0">$tmname</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp;gsub<span class="br0">&#40;</span><span class="st0">&#8216;^V&#8217;</span>, <span class="st0">&#8221;</span>,  <span class="re0">$tmname</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp;<span class="re0">$TMnumber</span> = <span class="re0">$TM_NAME</span><span class="br0">&#91;</span><span class="re0">$tmname</span><span class="br0">&#93;</span>; <span class="co1">#local variables, global $TM_NAME</span><br />
&nbsp; &nbsp;response<span class="br0">&#40;</span><span class="re0">$TMnumber</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp;caret <span class="nu0">0</span>,<span class="st0">&quot;&lt;title&gt;&quot;</span> -t<br />
&nbsp; &nbsp;is -pd <span class="st0">&quot;$TMnumber&quot;</span>;<br />
<span class="br0">&#125;</span></div>
<h2>Shortcut Assignments</h2>
<p>If using a number variable as a counter, and the counter needs to increment by one, you could do:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$lineNumber</span> = <span class="re0">$lineNumer</span> <span class="nu0">+1</span>;</div>
<p>A shortcut using the (+=) means increment and assign the value to itself.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$lineNumber</span> += <span class="nu0">1</span>;</div>
<p>If using a string variable using the dot operator (.) to concatenate or stitch together strings.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$message</span> = <span class="st0">&quot;File &quot;</span> . doc_name<span class="br0">&#40;</span><span class="br0">&#41;</span> . <span class="st0">&quot; sent to be published!&quot;</span>;</div>
<p>The variable $message resolves as &#8220;File Chapter 2 sent to be published!&#8221; if doc_name() was equivalent to &#8220;Chapter 2&#8243;.</p>
<h2>Variable Evaluation</h2>
<p>Variables inside double quotes will be evaluated, and variables inside single quotes are not evaluated.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$username</span> = <span class="st0">&quot;Tester&quot;</span>;<br />
<span class="re0">$message</span> = <span class="st0">&quot;Hello $username!&quot;</span>;</div>
<p>Returns &#8220;Hello Tester!&#8221;</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$username</span> = <span class="st0">&quot;Tester&quot;</span>;<br />
<span class="re0">$message</span> = <span class="st0">&#8216;Hello $username!&#8217;</span>;</div>
<p>Returns &#8220;Hello $username!&#8221;</p>
<h2>Comparative</h2>
<p>Using variables for comparison. In a &#8220;if&#8221; statement, you may want the variable, if true, then do something with it. Comparisons can be strings equaling or not equaling other strings. As well as, numbers equaling (==), not equaling (!=), greater (&gt;), lesser (&lt;), greater or equal (&gt;=) or less than or equal (&lt;=) to other numbers.</p>
<h3>String comparisons (==):</h3>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$machine</span> == <span class="st0">&quot;Dell&quot;</span><span class="br0">&#41;</span>  <span class="br0">&#123;</span><br />
&nbsp; &nbsp;response<span class="br0">&#40;</span><span class="st0">&quot;machine is a Dell&quot;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="kw1">if</span> <span class="br0">&#40;</span>match<span class="br0">&#40;</span><span class="re0">$machine</span> ,<span class="st0">&quot;HP*&quot;</span> <span class="br0">&#41;</span>   <span class="br0">&#123;</span><br />
&nbsp; &nbsp;response<span class="br0">&#40;</span><span class="st0">&quot;machine is not a Dell, but some HP Model&quot;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
<h3>Number comparison (==, &gt;, &lt;, !=, &lt;=, &gt;=)</h3>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">if</span>  <span class="br0">&#40;</span><span class="re0">$status</span> !=<span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; message <span class="st0">&quot;You must select something first”; #Not equal to zero<br />
}</span></div>
]]></content:encoded>
			<wfw:commentRss>http://structuredauthoring.org/sa/starting-arbortexts-acl-language-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting with Arbortext&#8217;s ACL Language &#8211; Part 2</title>
		<link>http://structuredauthoring.org/arbortext-editor/arbortexts-acl-language-part-2/</link>
		<comments>http://structuredauthoring.org/arbortext-editor/arbortexts-acl-language-part-2/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 23:49:18 +0000</pubDate>
		<dc:creator>douglaspaulwade</dc:creator>
				<category><![CDATA[ACL]]></category>
		<category><![CDATA[Arbortext Editor]]></category>

		<guid isPermaLink="false">http://structuredauthoring.org/?p=49</guid>
		<description><![CDATA[Arbortext&#8217;s ACL Language &#8211; Part 2 Continuing from where I left off on the last ACL post. Part 1 stopped where the function was returning a value. More often than not, you will want to store the results returning from a function. You can return the results into a variable and later use that value. [...]]]></description>
			<content:encoded><![CDATA[<h2>Arbortext&#8217;s ACL Language &#8211; Part 2</h2>
<p>Continuing from where I left off on the last ACL post. <a href="http://structuredauthoring.org/?p=37">Part 1</a> stopped where the function was returning a value. More often than not, you will want to store the results returning from a function. You can return the results into a variable and later use that value.</p>
<p>To create a variable, it is a process of running the function, returning the results and placing it into the variable (or temporary storage). We are going to use the variable to display a response. Variables start with some kind of scope, in this example we are using <strong>Global</strong> creates the variable that can be used anywhere in the current package (the scripts workspace).  We use a dollar sign ($) to tell ACL to assign it to a name (our example, $user). To help ACL understand when a statement is complete, use the semicolon (;) at the end.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1">#&#8212; Variable name called $user</span><br />
global <span class="re0">$user</span>;<br />
<span class="co1">#&#8212; Placing the results of the function username() into the valuable $user</span><br />
<span class="re0">$user</span> = username<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="co1">#&#8212; Showing the results using the response function</span><br />
response<span class="br0">&#40;</span><span class="re0">$user</span><span class="br0">&#41;</span>;</div>
<p>Running this code, either as a snippet (small code part in a file) or copying and pasting each line into Arbortext&#8217;s command line, will produce a response to the user&#8217;s name.</p>
<h3>Comments</h3>
<p>In the last code example there was the use of # sign. Everything after the pound sign is a comment and will be ignored by ACL. It is for humans (not machines) to place comments on why the code was written. Keep in mind, what is fresh in you mind today may not be in six months from now. However, if someone follows after you, it will help them understand why you did what you did. It is not very important to comment on everything as much as commenting on complex areas.</p>
<p>You can stick comments on top (above example) or to the right of the code.</p>
<div class="dean_ch" style="white-space: wrap;">global <span class="re0">$user</span>; &nbsp;<span class="co1">#&#8212; Variable name called $user</span><br />
<span class="re0">$user</span> = username<span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="co1">#&#8212; Placing the results of the function username() into the valuable $user</span><br />
response<span class="br0">&#40;</span><span class="re0">$user</span><span class="br0">&#41;</span>; <span class="co1">#&#8212; Showing the results using the response function</span></div>
<h3>Blocks of Code</h3>
<p>A block is a section of code that is a cohesive unit. It is delimited with curly braces { }. You will see them where functions are lengthy, <code>if/else</code> branching, in <code>while </code>and <code>for </code>loops.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">if</span> <span class="br0">&#40;</span>tagname &nbsp;== <span class="st0">&quot;pgbrk&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; dt;<br />
&nbsp; &nbsp; response<span class="br0">&#40;</span><span class="st0">&quot;pgbrk tags are not allowed Use &lt;brk&gt;&quot;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
<h3>While Loop</h3>
<p>Below is an example of a function that removes comments inside an entire document. It uses a <code>while </code>loop and the <code>find </code>command.  The <code>while </code>loop will do something <em>while</em> it is true and will stop when that condition changes to false.</p>
<div class="dean_ch" style="white-space: wrap;">function removeComments<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1">#&#8212; Removes all the comments in an instance</span><br />
&nbsp; &nbsp; <span class="co1">#&#8212; Douglas Wade Created 5/17/4</span><br />
&nbsp; &nbsp; find -<a href="http://perldoc.perl.org/functions/m.html"><span class="kw3">m</span></a> <span class="st0">&#8216;&lt;_comment&gt;&#8217;</span>;<br />
&nbsp; &nbsp; message <span class="st0">&quot;Removing all comments&#8230;&quot;</span>;<br />
&nbsp; &nbsp; <span class="kw1">while</span><span class="br0">&#40;</span> selected<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; delete_mark;<br />
&nbsp; &nbsp; &nbsp; &nbsp; find -<a href="http://perldoc.perl.org/functions/m.html"><span class="kw3">m</span></a> <span class="st0">&#8216;&lt;_comment&gt;&#8217;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<h3>For Loop</h3>
<p>Below is an example of a <code>for </code>loop. The function task is to remove an element named <strong>change</strong>. It uses a <code>for </code>loop going over each element. If it is a <strong>change </strong>element, it deletes it.  If it&#8217;s not a change element, it skips it, and continues in the <code>loop </code>until all the elements have been reviewed. A <code>for </code>loop will do something until it reaches a limit (the number of oids (explained in a future article) <code>i&amp;lt;=count(oids)</code>). In this example, it uses a counter and on each pass increments the counter by one (<code>i++</code>).</p>
<div class="dean_ch" style="white-space: wrap;">function delete_change<span class="br0">&#40;</span>doc=current_doc<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; current_doc<span class="br0">&#40;</span>doc<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/local.html"><span class="kw3">local</span></a> oids<span class="br0">&#91;</span><span class="br0">&#93;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>oid_find_children<span class="br0">&#40;</span>oid_null<span class="br0">&#40;</span><span class="br0">&#41;</span>, oids, <span class="st0">&quot;change&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/local.html"><span class="kw3">local</span></a> i<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>i=<span class="nu0">1</span>; i&lt;=count<span class="br0">&#40;</span>oids<span class="br0">&#41;</span>; i++<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto_oid<span class="br0">&#40;</span>oids<span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>current_tag_name<span class="br0">&#40;</span><span class="br0">&#41;</span> == <span class="st0">&quot;change&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delete_tag<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
]]></content:encoded>
			<wfw:commentRss>http://structuredauthoring.org/arbortext-editor/arbortexts-acl-language-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Starting with Arbortext&#8217;s ACL Language &#8211; Part 1</title>
		<link>http://structuredauthoring.org/arbortext-editor/arbortexts-acl-language/</link>
		<comments>http://structuredauthoring.org/arbortext-editor/arbortexts-acl-language/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 22:32:34 +0000</pubDate>
		<dc:creator>douglaspaulwade</dc:creator>
				<category><![CDATA[ACL]]></category>
		<category><![CDATA[Arbortext Editor]]></category>

		<guid isPermaLink="false">http://structuredauthoring.org/?p=37</guid>
		<description><![CDATA[Arbortext&#8217;s ACL Language &#8211; Part 1 ACL language is the command line tool, similar to other tools, like Perl or C used inside the Arbortext Editor tools. It provides a way to control the editor or make changes to a document. It can control dialogs and interface to other software components. In the next couple [...]]]></description>
			<content:encoded><![CDATA[<h2>Arbortext&#8217;s ACL Language &#8211; Part 1</h2>
<p>ACL language is the command line tool, similar to other tools, like Perl or C used inside the Arbortext Editor tools. It provides a way to control the editor or make changes to a document. It can control dialogs and interface to other software components. In the next couple of articles, I will describe how to use <b>ACL</b> to accomplish some simple and some complex tasks. I will be giving examples as I go.</p>
<p>ACL, as a scripting language, has common constructs such as:</p>
<ul>
<li>variables and arrays</li>
<li>functions</li>
<li>works with files</li>
<li>modifies documents</li>
<li>callbacks and hooks to handle events</li>
</ul>
<h3>Syntax</h3>
<p>The syntax usually proceeds a <b>command</b> name followed by a argument(s). Blocks of commands can be added into functions. For example, the <b>help </b>command, by entering the word <b>help</b>, on the command line, will start the help file.</p>
<p><b>Note:</b> the command line needs to be displayed. If not visible, turn it on from the <b>File &gt; Tools &gt; Preferences</b> pick the <b>Category</b>, <b>&#8220;Window&#8221; </b>and make sure the <b>Command Line</b> item is checked.</p>
<h1><img class="alignnone size-full wp-image-26" title="Command Line Preference" src="http://structuredauthoring.org/wp-content/uploads/2009/04/tools-preferences-window-commandline.png" mce_src="http://structuredauthoring.org/wp-content/uploads/2009/04/tools-preferences-window-commandline.png" alt="Command Line Preference" height="408" width="440"></h1>
<h3>Commands</h3>
<p>From the Arbortext Command Line, type <b>help</b> and enter a return. This command will launch the help file.</p>
<h1><img class="alignnone size-full wp-image-27" title="command line entering a command" src="http://structuredauthoring.org/wp-content/uploads/2009/04/commandline-help.png" mce_src="http://structuredauthoring.org/wp-content/uploads/2009/04/commandline-help.png" alt="command line entering a command" height="85" width="326"></h1>
<h3>Functions</h3>
<p>Functions are more complex and allow for multiple&nbsp;commands or functions into a block of code. Functions often, but not always, return a value. The syntax is <b>functionname (argument, argument, &#8230;)</b>. A simple function <code>username()</code> can be run from the command line.</p>
<h1><img class="alignnone size-full wp-image-28" title="Function Usernane" src="http://structuredauthoring.org/wp-content/uploads/2009/04/commandline-usernane.png" mce_src="http://structuredauthoring.org/wp-content/uploads/2009/04/commandline-usernane.png" alt="Function Usernane" height="89" width="370"></h1>
<p>When&nbsp;you ran the function from the command line, you would notice that there wasn&#8217;t any output, pop-ups or results presented in the status area. However, it did not generate an error, so it completed your request. If you misspelled the function, it would generate an error response in the status area (see below).</p>
<h1><img class="alignnone size-full wp-image-29" title="Error on the command line" src="http://structuredauthoring.org/wp-content/uploads/2009/04/commandline-usernan.png" mce_src="http://structuredauthoring.org/wp-content/uploads/2009/04/commandline-usernan.png" alt="Error on the command line" height="86" width="397"></h1>
<p>To see results,&nbsp;we will add the <code>response()</code> function to get&nbsp;the result of the user&#8217;s name function. Since, <b>response()</b> is a function itself , the username() function will go inside the response() function or inside the parenthesize .</p>
<p><b>Tip:</b> Pressing the arrow up key selects a previous command from your command history; similarly, the arrow down key selects the next command.</p>
<h1><img class="alignnone size-full wp-image-30" title="Getting a response from a function" src="http://structuredauthoring.org/wp-content/uploads/2009/04/commandline-response-username.png" mce_src="http://structuredauthoring.org/wp-content/uploads/2009/04/commandline-response-username.png" alt="Getting a response from a function" height="84" width="358"></h1>
<p>The results generate a <b>Response</b> box (click OK to dismiss).</p>
<h1><img class="alignnone size-full wp-image-41" title="results from the function username" src="http://structuredauthoring.org/wp-content/uploads/2009/04/commandline-response-username-results1.png" mce_src="http://structuredauthoring.org/wp-content/uploads/2009/04/commandline-response-username-results1.png" alt="results from the function username" height="126" width="203"></h1>
]]></content:encoded>
			<wfw:commentRss>http://structuredauthoring.org/arbortext-editor/arbortexts-acl-language/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
