<?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>Webscriptz.be &#187; fpc</title>
	<atom:link href="http://webscriptz.be/tags/fpc/feed" rel="self" type="application/rss+xml" />
	<link>http://webscriptz.be</link>
	<description></description>
	<lastBuildDate>Thu, 13 Oct 2011 18:16:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>A freepascal clock</title>
		<link>http://webscriptz.be/2008/08/30/a-freepascal-clock/114</link>
		<comments>http://webscriptz.be/2008/08/30/a-freepascal-clock/114#comments</comments>
		<pubDate>Fri, 29 Aug 2008 22:47:43 +0000</pubDate>
		<dc:creator>webscriptz</dc:creator>
				<category><![CDATA[source code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fpc]]></category>
		<category><![CDATA[freepascal]]></category>

		<guid isPermaLink="false">http://webscriptz.be/?p=114</guid>
		<description><![CDATA[A basical console clock written in freepascal by me, even if it&#8217;s an old language, I have to practice on it for school. Here you got the code, I&#8217;ve added little comments but it isn&#8217;t a lot. hh = hour mm = minutes ss= seconds &#160;uses crt;&#160;var hh, mm, ss :integer;&#160;BEGINss:=0;mm:=0;hh:=0;&#160;writeln&#40;'Donne le heure: '&#41;;readln&#40;hh&#41;;writeln&#40;'donnez les [...]]]></description>
			<content:encoded><![CDATA[<p>A basical console clock written in freepascal by me, even if it&#8217;s an old language, I have to practice on it for school.</p>
<p>Here you got the code, I&#8217;ve added little comments but it isn&#8217;t a lot. hh = hour mm = minutes ss= seconds</p>
<p><span id="more-114"></span><br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="Pascal"><div class="devcodeoverflow"><ol><li></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">uses</span> crt;</li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">var</span> hh<span style="color: #339933;">,</span> mm<span style="color: #339933;">,</span> ss <span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">integer</span>;</li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">BEGIN</span></li><li>ss<span style="color: #339933;">:=</span><span style="color: #cc66cc;">0</span>;</li><li>mm<span style="color: #339933;">:=</span><span style="color: #cc66cc;">0</span>;</li><li>hh<span style="color: #339933;">:=</span><span style="color: #cc66cc;">0</span>;</li><li>&nbsp;</li><li><span style="color: #000066;">writeln</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Donne le heure: '</span><span style="color: #009900;">&#41;</span>;</li><li><span style="color: #000066;">readln</span><span style="color: #009900;">&#40;</span>hh<span style="color: #009900;">&#41;</span>;</li><li><span style="color: #000066;">writeln</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'donnez les minutes'</span><span style="color: #009900;">&#41;</span>;</li><li><span style="color: #000066;">readln</span><span style="color: #009900;">&#40;</span>mm<span style="color: #009900;">&#41;</span>;</li><li>clrscr;</li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">while</span> ss&amp;lt;<span style="color: #cc66cc;">60</span> <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #666666; font-style: italic;">//59 seconds because on 60 mm+1</span></li><li><span style="color: #000000; font-weight: bold;">begin</span></li><li>ss<span style="color: #339933;">:=</span> ss <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span>;&nbsp;&nbsp;<span style="color: #666666; font-style: italic;">//count the seconds</span></li><li>&nbsp;</li><li><span style="color: #000066;">writeln</span><span style="color: #009900;">&#40;</span>hh<span style="color: #339933;">,</span><span style="color: #ff0000;">' : '</span><span style="color: #339933;">,</span> mm<span style="color: #339933;">,</span><span style="color: #ff0000;">' : '</span><span style="color: #339933;">,</span> ss<span style="color: #009900;">&#41;</span>;</li><li>&nbsp;</li><li>delay<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>;</li><li>clrscr;</li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">if</span> ss<span style="color: #339933;">=</span><span style="color: #cc66cc;">59</span> <span style="color: #000000; font-weight: bold;">then</span>&nbsp;&nbsp;<span style="color: #666666; font-style: italic;">//if 59 then mm + 1</span></li><li><span style="color: #000000; font-weight: bold;">begin</span></li><li>mm<span style="color: #339933;">:=</span> mm <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span>;</li><li>ss<span style="color: #339933;">:=</span><span style="color: #cc66cc;">0</span>;</li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">if</span> mm<span style="color: #339933;">=</span><span style="color: #cc66cc;">59</span> <span style="color: #000000; font-weight: bold;">then</span>&nbsp;&nbsp;<span style="color: #666666; font-style: italic;">// 60 minutes but 59 minutes and 59 sec =&amp;gt; hh+1</span></li><li><span style="color: #000000; font-weight: bold;">begin</span></li><li>hh<span style="color: #339933;">:=</span>&nbsp;&nbsp;hh <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span>;</li><li>mm<span style="color: #339933;">:=</span><span style="color: #cc66cc;">0</span>;</li><li>ss<span style="color: #339933;">:=</span><span style="color: #cc66cc;">0</span>;</li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">if</span> hh<span style="color: #339933;">=</span><span style="color: #cc66cc;">23</span> <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #666666; font-style: italic;">//24 hr, i don't do days</span></li><li><span style="color: #000000; font-weight: bold;">begin</span></li><li>hh<span style="color: #339933;">:=</span><span style="color: #cc66cc;">0</span>;</li><li><span style="color: #000000; font-weight: bold;">end</span>;</li><li><span style="color: #000000; font-weight: bold;">end</span>;</li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">end</span>;</li><li><span style="color: #000000; font-weight: bold;">end</span></li><li><span style="color: #000000; font-weight: bold;">END</span>.</li></ol></div></pre><!--END_DEVFMTCODE--><br />
<ins datetime="2008-12-25T18:49:02+00:00"></ins></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://webscriptz.be/2008/08/30/a-freepascal-clock/114" target="_blank"><img src="http://webscriptz.be/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://webscriptz.be/2008/08/30/a-freepascal-clock/114" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://webscriptz.be/2008/08/30/a-freepascal-clock/114/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C &amp; FPC</title>
		<link>http://webscriptz.be/2008/08/29/c-fpc/108</link>
		<comments>http://webscriptz.be/2008/08/29/c-fpc/108#comments</comments>
		<pubDate>Fri, 29 Aug 2008 20:04:21 +0000</pubDate>
		<dc:creator>webscriptz</dc:creator>
				<category><![CDATA[source code]]></category>
		<category><![CDATA[Dev C]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fpc]]></category>

		<guid isPermaLink="false">http://webscriptz.be/?p=108</guid>
		<description><![CDATA[C programming and pascal, that&#8217;s what I&#8217;m doing for the moment, I have an exam in 5 days, man I hate it. Just finished a clock in C: you give the time for tomorrow and he&#8217;ll count it down. But it&#8217;s basic: #include#include&#160;int main&#40;int argc, char *argv&#91;&#93;&#41;&#123;long hh, mm,th, tm, ts;&#160;printf&#40;&#34;Reveil a quelle heure(24) minutes? [...]]]></description>
			<content:encoded><![CDATA[<p>C programming and pascal, that&#8217;s what I&#8217;m doing for the moment, I have an exam in 5 days, man I hate it.</p>
<p>Just finished a clock in C: you give the time for tomorrow and he&#8217;ll count it down. But it&#8217;s basic:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="PHP"><div class="devcodeoverflow"><ol><li></li><li><span style="color: #666666; font-style: italic;">#include</span></li><li><span style="color: #666666; font-style: italic;">#include</span></li><li>&nbsp;</li><li>int main<span style="color: #009900;">&#40;</span>int argc<span style="color: #339933;">,</span> char <span style="color: #339933;">*</span>argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li>long hh<span style="color: #339933;">,</span> mm<span style="color: #339933;">,</span>th<span style="color: #339933;">,</span> tm<span style="color: #339933;">,</span> ts<span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Reveil a quelle heure(24) minutes? <span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>scanf<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;%ld&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>hh<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>scanf<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;%ld&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>mm<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>th<span style="color: #339933;">=</span> hh<span style="color: #339933;">+</span><span style="color: #cc66cc;">24</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//ceci pr une journee</span></li><li>tm <span style="color: #339933;">=</span> <span style="color: #cc66cc;">60</span> <span style="color: #339933;">-</span> mm<span style="color: #339933;">;</span></li><li>ts<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></li><li><span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>th<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;=</span>hh<span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>ts<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>ts<span style="color: #339933;">-=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #990000;">sleep</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span></li><li><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>tm<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>ts<span style="color: #339933;">=</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span> tm<span style="color: #339933;">--;</span><span style="color: #009900;">&#125;</span></li><li><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>th<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span>hh<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>ts<span style="color: #339933;">=</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span> tm<span style="color: #339933;">=</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span> th<span style="color: #339933;">--;</span><span style="color: #009900;">&#125;</span></li><li><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>th<span style="color: #339933;">=</span>hh<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>ts<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>ts<span style="color: #339933;">--;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span></li><li><span style="color: #990000;">system</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;cls&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;%ld : %ld : %ld&quot;</span><span style="color: #339933;">,</span> th<span style="color: #339933;">,</span> tm<span style="color: #339933;">,</span> ts<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #990000;">system</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;PAUSE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #339933;">&lt;</span>span style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text-decoration: line-through;&quot;</span><span style="color: #339933;">&gt;</span>I<span style="color: #0000ff;">'m more or less pleased but still the infinite refreshments aren'</span>t what I wanted and sorry about the comment but in exercises I don<span style="color: #0000ff;">'t use them&lt;/span&gt;&lt;span id=&quot;more-108&quot;&gt;&lt;/span&gt;</span></li><li>&nbsp;</li><li><span style="color: #0000ff;">Here'</span>s the correction of the whole shebang<span style="color: #339933;">:</span></li><li>&nbsp;</li><li><span style="color: #339933;">&lt;</span>code lang<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;c&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #666666; font-style: italic;">#include</span></li><li><span style="color: #666666; font-style: italic;">#include </li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>int main(int argc, char *argv[])<br />
{<br />
long hh, mm,th, tm, ts;</p>
<p>printf(&#8220;Reveil a quelle heure(24) minutes? \t&#8221;);<br />
scanf(&#8220;%ld&#8221;, &amp;hh);<br />
scanf(&#8220;%ld&#8221;, &amp;mm);</p>
<p>th= hh+1; //ceci pr une journee<br />
tm = mm;<br />
ts=0;</p>
<p>while(th&gt;=hh)<br />
{<br />
if(th&gt;hh){<br />
if(ts&gt;0){ts-=1; sleep(1000);}<br />
else if(tm&gt;0){ts=60; tm&#8211;;}<br />
else if (th&gt;hh){ts=60; tm=60; th&#8211;;}<br />
}<br />
else if(th==hh){<br />
if(ts&gt;0){ts-=0; sleep(1000);}<br />
else if(tm&gt;mm){ts=60; tm&#8211;;}<br />
else {printf(&#8220;\n\n\n Reveille toi !!!!&#8221;); system(&#8220;PAUSE&#8221;); return 0;}<br />
}</p>
<p>system(&#8220;CLS&#8221;);</p>
<p>printf(&#8220;%ld : %ld : %ld&#8221;, th, tm, ts);</p>
<p>}</p>
<p>system(&#8220;PAUSE&#8221;);<br />
return 0;<br />
}</code></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://webscriptz.be/2008/08/29/c-fpc/108" target="_blank"><img src="http://webscriptz.be/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://webscriptz.be/2008/08/29/c-fpc/108" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://webscriptz.be/2008/08/29/c-fpc/108/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

