<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Craigmount Higher Computing &#187; Language Constructs</title>
	<atom:link href="http://craigmounthighercomputing.wordpress.com/category/language-constructs/feed/" rel="self" type="application/rss+xml" />
	<link>http://craigmounthighercomputing.wordpress.com</link>
	<description>Higher Computing 2007 - 2008 at Craigmount</description>
	<lastBuildDate>Thu, 10 Sep 2009 10:20:56 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='craigmounthighercomputing.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/7815c176806fa7b8f3232dcf33020e87?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Craigmount Higher Computing &#187; Language Constructs</title>
		<link>http://craigmounthighercomputing.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://craigmounthighercomputing.wordpress.com/osd.xml" title="Craigmount Higher Computing" />
		<item>
		<title>Confusion!</title>
		<link>http://craigmounthighercomputing.wordpress.com/2007/11/26/confusion/</link>
		<comments>http://craigmounthighercomputing.wordpress.com/2007/11/26/confusion/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 15:10:05 +0000</pubDate>
		<dc:creator>mrwhiteside</dc:creator>
				<category><![CDATA[Language Constructs]]></category>
		<category><![CDATA[parameter passing value reference functions]]></category>

		<guid isPermaLink="false">http://craigmounthighercomputing.wordpress.com/2007/11/26/confusion/</guid>
		<description><![CDATA[I think I have confused at least half the class with my explanation of parameter passing!  Or at least maybe not my explanation but certainly my attempted explanation of the NAB type question.
Let me try and simplify it again:
Call by value means a copy of a variable is used in a sub-routine.   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigmounthighercomputing.wordpress.com&blog=1775093&post=77&subd=craigmounthighercomputing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I think I have confused at least half the class with my explanation of parameter passing!  Or at least maybe not my explanation but certainly my attempted explanation of the NAB type question.</p>
<p>Let me try and simplify it again:</p>
<p>Call by value means <font color="#ff0000">a copy of a variable</font> is used in a sub-routine.    If it changes the variable, only the copy is changed, not the original.</p>
<p>Call by reference uses <font color="#000080">the original variable</font> (by referring to the address of the variable rather than a copy).  If it changes, then the original is changed also.</p>
<p>If you understand that then you are probably fine!  The NAB question was confusing as it lacked some important details.</p>
<p>The other thing we did to day was<font color="#ff0000"> functions.</font>   The important thing about them is that they produce a value.  For example <font color="#000080">random</font> produces a random number.</p>
<p><img src="///C:/DOCUME%7E1/9021560/LOCALS%7E1/Temp/moz-screenshot.jpg" /> <a href="http://craigmounthighercomputing.files.wordpress.com/2007/11/functinos.jpg" title="Direct link to file"><img src="http://craigmounthighercomputing.files.wordpress.com/2007/11/functinos.thumbnail.jpg?w=171&#038;h=42" alt="functinos.jpg" height="42" width="171" /></a></p>
<p>Here is the powerpoint on parameter passing:</p>
<p><a href="http://craigmounthighercomputing.files.wordpress.com/2007/11/parameter-passing.jpg" title="Direct link to file"><img src="http://craigmounthighercomputing.files.wordpress.com/2007/11/parameter-passing.thumbnail.jpg?w=170&#038;h=128" alt="parameter-passing.jpg" height="128" width="170" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/craigmounthighercomputing.wordpress.com/77/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/craigmounthighercomputing.wordpress.com/77/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/craigmounthighercomputing.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/craigmounthighercomputing.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/craigmounthighercomputing.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/craigmounthighercomputing.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/craigmounthighercomputing.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/craigmounthighercomputing.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/craigmounthighercomputing.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/craigmounthighercomputing.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/craigmounthighercomputing.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/craigmounthighercomputing.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigmounthighercomputing.wordpress.com&blog=1775093&post=77&subd=craigmounthighercomputing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://craigmounthighercomputing.wordpress.com/2007/11/26/confusion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/705dbd8ec4718c1d79c547158ad43982?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrwhiteside</media:title>
		</media:content>

		<media:content url="/DOCUME%7E1/9021560/LOCALS%7E1/Temp/moz-screenshot.jpg" medium="image" />

		<media:content url="http://craigmounthighercomputing.files.wordpress.com/2007/11/functinos.thumbnail.jpg" medium="image">
			<media:title type="html">functinos.jpg</media:title>
		</media:content>

		<media:content url="http://craigmounthighercomputing.files.wordpress.com/2007/11/parameter-passing.thumbnail.jpg" medium="image">
			<media:title type="html">parameter-passing.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Brazilians!</title>
		<link>http://craigmounthighercomputing.wordpress.com/2007/11/23/brazilians/</link>
		<comments>http://craigmounthighercomputing.wordpress.com/2007/11/23/brazilians/#comments</comments>
		<pubDate>Fri, 23 Nov 2007 10:01:53 +0000</pubDate>
		<dc:creator>mrwhiteside</dc:creator>
				<category><![CDATA[Language Constructs]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[functions brazil brazilian brazilians concatenate subst]]></category>

		<guid isPermaLink="false">http://craigmounthighercomputing.wordpress.com/2007/11/23/brazilians/</guid>
		<description><![CDATA[This was Mr Polland&#8217;s excellent program that I converted in to VB (and am still a bit too excited about).
It has an array of your names, an array of brazilian endings, and it concatenates a random ending onto a substring of your name.
The point of the lesson is to do with Functions.  The random [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigmounthighercomputing.wordpress.com&blog=1775093&post=75&subd=craigmounthighercomputing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This was Mr Polland&#8217;s excellent program that I converted in to VB (and am still a bit too excited about).</p>
<p>It has an array of your names, an array of brazilian endings, and it concatenates a random ending onto a substring of your name.</p>
<p>The point of the lesson is to do with Functions.  The random function is called with two parameters (low and high) andit then generates a random number between those two.  In the program I use that random number to pick a brazilian ending and put it onto your name.</p>
<p>Here is a screenshot:</p>
<p><img src="http://craigmounthighercomputing.files.wordpress.com/2007/11/brazilian-program.jpg" alt="brazilian-program.jpg" /></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/craigmounthighercomputing.wordpress.com/75/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/craigmounthighercomputing.wordpress.com/75/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/craigmounthighercomputing.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/craigmounthighercomputing.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/craigmounthighercomputing.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/craigmounthighercomputing.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/craigmounthighercomputing.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/craigmounthighercomputing.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/craigmounthighercomputing.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/craigmounthighercomputing.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/craigmounthighercomputing.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/craigmounthighercomputing.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigmounthighercomputing.wordpress.com&blog=1775093&post=75&subd=craigmounthighercomputing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://craigmounthighercomputing.wordpress.com/2007/11/23/brazilians/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/705dbd8ec4718c1d79c547158ad43982?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrwhiteside</media:title>
		</media:content>

		<media:content url="http://craigmounthighercomputing.files.wordpress.com/2007/11/brazilian-program.jpg" medium="image">
			<media:title type="html">brazilian-program.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Local and Global Variables</title>
		<link>http://craigmounthighercomputing.wordpress.com/2007/11/22/local-and-global-variables/</link>
		<comments>http://craigmounthighercomputing.wordpress.com/2007/11/22/local-and-global-variables/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 12:50:18 +0000</pubDate>
		<dc:creator>mrwhiteside</dc:creator>
				<category><![CDATA[Language Constructs]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[global local scope variables]]></category>

		<guid isPermaLink="false">http://craigmounthighercomputing.wordpress.com/2007/11/22/local-and-global-variables/</guid>
		<description><![CDATA[A local variable  is declared (set up) and only available for use in the sub-routine it is made in.  A global variable is declared at the start of your program (in VB anyway) and can be used anywhere.
It is easier to understand when you look at some code:
      [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigmounthighercomputing.wordpress.com&blog=1775093&post=73&subd=craigmounthighercomputing&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A <strong><font color="#000080">local variable</font></strong>  is declared (set up) and only available for use in the sub-routine it is made in.  A <font color="#ff0000"><strong>global variable</strong></font> is declared at the start of your program (in VB anyway) and can be used anywhere.</p>
<p>It is easier to understand when you look at some code:<br />
<strong><em><font color="#808080">        private sub get_marks</font></em></strong></p>
<blockquote><p><strong><em><font color="#808080">dim marks(10) as integer</font></em></strong></p>
<p><font color="#808080"><em><strong>for counter 1 to 10</strong></em></font></p>
<p><font color="#808080"><em><strong>marks(counter) = inputbox(&#8220;Type in your mark&#8221;)</strong></em></font></p>
<p><font color="#808080"><em><strong>next</strong></em></font></p>
<p><font color="#808080"><em><strong>end sub</strong></em></font></p></blockquote>
<p><font color="#000000">In the code above the array (<font color="#808080">marks</font>) is only available inside the sub-routine called get_marks.  If you try to access it somewhere else, it won&#8217;t work i.e. the <font color="#00ff00"><strong>scope</strong></font> of the variable (array) is <font color="#0000ff">local</font></font></p>
<p>If you set up the variable (or array) at the start of the program before any sub-routines (like we normally do) then it will be available for use everywhere i.e. the <font color="#00ff00"><strong>scope</strong></font> of the variable is <font color="#ff0000">global</font></p>
<p>Notes below:</p>
<p><a href="http://craigmounthighercomputing.files.wordpress.com/2007/11/local-global-variables.jpg" title="Direct link to file"><img src="http://craigmounthighercomputing.files.wordpress.com/2007/11/local-global-variables.thumbnail.jpg?w=170&#038;h=128" alt="local-global-variables.jpg" height="128" width="170" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/craigmounthighercomputing.wordpress.com/73/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/craigmounthighercomputing.wordpress.com/73/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/craigmounthighercomputing.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/craigmounthighercomputing.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/craigmounthighercomputing.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/craigmounthighercomputing.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/craigmounthighercomputing.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/craigmounthighercomputing.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/craigmounthighercomputing.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/craigmounthighercomputing.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/craigmounthighercomputing.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/craigmounthighercomputing.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigmounthighercomputing.wordpress.com&blog=1775093&post=73&subd=craigmounthighercomputing&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://craigmounthighercomputing.wordpress.com/2007/11/22/local-and-global-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/705dbd8ec4718c1d79c547158ad43982?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrwhiteside</media:title>
		</media:content>

		<media:content url="http://craigmounthighercomputing.files.wordpress.com/2007/11/local-global-variables.thumbnail.jpg" medium="image">
			<media:title type="html">local-global-variables.jpg</media:title>
		</media:content>
	</item>
	</channel>
</rss>