<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://macros.gibbscam.com/index.php?action=history&amp;feed=atom&amp;title=Global_Local</id>
	<title>Global Local - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://macros.gibbscam.com/index.php?action=history&amp;feed=atom&amp;title=Global_Local"/>
	<link rel="alternate" type="text/html" href="https://macros.gibbscam.com/index.php?title=Global_Local&amp;action=history"/>
	<updated>2026-12-05T10:11:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://macros.gibbscam.com/index.php?title=Global_Local&amp;diff=2926&amp;oldid=prev</id>
		<title>ConnerO at 15:25, 29 July 2010</title>
		<link rel="alternate" type="text/html" href="https://macros.gibbscam.com/index.php?title=Global_Local&amp;diff=2926&amp;oldid=prev"/>
		<updated>2010-07-29T15:25:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://macros.gibbscam.com/index.php?title=Global_Local&amp;amp;diff=2926&amp;amp;oldid=2873&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>ConnerO</name></author>
	</entry>
	<entry>
		<id>https://macros.gibbscam.com/index.php?title=Global_Local&amp;diff=2873&amp;oldid=prev</id>
		<title>ConnerO at 22:36, 28 July 2010</title>
		<link rel="alternate" type="text/html" href="https://macros.gibbscam.com/index.php?title=Global_Local&amp;diff=2873&amp;oldid=prev"/>
		<updated>2010-07-28T22:36:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:36, 28 July 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l30&quot;&gt;Line 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error writing file&amp;quot;, 1&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error writing file&amp;quot;, 1&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:call &quot;GlobalLocal_Sub.mac&quot;, i, result&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:call &quot;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;GlobalLocal_Sub.mac&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&quot;, i, result&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error writing file&amp;quot;, 1&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error writing file&amp;quot;, 1&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ConnerO</name></author>
	</entry>
	<entry>
		<id>https://macros.gibbscam.com/index.php?title=Global_Local&amp;diff=2871&amp;oldid=prev</id>
		<title>ConnerO at 22:34, 28 July 2010</title>
		<link rel="alternate" type="text/html" href="https://macros.gibbscam.com/index.php?title=Global_Local&amp;diff=2871&amp;oldid=prev"/>
		<updated>2010-07-28T22:34:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:34, 28 July 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l26&quot;&gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:a1$ = &amp;quot;Call Sub Macro, i = &amp;quot;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:a1$ = &amp;quot;Call Sub Macro, i = &amp;quot;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:a2$ = format$(i,&amp;quot;#0&amp;quot;)&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:a2$ = format$(i,&amp;quot;#0&amp;quot;)&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;   &lt;/del&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:file_write_text 1, a1$+a2$&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:file_write_text 1, a1$+a2$&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error writing file&amp;quot;, 1&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error writing file&amp;quot;, 1&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;   &lt;/del&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:call &amp;quot;GlobalLocal_Sub.mac&amp;quot;, i, result&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:call &amp;quot;GlobalLocal_Sub.mac&amp;quot;, i, result&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error writing file&amp;quot;, 1&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error writing file&amp;quot;, 1&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ConnerO</name></author>
	</entry>
	<entry>
		<id>https://macros.gibbscam.com/index.php?title=Global_Local&amp;diff=2870&amp;oldid=prev</id>
		<title>ConnerO: New page: ! show the use of local and global variables and&lt;br&gt; ! the passing of arguments to sub macros&lt;br&gt; &lt;br&gt; ! it also creates a file with the results and&lt;br&gt; ! then displays them when it has fi...</title>
		<link rel="alternate" type="text/html" href="https://macros.gibbscam.com/index.php?title=Global_Local&amp;diff=2870&amp;oldid=prev"/>
		<updated>2010-07-28T22:34:22Z</updated>

		<summary type="html">&lt;p&gt;New page: ! show the use of local and global variables and&amp;lt;br&amp;gt; ! the passing of arguments to sub macros&amp;lt;br&amp;gt; &amp;lt;br&amp;gt; ! it also creates a file with the results and&amp;lt;br&amp;gt; ! then displays them when it has fi...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;! show the use of local and global variables and&amp;lt;br&amp;gt;&lt;br /&gt;
! the passing of arguments to sub macros&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
! it also creates a file with the results and&amp;lt;br&amp;gt;&lt;br /&gt;
! then displays them when it has finished&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
a1$ = &amp;quot;This macro shows the use of local and global variables&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
a2$ = &amp;quot;and the passing of arguments to other macros&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
message &amp;quot;%a1$\n%a2$&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
global inum, iunit, a1$, a2$, a3$, a4$&amp;lt;br&amp;gt;&lt;br /&gt;
local  i, result&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
! open a file for the results&amp;lt;br&amp;gt;&lt;br /&gt;
! ---------------------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
errmac$ = &amp;quot;[[GlobalLocal_FileError.mac]]&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
file_open 1, &amp;quot;temp.txt&amp;quot;, write&amp;lt;br&amp;gt;&lt;br /&gt;
if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error opening file for read&amp;quot;, 0&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
inum = 4&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
for i = 2 to inum&amp;lt;br&amp;gt;&lt;br /&gt;
:a1$ = &amp;quot;Call Sub Macro, i = &amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:a2$ = format$(i,&amp;quot;#0&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
   &amp;lt;br&amp;gt;&lt;br /&gt;
:file_write_text 1, a1$+a2$&amp;lt;br&amp;gt;&lt;br /&gt;
:if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error writing file&amp;quot;, 1&amp;lt;br&amp;gt;&lt;br /&gt;
   &amp;lt;br&amp;gt;&lt;br /&gt;
:call &amp;quot;GlobalLocal_Sub.mac&amp;quot;, i, result&amp;lt;br&amp;gt;&lt;br /&gt;
:if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error writing file&amp;quot;, 1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
:a1$ = &amp;quot;Back in main Macro, i = &amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:a2$ = format$(i,&amp;quot;#0&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
:a3$ = &amp;quot;  result = &amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:a4$ = format$(result, &amp;quot;###0&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
:file_write_text 1, a1$+a2$+a3$+a4$&amp;lt;br&amp;gt;&lt;br /&gt;
:if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error writing file&amp;quot;, 1&amp;lt;br&amp;gt;&lt;br /&gt;
next i&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
file_close 1&amp;lt;br&amp;gt;&lt;br /&gt;
if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error closing file&amp;quot;, 0&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
file_is_open = 0&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
! reopen the file and read the contents&amp;lt;br&amp;gt;&lt;br /&gt;
! -------------------------------------&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
file_open 1, &amp;quot;temp.txt&amp;quot;, read&amp;lt;br&amp;gt;&lt;br /&gt;
if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error re-opening file&amp;quot;, 0&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
file_is_open = 1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
a1$ = &amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
inum = 0&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;read&amp;lt;br&amp;gt;&lt;br /&gt;
file_read_text 1, a2$&amp;lt;br&amp;gt;&lt;br /&gt;
if FileError &amp;lt;&amp;gt; 0 then goto close   ! end of file&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
a1$ = a1$+a2$+&amp;quot;\n&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
inum = inum + 1&amp;lt;br&amp;gt;&lt;br /&gt;
if inum &amp;lt; 20 then goto read   ! read a max of 20 lines&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;close&amp;lt;br&amp;gt;&lt;br /&gt;
file_close 1&amp;lt;br&amp;gt;&lt;br /&gt;
if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error closing file&amp;quot;, 0&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
file_is_open = 0&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
! delete the temp file&amp;lt;br&amp;gt;&lt;br /&gt;
! --------------------&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
file_delete &amp;quot;temp.txt&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
if FileError &amp;lt;&amp;gt; 0 then call errmac$, &amp;quot;Error deleting file&amp;quot;, 0&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
message a1$, &amp;quot;Results&amp;quot;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>ConnerO</name></author>
	</entry>
</feed>