<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: SQR Functions</title>
	<atom:link href="http://peoplesoftsqr.com/index.php/2009/10/sqr-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://peoplesoftsqr.com/index.php/2009/10/sqr-functions/</link>
	<description>When Peoplebooks Is Not Enough</description>
	<lastBuildDate>Mon, 16 Aug 2010 16:52:22 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: administrator</title>
		<link>http://peoplesoftsqr.com/index.php/2009/10/sqr-functions/comment-page-1/#comment-5949</link>
		<dc:creator>administrator</dc:creator>
		<pubDate>Tue, 06 Jul 2010 17:57:01 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=502#comment-5949</guid>
		<description>Great question!  Both examples will PERFORM the same way, executing the &quot;Do Print-Failure(1)&quot; command, but they get to that point quite differently.  Running an SQR program is usually a two step process.  First, the SQR interpreter (SQRW.EXE or PSSQR.EXE) reads the program and translates it into a form that is easier and faster to execute.  Second, the SQR interpreter executes that form.

Your second example, with the hash marks, indicate that the SQR interpreter should not translate all your code.  The translator evaluates the &quot;a=a&quot; expression and determines that it is true.  It translates the &quot;Do Print-Failure(1)&quot; command and ignores the &quot;Do Print-Failure(2)&quot; command.  The translation will be the same as if you had just coded &quot;Do Print-Failure(1).&quot;

Your first example translates all five lines of code.  When we get to the second stage of executing code, the SQR interpreter will evaluate the IF statement every time you pass through this code, perform the first branch, &quot;Do Print-Failure(1)&quot;, and skip over the rest of the translated code (&quot;Do Print-Failure(2)&quot;).

In the first example, the translation takes a little longer because it translates five lines instead of one, and the execution takes a little longer because it has to test the expression &quot;a=a&quot; and branch appropriately.

The &quot;#IF&quot; command is a directive to the code translator.  The &quot;IF&quot; command is a directive to the code executor.  As for usage:

- #IF can only evaluate simple expressions; complex expressions require IF.
- #IF is good if you have to choose between two blocks of code and SQR won&#039;t let you compile both.  For example, two different BEGIN-SELECT blocks that use the same aliases.
- #IF is good if you have a piece of code that is not a full, stand-alone command, and you might or might not want to use it.  For example: (1) part of a WHERE clause, (2) fields in a CREATE-ARRAY command.</description>
		<content:encoded><![CDATA[<p>Great question!  Both examples will PERFORM the same way, executing the &#8220;Do Print-Failure(1)&#8221; command, but they get to that point quite differently.  Running an SQR program is usually a two step process.  First, the SQR interpreter (SQRW.EXE or PSSQR.EXE) reads the program and translates it into a form that is easier and faster to execute.  Second, the SQR interpreter executes that form.</p>
<p>Your second example, with the hash marks, indicate that the SQR interpreter should not translate all your code.  The translator evaluates the &#8220;a=a&#8221; expression and determines that it is true.  It translates the &#8220;Do Print-Failure(1)&#8221; command and ignores the &#8220;Do Print-Failure(2)&#8221; command.  The translation will be the same as if you had just coded &#8220;Do Print-Failure(1).&#8221;</p>
<p>Your first example translates all five lines of code.  When we get to the second stage of executing code, the SQR interpreter will evaluate the IF statement every time you pass through this code, perform the first branch, &#8220;Do Print-Failure(1)&#8221;, and skip over the rest of the translated code (&#8221;Do Print-Failure(2)&#8221;).</p>
<p>In the first example, the translation takes a little longer because it translates five lines instead of one, and the execution takes a little longer because it has to test the expression &#8220;a=a&#8221; and branch appropriately.</p>
<p>The &#8220;#IF&#8221; command is a directive to the code translator.  The &#8220;IF&#8221; command is a directive to the code executor.  As for usage:</p>
<p>- #IF can only evaluate simple expressions; complex expressions require IF.<br />
- #IF is good if you have to choose between two blocks of code and SQR won&#8217;t let you compile both.  For example, two different BEGIN-SELECT blocks that use the same aliases.<br />
- #IF is good if you have a piece of code that is not a full, stand-alone command, and you might or might not want to use it.  For example: (1) part of a WHERE clause, (2) fields in a CREATE-ARRAY command.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Florian Böttcher</title>
		<link>http://peoplesoftsqr.com/index.php/2009/10/sqr-functions/comment-page-1/#comment-5948</link>
		<dc:creator>Florian Böttcher</dc:creator>
		<pubDate>Tue, 06 Jul 2010 08:10:44 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=502#comment-5948</guid>
		<description>I have a Problem understanding an existing SQR-Code, I would be very glad if you could help me:

Where is the difference between:

If a=a
    Do Print-Failure(1)
ELSE
    Do Print-Failure(2)       
END-IF

...and an IF with a hashmark, like the following:

#IF a=a
    Do Print-Failure(1)
#ELSE
    Do Print-Failure(2)
#END-IF

...its only a small example of me problem.
Please tell me whats the difference and in which cases you use a hashmark...

Please make me happy ;)</description>
		<content:encoded><![CDATA[<p>I have a Problem understanding an existing SQR-Code, I would be very glad if you could help me:</p>
<p>Where is the difference between:</p>
<p>If a=a<br />
    Do Print-Failure(1)<br />
ELSE<br />
    Do Print-Failure(2)<br />
END-IF</p>
<p>&#8230;and an IF with a hashmark, like the following:</p>
<p>#IF a=a<br />
    Do Print-Failure(1)<br />
#ELSE<br />
    Do Print-Failure(2)<br />
#END-IF</p>
<p>&#8230;its only a small example of me problem.<br />
Please tell me whats the difference and in which cases you use a hashmark&#8230;</p>
<p>Please make me happy <img src='http://peoplesoftsqr.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: administrator</title>
		<link>http://peoplesoftsqr.com/index.php/2009/10/sqr-functions/comment-page-1/#comment-5163</link>
		<dc:creator>administrator</dc:creator>
		<pubDate>Tue, 13 Oct 2009 16:51:48 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=502#comment-5163</guid>
		<description>It&#039;s the same in SQR.  My description of floor was correct and my description of trunc was correct, but my statement that floor was a special case of trunc was wrong for negative numbers.  Thanks for the correction.</description>
		<content:encoded><![CDATA[<p>It&#8217;s the same in SQR.  My description of floor was correct and my description of trunc was correct, but my statement that floor was a special case of trunc was wrong for negative numbers.  Thanks for the correction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Josephson</title>
		<link>http://peoplesoftsqr.com/index.php/2009/10/sqr-functions/comment-page-1/#comment-5157</link>
		<dc:creator>Bob Josephson</dc:creator>
		<pubDate>Tue, 13 Oct 2009 11:48:18 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=502#comment-5157</guid>
		<description>I don&#039;t know about SQR, but in C, floor is different from trunc (or C&#039;s equivalent of trunc). floor(-1.5) returns -2, whereas trunc(-1.5) returns -1.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know about SQR, but in C, floor is different from trunc (or C&#8217;s equivalent of trunc). floor(-1.5) returns -2, whereas trunc(-1.5) returns -1.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
