<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://brwiki2.brulescorp.com/brwiki2/index.php?action=history&amp;feed=atom&amp;title=Local_variable</id>
	<title>Local variable - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://brwiki2.brulescorp.com/brwiki2/index.php?action=history&amp;feed=atom&amp;title=Local_variable"/>
	<link rel="alternate" type="text/html" href="https://brwiki2.brulescorp.com/brwiki2/index.php?title=Local_variable&amp;action=history"/>
	<updated>2026-04-30T11:13:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://brwiki2.brulescorp.com/brwiki2/index.php?title=Local_variable&amp;diff=10425&amp;oldid=prev</id>
		<title>Laura at 17:38, 29 June 2015</title>
		<link rel="alternate" type="text/html" href="https://brwiki2.brulescorp.com/brwiki2/index.php?title=Local_variable&amp;diff=10425&amp;oldid=prev"/>
		<updated>2015-06-29T17:38:09Z</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 17:38, 29 June 2015&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-l21&quot;&gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&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;Back in the program, X will contain the value of 8 or NewNum.&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;Back in the program, X will contain the value of 8 or NewNum.&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;br&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;br&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;[[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Variables&lt;/del&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;[[Category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Variable&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Laura</name></author>
	</entry>
	<entry>
		<id>https://brwiki2.brulescorp.com/brwiki2/index.php?title=Local_variable&amp;diff=10424&amp;oldid=prev</id>
		<title>Laura: Created page with &quot;In BR, all variables are global variables, even those used in User Defined Functions. In other words, if your program sets x=4, and your library function includes the line...&quot;</title>
		<link rel="alternate" type="text/html" href="https://brwiki2.brulescorp.com/brwiki2/index.php?title=Local_variable&amp;diff=10424&amp;oldid=prev"/>
		<updated>2015-06-29T17:37:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;In BR, all variables are global variables, even those used in &lt;a href=&quot;/brwiki2/index.php?title=User_Defined_Functions&quot; title=&quot;User Defined Functions&quot;&gt;User Defined Functions&lt;/a&gt;. In other words, if your program sets x=4, and your library function includes the line...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In BR, all variables are global variables, even those used in [[User Defined Functions]]. In other words, if your program sets x=4, and your library function includes the line x=7, then if your original program uses x again, it will use the value 7. &lt;br /&gt;
&lt;br /&gt;
However, there is a way to get around this: make X a optional parameter in your user defined function, and do not bring it in. &lt;br /&gt;
&lt;br /&gt;
Program contains:&lt;br /&gt;
 let X=4&lt;br /&gt;
&lt;br /&gt;
Library function definition includes X after the semi-colon:&lt;br /&gt;
 def fnModifyRec(FileNumber,SubscriptToRead,RecordNumber;X)&lt;br /&gt;
&lt;br /&gt;
Program calls the fnModifyRec function, without bringing in the variable X:&lt;br /&gt;
 fnModifyRec(PickFile,PickSub,PickRec)&lt;br /&gt;
&lt;br /&gt;
Back in the program, X is still 4.&lt;br /&gt;
&lt;br /&gt;
In contrast, the following call would make X work like a global variable and alter the value of X in the program, since it uses the optional variable:&lt;br /&gt;
 fnModifyRec(PickFile,PickSub,PickRec;8)&lt;br /&gt;
or&lt;br /&gt;
 fnModifyRec(PickFile,PickSub,PickRec;NewNum)&lt;br /&gt;
 &lt;br /&gt;
Back in the program, X will contain the value of 8 or NewNum.&lt;br /&gt;
&lt;br /&gt;
[[Category:Variables]]&lt;/div&gt;</summary>
		<author><name>Laura</name></author>
	</entry>
</feed>