<?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>Sat, 17 Apr 2010 12:45:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</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 program clock; uses crt; var hh, mm, ss :integer; BEGIN [...]]]></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></p>
<blockquote><p><code lang="pascal">program clock;</code></p>
<p>uses crt;</p>
<p>var hh, mm, ss :integer;</p>
<p>BEGIN<br />
ss:=0;<br />
mm:=0;<br />
hh:=0;</p>
<p>writeln(&#8216;Donne le heure: &#8216;);<br />
readln(hh);<br />
writeln(&#8216;donnez les minutes&#8217;);<br />
readln(mm);<br />
clrscr;</p>
<p>while ss&lt;60 do //59 seconds because on 60 mm+1<br />
begin<br />
ss:= ss + 1;  //count the seconds</p>
<p>writeln(hh,&#8217; : &#8216;, mm,&#8217; : &#8216;, ss);</p>
<p>delay(1);<br />
clrscr;</p>
<p>if ss=59 then  //if 59 then mm + 1<br />
begin<br />
mm:= mm + 1;<br />
ss:=0;</p>
<p>if mm=59 then  // 60 minutes but 59 minutes and 59 sec =&gt; hh+1<br />
begin<br />
hh:=  hh + 1;<br />
mm:=0;<br />
ss:=0;</p>
<p>if hh=23 then //24 hr, i don&#8217;t do days<br />
begin<br />
hh:=0;<br />
end;<br />
end;</p>
<p>end;<br />
end<br />
END.</p></blockquote>
<p><ins datetime="2008-12-25T18:49:02+00:00"></ins></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 int main(int argc, char *argv[]) { long hh, mm,th, tm, ts; [...]]]></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>
<blockquote><p><code lang="c">#include<br />
#include<br />
</code></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+24; //ceci pr une journee<br />
tm = 60 &#8211; mm;<br />
ts=0;<br />
while(th&gt;=hh)<br />
{<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 />
else if (th=hh){if(ts&gt;0){ts&#8211;;}}<br />
system(&#8220;cls&#8221;);<br />
printf(&#8220;%ld : %ld : %ld&#8221;, th, tm, ts);</p>
<p>}</p>
<p>system(&#8220;PAUSE&#8221;);<br />
return 0;<br />
}</p>
<p><span style="text-decoration: line-through;">I&#8217;m more or less pleased but still the infinite refreshments aren&#8217;t what I wanted and sorry about the comment but in exercises I don&#8217;t use them</span><span id="more-108"></span></p>
<p>Here&#8217;s the correction of the whole shebang:</p>
<p><code lang="c">#include<br />
#include </code></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 />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://webscriptz.be/2008/08/29/c-fpc/108/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
