<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2510980799611716564</id><updated>2011-12-15T12:50:15.418-08:00</updated><title type='text'>Tutorial Blog</title><subtitle type='html'>By following the tutorial on this blog from the first tutorial to the newest one, you'll be able to develop and maintain your own database (using interbase or any database server). And you'll be able to create your own user interface as well (using delphi)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>66</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-7959875828968914450</id><published>2010-08-03T20:16:00.000-07:00</published><updated>2010-08-03T20:32:27.076-07:00</updated><title type='text'>Function and Procedure</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;There are two kind of subroutine in Pascal : &lt;b style="mso-bidi-font-weight:normal"&gt;Function&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;Procedure&lt;/b&gt;. The difference between these subroutines is in &lt;b style="mso-bidi-font-weight:normal"&gt;return value&lt;/b&gt;. Function &lt;b style="mso-bidi-font-weight:normal"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;gives a return value&lt;/i&gt;&lt;/b&gt;, but procedure doesn’t. The structure of function and procedure are the same :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/TFjcSrmvNcI/AAAAAAAAANA/vEro6viDFDw/s1600/Structure+of+Function+%26+Procedure.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 214px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/TFjcSrmvNcI/AAAAAAAAANA/vEro6viDFDw/s320/Structure+of+Function+%26+Procedure.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5501389158334019010" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Here is the &lt;a href="http://www.ziddu.com/download/11064295/FunctionAndProcedure.rar.html"&gt;example&lt;/a&gt; of procedure and function :&lt;/p&gt;program FunctionAndProcedure;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;procedure Add1(x, y : integer);&lt;br /&gt; var&lt;br /&gt;  z : integer;&lt;br /&gt;begin&lt;br /&gt;  z := x + y;&lt;br /&gt;  writeln(x,' + ',y,' = ',z,' (using procedure)');&lt;br /&gt;  readln;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;function Add2(x, y : integer) : integer;&lt;br /&gt;begin&lt;br /&gt;  Add2 := x + y;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;  Add1(25,10);&lt;br /&gt;  writeln('25 + 40 = ',Add2(25,40),' (using function)');&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can &lt;a href="http://www.ziddu.com/download/11064295/FunctionAndProcedure.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-7959875828968914450?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/7959875828968914450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/08/function-and-procedure.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7959875828968914450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7959875828968914450'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/08/function-and-procedure.html' title='Function and Procedure'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_kLg3mPfGL6E/TFjcSrmvNcI/AAAAAAAAANA/vEro6viDFDw/s72-c/Structure+of+Function+%26+Procedure.jpg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-5345257135187549915</id><published>2010-07-27T20:54:00.000-07:00</published><updated>2010-07-27T21:11:19.385-07:00</updated><title type='text'>The Complete Electronic Circuit</title><content type='html'>&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;(Dancing Lamp #3)&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;In my &lt;a href="http://123codegenerator.blogspot.com/2010/07/led-circuit.html"&gt;previous tutorial&lt;/a&gt;, I’ve given you &lt;a href="http://www.ziddu.com/download/10905607/DancingLampusingLED.rar.html"&gt;the example program&lt;/a&gt; and the LED circuit. But what you’ve got is only a small electronic circuit on your table. How about if you want to use bigger light bulbs instead of using LED. Here is the complete electronic circuit : &lt;/p&gt;  &lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/TE-quD9GdwI/AAAAAAAAAM4/Tx2LIjYoof4/s1600/The+Circuit.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 182px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/TE-quD9GdwI/AAAAAAAAAM4/Tx2LIjYoof4/s320/The+Circuit.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5498801378354951938" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You have to connect parallel port ground pin out to the circuit ground. Just be careful while connecting this circuit to your computer, or &lt;b style="mso-bidi-font-weight:normal"&gt;it will damage your computer !!!&lt;/b&gt; Make sure that everything is in the place.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Using this circuit, if you send a “high” to the data pin out (D0 .. D7), it will trigger the transistor. It will be saturated, and let current flows through the relay and the light bulb will be connected to the electricity and light on. Use this circuit for each data pin out of your parallel port.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Previous tutorials about dancing lamp :&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a href="http://123codegenerator.blogspot.com/2010/07/accessing-your-pcs-parallel-port-using.html"&gt;Accessing your PC’s parallel port using Inpout32.dll in Delphi&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a href="http://123codegenerator.blogspot.com/2010/07/led-circuit.html"&gt;LED Circuit&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-5345257135187549915?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/5345257135187549915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/07/complete-electronic-circuit.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/5345257135187549915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/5345257135187549915'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/07/complete-electronic-circuit.html' title='The Complete Electronic Circuit'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_kLg3mPfGL6E/TE-quD9GdwI/AAAAAAAAAM4/Tx2LIjYoof4/s72-c/The+Circuit.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-708378783594807654</id><published>2010-07-26T19:00:00.000-07:00</published><updated>2010-07-27T21:13:10.236-07:00</updated><title type='text'>LED Circuit</title><content type='html'>&lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;(Dancing Lamp # 2)&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/TE5NkkU2VaI/AAAAAAAAAMw/ECOu1oGxHDU/s1600/Dancing+Using+LED.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 152px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/TE5NkkU2VaI/AAAAAAAAAMw/ECOu1oGxHDU/s320/Dancing+Using+LED.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5498417485687707042" /&gt;&lt;/a&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To test the program I’ve created in my &lt;a href="http://123codegenerator.blogspot.com/2010/07/accessing-your-pcs-parallel-port-using.html"&gt;previous tutorial&lt;/a&gt;, I use this circuit (see picture). But be careful while you connect this circuit to your parallel port. Make sure that every component is in the right place or connection, otherwise &lt;b style="mso-bidi-font-weight: normal"&gt;it will damage your PC !!!&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/TE4-aOLk5NI/AAAAAAAAAMo/6beF-ZSIlJg/s1600/LED+Circuit.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 122px; height: 320px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/TE4-aOLk5NI/AAAAAAAAAMo/6beF-ZSIlJg/s320/LED+Circuit.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5498400815270126802" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;I use 1 KOhm resistors. If you send an integer data = 15 to the parallel port, D0…D3 LED will be light on. And D4…D7 LED will be off. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can arrange which LED is &lt;b style="mso-bidi-font-weight:normal"&gt;on&lt;/b&gt; or &lt;b style="mso-bidi-font-weight: normal"&gt;off&lt;/b&gt; by writing some codes in &lt;st1:place&gt;Delphi&lt;/st1:place&gt;. And you can also set the delay of each step you turn &lt;b style="mso-bidi-font-weight: normal"&gt;on&lt;/b&gt; or &lt;b style="mso-bidi-font-weight:normal"&gt;off&lt;/b&gt; the LED using &lt;i style="mso-bidi-font-style:normal"&gt;OnTimer&lt;/i&gt; event of &lt;b style="mso-bidi-font-weight: normal"&gt;Timer component&lt;/b&gt; in &lt;st1:place&gt;Delphi&lt;/st1:place&gt;. I’ve created an &lt;a href="http://www.ziddu.com/download/10905607/DancingLampusingLED.rar.html"&gt;example program&lt;/a&gt; for you.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal"&gt;&lt;a href="http://www.ziddu.com/download/10905607/DancingLampusingLED.rar.html"&gt;Download the example program here&lt;/a&gt;.&lt;/p&gt;&lt;p class="MsoNormal"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/07/accessing-your-pcs-parallel-port-using.html"&gt;previous tutorial&lt;/a&gt; (Accessing your PC’s parallel port using Inpout32.dll in Delphi)&lt;/p&gt;&lt;p class="MsoNormal"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/07/complete-electronic-circuit.html"&gt;next tutorial&lt;/a&gt; (The Complete Electronic Circuit)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-708378783594807654?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/708378783594807654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/07/led-circuit.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/708378783594807654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/708378783594807654'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/07/led-circuit.html' title='LED Circuit'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_kLg3mPfGL6E/TE5NkkU2VaI/AAAAAAAAAMw/ECOu1oGxHDU/s72-c/Dancing+Using+LED.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-4136318670124111246</id><published>2010-07-19T21:01:00.000-07:00</published><updated>2010-07-26T20:16:19.769-07:00</updated><title type='text'>Accessing your PC’s parallel port using Inpout32.dll in Delphi</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;strong&gt;(Dancing Lamp # 1)&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Before we create a dancing lamp using our PC’s parallel port, we have to know the parallel port female pin-out (see the picture below).&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/TE4tEhewvsI/AAAAAAAAAMg/LYGyYS1FgwI/s1600/Parallel+Port+female+pin-out.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 229px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/TE4tEhewvsI/AAAAAAAAAMg/LYGyYS1FgwI/s320/Parallel+Port+female+pin-out.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5498381750796074690" /&gt;&lt;/a&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;D0 is the &lt;strong&gt;LSB (Least Significant Bit)&lt;/strong&gt; and D7 is the &lt;strong&gt;Most Significant Bit (MSB)&lt;/strong&gt;. You can send an integer type data to the &lt;strong&gt;D0..D7 pin-outs&lt;/strong&gt;. And the output will be the binary form of the integer we send. For example : If we send an integer data 15 the output will be :&lt;/p&gt;&lt;table border="1" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="CENTER"&gt;&lt;b&gt;D7&lt;/b&gt;&lt;/td&gt;&lt;td align="CENTER"&gt;&lt;b&gt;D6&lt;/b&gt;&lt;/td&gt;&lt;td align="CENTER"&gt;&lt;b&gt;D5&lt;/b&gt;&lt;/td&gt;&lt;td align="CENTER"&gt;&lt;b&gt;D4&lt;/b&gt;&lt;/td&gt;&lt;td align="CENTER"&gt;&lt;b&gt;D3&lt;/b&gt;&lt;/td&gt;&lt;td align="CENTER"&gt;&lt;b&gt;D2&lt;/b&gt;&lt;/td&gt;&lt;td align="CENTER"&gt;&lt;b&gt;D1&lt;/b&gt;&lt;/td&gt;&lt;td align="CENTER"&gt;&lt;b&gt;D0&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;LOW&lt;/td&gt;&lt;td&gt;LOW&lt;/td&gt;&lt;td&gt;LOW&lt;/td&gt;&lt;td&gt;LOW&lt;/td&gt;&lt;td&gt;HIGH&lt;/td&gt;&lt;td&gt;HIGH&lt;/td&gt;&lt;td&gt;HIGH&lt;/td&gt;&lt;td&gt;HIGH&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;15 (byte) = 00001111 (binary)&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;How To Send Data To The &lt;st1:place&gt;&lt;st1:placename&gt;Parallel&lt;/st1:placename&gt;  &lt;st1:placetype&gt;Port&lt;/st1:placetype&gt;&lt;/st1:place&gt; ?&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To send data to the parallel port I use a DLL file (&lt;strong&gt;&lt;em&gt;&lt;a href="http://logix4u.net/Legacy_Ports/Parallel_Port/Inpout32.dll_for_Windows_98/2000/NT/XP.html"&gt;Inpout32.dll&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;) that can be downloaded at &lt;a href="http://logix4u.net/Legacy_Ports/Parallel_Port/Inpout32.dll_for_Windows_98/2000/NT/XP.html"&gt;logix4u.net&lt;/a&gt;, and it’s free for non-commercial manner. Place this file in C:\WINDOWS\system or in the same folder with you project you’re going to create. &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To use this file you can see my &lt;a href="http://123codegenerator.blogspot.com/2010/05/using-dll-file-in-delphi.html"&gt;previous tutorial&lt;/a&gt; about &lt;a href="http://123codegenerator.blogspot.com/2010/05/using-dll-file-in-delphi.html"&gt;using a DLL file&lt;/a&gt;. This DLL file contains a function called &lt;strong&gt;Out32()&lt;/strong&gt;. The syntax of this function :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify" align="left"&gt;&lt;strong&gt;                                                    Out32(portaddress,data);&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify" align="left"&gt;Usually, the port address is &lt;strong&gt;$378&lt;/strong&gt; (you can check the BIOS setting of your PC) &lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example program :&lt;/strong&gt;&lt;/p&gt;unit Unit1;&lt;br /&gt;&lt;br /&gt;interface&lt;br /&gt;&lt;br /&gt;uses&lt;br /&gt;   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,&lt;br /&gt;   StdCtrls;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;   TForm1 = class(TForm)&lt;br /&gt;     Edit1: TEdit;&lt;br /&gt;     Label1: TLabel;&lt;br /&gt;     Button1: TButton;&lt;br /&gt;     procedure FormActivate(Sender: TObject);&lt;br /&gt;     procedure Button1Click(Sender: TObject);&lt;br /&gt;private&lt;br /&gt;&lt;em&gt;  { Private declarations }&lt;/em&gt;&lt;br /&gt;public&lt;br /&gt;&lt;em&gt;  { Public declarations }&lt;/em&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;   Form1: TForm1;&lt;br /&gt;&lt;br /&gt;implementation&lt;br /&gt;&lt;br /&gt;&lt;em&gt;{$R *.DFM}&lt;/em&gt;&lt;br /&gt;function Out32(wAddr:word;bOut:byte):byte; stdcall; external 'inpout32.dll';&lt;br /&gt;&lt;br /&gt;procedure TForm1.FormActivate(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt;  Edit1.Text := '';&lt;br /&gt;  Edit1.SetFocus; &lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt;  Out32($378,StrToInt(Edit1.Text));&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;end.&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can &lt;a href="http://www.ziddu.com/download/10790761/Sendingdatatoparallelport.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/07/led-circuit.html"&gt;next tutorial&lt;/a&gt; (LED Circuit)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-4136318670124111246?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/4136318670124111246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/07/accessing-your-pcs-parallel-port-using.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4136318670124111246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4136318670124111246'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/07/accessing-your-pcs-parallel-port-using.html' title='Accessing your PC’s parallel port using Inpout32.dll in Delphi'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/TE4tEhewvsI/AAAAAAAAAMg/LYGyYS1FgwI/s72-c/Parallel+Port+female+pin-out.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-1176169644963687301</id><published>2010-07-07T23:10:00.000-07:00</published><updated>2010-07-07T23:25:37.184-07:00</updated><title type='text'>Pointer</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;Pointer is a variable that points toward a memory address. So a pointer is a data address. The data is somewhere else. Below picture will show you the relationship between a pointer and a data pointed by a pointer.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/TDVsv3T4MrI/AAAAAAAAAMI/aVcyXxHaw3I/s1600/pointer.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 148px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/TDVsv3T4MrI/AAAAAAAAAMI/aVcyXxHaw3I/s320/pointer.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5491414890205164210" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To declare a pointer, use the below statement :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Type&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;PointerType : ^Type;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;In this case, &lt;b style="mso-bidi-font-weight:normal"&gt;&lt;i style="mso-bidi-font-style:normal"&gt;type &lt;/i&gt;&lt;/b&gt;can be an integer, a real, an array or record. And you can see the example code of using a pointer :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;program Project1;&lt;br /&gt;&lt;em&gt;   {$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;   PointerType = ^integer;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;   MyPointer : PointerType;&lt;br /&gt;   Data : integer;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;  Data := 100;&lt;br /&gt;  MyPointer := @Data;&lt;br /&gt;  writeln('Data pointed toward by the pointer is ', MyPointer^);&lt;br /&gt;  Data := 123;&lt;br /&gt;  writeln('Data pointed toward by the pointer is ', MyPointer^);&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Disposing pointer allocation&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To free the memory that is used by a pointer, you can use &lt;b style="mso-bidi-font-weight:normal"&gt;dispose&lt;/b&gt; statement.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Dispose(pointer);&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Example :&lt;/p&gt;program Project1;&lt;br /&gt;   &lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;   MyPointer : ^integer;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;  New(MyPointer); &lt;em&gt;// allocate memory&lt;/em&gt;&lt;br /&gt;  MyPointer^ := 100;&lt;br /&gt;  writeln('Vallue pointed toward by MyPointer is ',MyPointer^);&lt;br /&gt;  Dispose(MyPointer); &lt;em&gt;// free memory allocation&lt;/em&gt;&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;You can &lt;a href="http://www.ziddu.com/download/10614143/pointer.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-1176169644963687301?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/1176169644963687301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/07/pointer.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1176169644963687301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1176169644963687301'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/07/pointer.html' title='Pointer'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/TDVsv3T4MrI/AAAAAAAAAMI/aVcyXxHaw3I/s72-c/pointer.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-223511842526833266</id><published>2010-06-20T20:05:00.000-07:00</published><updated>2010-06-20T20:20:27.898-07:00</updated><title type='text'>Record’s variant</title><content type='html'>&lt;p class="MsoNormal" align="justify"&gt;A record can have one or more variant elements or fields. This variant allows data to accessed using one or more different fields. To declare a record contain variant use these statements :&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Type&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;RecordTypeName = &lt;b style="mso-bidi-font-weight:normal"&gt;record&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;Field_1 : type_1;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;..&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;..&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;Field_n : type_n;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Case&lt;/b&gt; Tag : OrdinalType &lt;b style="mso-bidi-font-weight:normal"&gt;of&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;         &lt;/span&gt;Constant_1 : ( variant_1);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;         &lt;/span&gt;Constant_2 : ( variant_2);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;  End&lt;/b&gt;;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Example record contain variant :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Type &lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;TCategory = (FullTimer, PartTimer);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;TEmployeeRecord : &lt;b style="mso-bidi-font-weight:normal"&gt;record&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;Name : String(30);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Case&lt;/b&gt; Category : TCategory &lt;b style="mso-bidi-font-weight:normal"&gt;of&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;       &lt;/span&gt;Full Time : ( Salary : currency;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;                              &lt;/span&gt;Bonus : currency);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;       &lt;/span&gt;Part Time : (&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Salary : currency);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;  End&lt;/b&gt;;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example program :&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;program Project1;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;   TCategory = ( FullTimer, PartTimer );&lt;br /&gt;   TEmployeeRecord = record&lt;br /&gt;       Name : String[30];&lt;br /&gt;       Case Category : TCategory of&lt;br /&gt;           FullTimer : ( Salary : currency;&lt;br /&gt;                                                 Bonus : currency);&lt;br /&gt;           PartTimer : ( Payment : currency);&lt;br /&gt;   end;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;   Employee : TEmployeeRecord;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;  with Employee do&lt;br /&gt;    begin&lt;br /&gt;&lt;em&gt;     // assigning fields' values&lt;/em&gt;&lt;br /&gt;      Name := 'Albert Einstein';&lt;br /&gt;      Category := FullTimer;&lt;br /&gt;      Salary := 1000;&lt;br /&gt;      Bonus := 100;&lt;br /&gt;&lt;em&gt;     // writing fields' values&lt;/em&gt;&lt;br /&gt;      writeln('Name : ',Name);&lt;br /&gt;      writeln('Salary : ',Salary:10:2);&lt;br /&gt;      writeln('Bonus : ',Bonus:10:2);&lt;br /&gt;&lt;em&gt;     // assigning fields' values&lt;/em&gt;&lt;br /&gt;      Name := 'Albert Einstein';&lt;br /&gt;      Category := PartTimer;&lt;br /&gt;      Payment := 500;&lt;br /&gt;&lt;em&gt;     // writing fields' values&lt;/em&gt;&lt;br /&gt;      writeln('Name : ',Name);&lt;br /&gt;      writeln('Payment : ',Payment:10:2);&lt;br /&gt;    end;&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-size:100%;"&gt;You can &lt;a href="http://www.ziddu.com/download/10375701/RecordVariant.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-223511842526833266?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/223511842526833266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/06/records-variant.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/223511842526833266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/223511842526833266'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/06/records-variant.html' title='Record’s variant'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-4239486298308236858</id><published>2010-06-11T17:15:00.000-07:00</published><updated>2010-06-11T17:39:23.223-07:00</updated><title type='text'>Accessing Record’s Elements</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;After we declare a record ( previous tutorial ), now we are going to access the elements or fields of the record. The fields in a record can be accessed using this notation :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;i style="mso-bidi-font-style:normal"&gt;    &lt;strong&gt;RecordName.RecordField&lt;/strong&gt;&lt;/i&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Between the field name and the record name separated by a &lt;b style="mso-bidi-font-weight:normal"&gt;dot&lt;/b&gt;.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example :&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;program Project1;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;    TRecordItem = record&lt;br /&gt;        Item : string;&lt;br /&gt;        Quantity : integer;&lt;br /&gt;        Price : currency;&lt;br /&gt;    end;&lt;br /&gt;var&lt;br /&gt;    ItemStock : TRecordItem;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;em&gt;  // assigning values to record's fields&lt;/em&gt;&lt;br /&gt;  ItemStock.Item := 'USB Flash Disk';&lt;br /&gt;  ItemStock.Quantity := 20;&lt;br /&gt;  ItemStock.Price := 10;&lt;br /&gt;&lt;em&gt;  // writing teh fields' values.&lt;/em&gt;&lt;br /&gt;  writeln('Item : ',ItemStock.Item);&lt;br /&gt;  writeln('Quantity : ',ItemStock.Quantity,' pc/s');&lt;br /&gt;  writeln('Price : $ ',ItemStock.Price:10:2 );&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Using with statement&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;With statement allows us to access a record field without mentioning the record name. The syntax of with statement is :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt; with Record do&lt;br /&gt;   begin&lt;br /&gt;      statements&lt;br /&gt;   end;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;    TRecordItem = record&lt;br /&gt;        Item : string;&lt;br /&gt;        Quantity : integer;&lt;br /&gt;        Price : currency;&lt;br /&gt;    end;&lt;br /&gt;var&lt;br /&gt; ItemStock : TRecordItem;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;  with ItemStock do&lt;br /&gt;    begin&lt;br /&gt; &lt;em&gt;      // assigning values to record's fields&lt;/em&gt;&lt;br /&gt;       Item := 'USB Flash Disk';&lt;br /&gt;       Quantity := 20;&lt;br /&gt;       Price := 10;&lt;br /&gt; &lt;em&gt;      // writing teh fields' values.&lt;/em&gt;&lt;br /&gt;       writeln('Item : ',Item);&lt;br /&gt;       writeln('Quantity : ',Quantity,' pc/s');&lt;br /&gt;       writeln('Price : $ ',Price:10:2 );&lt;br /&gt;    end;&lt;br /&gt;   readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can &lt;a href="http://www.ziddu.com/download/10251174/accessingrecordfields.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-4239486298308236858?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/4239486298308236858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/06/accessing-records-elements.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4239486298308236858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4239486298308236858'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/06/accessing-records-elements.html' title='Accessing Record’s Elements'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-1431632326424721728</id><published>2010-06-09T17:30:00.000-07:00</published><updated>2010-06-11T17:09:51.791-07:00</updated><title type='text'>Record</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;Record is a structured data type. It contains some elements or fields, and each field can have a different data type. See the picture below.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/TBAyaLAvGPI/AAAAAAAAAMA/nxDtm-Eypuc/s1600/record.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 117px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/TBAyaLAvGPI/AAAAAAAAAMA/nxDtm-Eypuc/s320/record.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5480936171723757810" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;How to declare a record ?&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You have to declare a record after &lt;b style="mso-bidi-font-weight:normal"&gt;type&lt;/b&gt; clause. &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;type&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;RecordTypeName = record&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;       &lt;/span&gt;Field_1 : DataType;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;       &lt;/span&gt;.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;       &lt;/span&gt;.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;       &lt;/span&gt;Field_n : DataType;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;End;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;var&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;RecordName : RecordTypeName;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;For example, we declare a record named ItemStock that has three fields ( Item, Quantity and Price ).&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;type&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;TRecordItem = record&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;Item : &lt;b style="mso-bidi-font-weight: normal"&gt;string&lt;/b&gt;;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;Quantity : integer;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;Price : currency;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;var&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;ItemStock : TRecordItem;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;First, define a &lt;b style="mso-bidi-font-weight:normal"&gt;TRecordItem&lt;/b&gt; then use it to declare a variable named &lt;b style="mso-bidi-font-weight:normal"&gt;ItemStock&lt;/b&gt;. So the &lt;b style="mso-bidi-font-weight:normal"&gt;ItemStock&lt;/b&gt; variable has three fields : &lt;b style="mso-bidi-font-weight:normal"&gt;Item&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal"&gt;Quantity&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;Price.&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-1431632326424721728?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/1431632326424721728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/06/record.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1431632326424721728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1431632326424721728'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/06/record.html' title='Record'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/TBAyaLAvGPI/AAAAAAAAAMA/nxDtm-Eypuc/s72-c/record.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-2819182085089133714</id><published>2010-05-31T17:58:00.000-07:00</published><updated>2010-05-31T18:19:27.516-07:00</updated><title type='text'>Memory Game</title><content type='html'>&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/TARcUQFcW-I/AAAAAAAAALg/UuBiBComN2Q/s1600/Memory+Game.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 300px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/TARcUQFcW-I/AAAAAAAAALg/UuBiBComN2Q/s320/Memory+Game.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5477604549774302178" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;In this project, we are going to create a memory game. I think there are three steps of creating a memory game.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Step 1 : Create the form / user interface&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Step 2 : Set the properties of the components &lt;/p&gt;  &lt;span style="font-size:100%;"&gt;&lt;strong&gt;Step 3 : Write the code&lt;/strong&gt;&lt;/span&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Step 1 : Create the form / user interface&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;First you have to create &lt;b style="mso-bidi-font-weight:normal"&gt;a&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;form&lt;/b&gt; with some &lt;b style="mso-bidi-font-weight:normal"&gt;image&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;components&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;a&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;label&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal"&gt;a&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;start&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;button,&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;a&lt;/b&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;timer&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;an&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;exit&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;button&lt;/b&gt;. You can set any width or height properties of your components you use. And arrange them like the picture below or you can use your own arrangement. &lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/TARdaFJ0P0I/AAAAAAAAALw/r5EL4b9eV0Q/s1600/Blank+Images.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 300px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/TARdaFJ0P0I/AAAAAAAAALw/r5EL4b9eV0Q/s320/Blank+Images.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5477605749430697794" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Then cover all images with buttons. So your form will be like this :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/TARdvgpkPxI/AAAAAAAAAL4/_bCXhtAroSM/s1600/Images+covered+by+button.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 300px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/TARdvgpkPxI/AAAAAAAAAL4/_bCXhtAroSM/s320/Images+covered+by+button.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5477606117588877074" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Step 2 : Set the properties of the components&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Now, set the properties of all components we use in this project like tables below :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Form&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Property&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;MEMORY GAME&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Position&lt;/td&gt;&lt;td&gt;&lt;p&gt;poDesktopCenter&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Buttons&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Component&lt;/th&gt;&lt;th&gt;Property&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;StartButton&lt;/td&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;StartButton&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;&amp;amp;Start&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;ExitButton&lt;/td&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;ExitButton&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;&amp;amp;Exit&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Button1 .. Button20&lt;/td&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;?&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Label&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Property&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;MEMORY GAME&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Images&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Property&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Stretch&lt;/td&gt;&lt;td&gt;true&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Timer&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Property&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Interval&lt;/td&gt;&lt;td&gt;1000&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Enabled&lt;/td&gt;&lt;td&gt;false&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Step 3 : Write the code&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Before we start writing the code, we need to prepare some pictures for this project. I have prepared 30 pictures that you can download (jpg format). Or you can have your own pictures. If your pictures are in jpg format, you have to declare it in the uses clause.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;uses&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, &lt;b style="mso-bidi-font-weight:normal"&gt;      jpeg&lt;/b&gt;;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To see the complete code, you can &lt;a href="http://www.ziddu.com/download/10087176/MemoryGame.rar.html"&gt;download this project here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-2819182085089133714?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/2819182085089133714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/memory-game.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2819182085089133714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2819182085089133714'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/memory-game.html' title='Memory Game'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_kLg3mPfGL6E/TARcUQFcW-I/AAAAAAAAALg/UuBiBComN2Q/s72-c/Memory+Game.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3839400782214104582</id><published>2010-05-28T18:47:00.000-07:00</published><updated>2010-05-28T22:12:12.896-07:00</updated><title type='text'>Example program of using BinaryToInteger.DLL</title><content type='html'>&lt;p&gt;&lt;span style="font-size:100%;"&gt;In this example, we are going to create a program that can convert an eight binary data into an integer value using &lt;a href="http://123codegenerator.blogspot.com/2010/05/binarytointegerdll.html"&gt;BinaryToInteger.DLL&lt;/a&gt;. Before we start, you have to create a user interface like this picture.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/TABytsWqJNI/AAAAAAAAALY/uzvdc_fY7XU/s1600/Using+BinaryToIntDLL.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/TABytsWqJNI/AAAAAAAAALY/uzvdc_fY7XU/s320/Using+BinaryToIntDLL.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5476503276208399570" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Every edit box holds a bit of binary data. So there is a byte binary data (8 bits) that will be converted into an integer value. A binary data holds ‘0’ or ‘1’, so we need to limit the input of each edit box. And the code will be :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;procedure TForm1.bit8KeyPress(Sender: TObject; var Key: Char);&lt;br /&gt;begin&lt;br /&gt;  if not (key in ['0','1',#8,#13]) then &lt;br /&gt;    key:=#0&lt;br /&gt;      else&lt;br /&gt;        bit7.SetFocus;&lt;br /&gt;end;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To use BinaryToInteger.DLL, you must declare the function after &lt;i style="mso-bidi-font-style:normal"&gt;{$R *.DFM}&lt;/i&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;{$R *.DFM}&lt;br /&gt;function BinToInt(S : String): integer; stdcall; external 'BinaryToInteger.dll';&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Don forget, you must place your BinaryToInteger.DLL &lt;b style="mso-bidi-font-weight:normal"&gt;in&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;the&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;same&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;folder&lt;/b&gt; with this project, or you can place this DLL file in the directory : &lt;b style="mso-bidi-font-weight: normal"&gt;c:\windows\system&lt;/b&gt;.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The code of OnClick even of ConvertButton :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;procedure TForm1.ConvertButtonClick(Sender: TObject);&lt;br /&gt;var&lt;br /&gt;  BinaryData : string;&lt;br /&gt;begin&lt;br /&gt;  BinaryData := bit8.Text + bit7.Text + bit6.Text + bit5.Text +&lt;br /&gt;              b it4.Text + bit3.Text + bit2.Text + bit1.Text;&lt;br /&gt;  IntegerValue.Caption := IntToStr(BinToInt(BinaryData));             &lt;br /&gt;end;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can &lt;a href="http://www.ziddu.com/download/10047348/UsingBinaryToInt.DLL.rar.html"&gt;download the complete code of this example program here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3839400782214104582?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3839400782214104582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/example-program-of-using.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3839400782214104582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3839400782214104582'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/example-program-of-using.html' title='Example program of using BinaryToInteger.DLL'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/TABytsWqJNI/AAAAAAAAALY/uzvdc_fY7XU/s72-c/Using+BinaryToIntDLL.jpg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3368808163543698252</id><published>2010-05-28T18:36:00.000-07:00</published><updated>2010-05-28T18:47:01.381-07:00</updated><title type='text'>BinaryToInteger.DLL</title><content type='html'>&lt;div align="justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Now, we're going to create a DLL file named BinaryToInteger.DLL This DLL is for converting “a character string of binary” into an integer value.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal"&gt;Example :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;‘11111110’ = 254&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;&lt;a href="http://www.ziddu.com/download/10047344/BinaryToInt.DLL.rar.html"&gt;The complete code&lt;/a&gt; of BinaryToInteger.DLL (&lt;a href="http://www.ziddu.com/download/10047344/BinaryToInt.DLL.rar.html"&gt;click to download&lt;/a&gt;)&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;strong&gt;library&lt;/strong&gt; BinaryToInteger;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;uses&lt;/strong&gt;&lt;br /&gt;   SysUtils,&lt;br /&gt;   Classes;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;{$R *.RES}&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;function&lt;/strong&gt; BinToInt(S : string) : &lt;strong&gt;integer&lt;/strong&gt;; &lt;strong&gt;stdcall&lt;/strong&gt;;&lt;br /&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;br /&gt;  DataLength, i, j, buffer, buffer1 : integer;&lt;br /&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;  DataLength := Length(S);&lt;br /&gt;  buffer1 := 0;&lt;br /&gt;  &lt;strong&gt;for&lt;/strong&gt; i := 1 &lt;strong&gt;to&lt;/strong&gt; DataLength &lt;strong&gt;do&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;    begin&lt;/strong&gt;&lt;br /&gt;       buffer := StrToInt(S[i]);&lt;br /&gt;       &lt;strong&gt;for&lt;/strong&gt; j := 1 &lt;strong&gt;to&lt;/strong&gt; DataLength-i &lt;strong&gt;do&lt;/strong&gt; buffer := buffer*2;&lt;br /&gt;       buffer1 := buffer1 + buffer;&lt;br /&gt;&lt;strong&gt;    end&lt;/strong&gt;;&lt;br /&gt;  BinToInt := buffer1;&lt;br /&gt;&lt;strong&gt;end&lt;/strong&gt;;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;exports&lt;/strong&gt;&lt;br /&gt;  BinToInt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;end&lt;/strong&gt;.&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To use this DLL file, you can see the example of using BinaryToInteger.DLL&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3368808163543698252?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3368808163543698252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/binarytointegerdll.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3368808163543698252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3368808163543698252'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/binarytointegerdll.html' title='BinaryToInteger.DLL'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-4201635013999506369</id><published>2010-05-26T22:50:00.000-07:00</published><updated>2010-05-26T22:56:47.934-07:00</updated><title type='text'>Dynamic Array</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;Dynamic array is an array that has no fix amount. To declare a dynamic array you can use this syntax :&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Array&lt;/b&gt; of datatype;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;Example :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Var&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;       &lt;/span&gt;MyArray : &lt;b style="mso-bidi-font-weight:normal"&gt;array&lt;/b&gt; of integer;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;This array is dynamic with integer data type. The memory of array is not allocated. To allocate memory of array use &lt;b style="mso-bidi-font-weight:normal"&gt;SetLength&lt;/b&gt; procedure. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Example :&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;SetLength&lt;/b&gt;(MyArray, 5);&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;SetLength&lt;/b&gt;(MyArray, 2, 3);&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;SetLength&lt;/b&gt;(MyArray, 2, 3, 5);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;It will allocate an array which has five elements. In this case the index will be 0, 1, 2, 3, 4. And to free the array memory, set &lt;b style="mso-bidi-font-weight:normal"&gt;nil&lt;/b&gt; value to the array. &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Example :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;MyArray := &lt;b style="mso-bidi-font-weight: normal"&gt;nil&lt;/b&gt;;&lt;/p&gt;      &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example program :&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;program Project1;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;   i, sum : integer;&lt;br /&gt;   MyArray : array of integer;&lt;br /&gt;begin&lt;br /&gt;  SetLength(MyArray, 5);&lt;br /&gt;  MyArray[0] := 12;&lt;br /&gt;  MyArray[1] := 14;&lt;br /&gt;  MyArray[2] := 16;&lt;br /&gt;  MyArray[3] := 18;&lt;br /&gt;  MyArray[4] := 20;&lt;br /&gt;  sum := 0;&lt;br /&gt;  for i:= 0 to Length(MyArray) -1 do&lt;br /&gt;   begin&lt;br /&gt;      sum := sum + MyArray[i];&lt;br /&gt;   end;&lt;br /&gt;  writeln(sum);&lt;br /&gt;  readln; &lt;br /&gt;end.&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;You can &lt;a href="http://www.ziddu.com/download/9983577/dynamicarray.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-4201635013999506369?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/4201635013999506369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/dynamic-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4201635013999506369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4201635013999506369'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/dynamic-array.html' title='Dynamic Array'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-1483938586164132624</id><published>2010-05-25T17:30:00.000-07:00</published><updated>2010-05-25T17:36:45.695-07:00</updated><title type='text'>3-Dimensional Array</title><content type='html'>&lt;p class="MsoNormal"&gt;3-dimensional array is an array that has three indexes. To understand the concept of 3-dimensional array, see the picture below.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S_xsBdb5xOI/AAAAAAAAALQ/eGJlCrpaDEY/s1600/three-dimensionsl+array.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 146px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S_xsBdb5xOI/AAAAAAAAALQ/eGJlCrpaDEY/s320/three-dimensionsl+array.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5475370019313009890" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;To declare 3-dimensional array that can hold 24 character, we can us this statement :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Type&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;TwoDimensionalArray = &lt;b style="mso-bidi-font-weight:normal"&gt;array&lt;/b&gt;[1..2, 1..3, 1..4] &lt;b style="mso-bidi-font-weight:normal"&gt;of&lt;/b&gt; char;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Var&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;TheData : TwoDimensionalArray;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;Or you can use this statement :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Var&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;TheData : &lt;b style="mso-bidi-font-weight:normal"&gt;array&lt;/b&gt;[1..2, 1..3, 1..4] &lt;b style="mso-bidi-font-weight:normal"&gt;of&lt;/b&gt; char;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;To access an element in 3-dimensional array use this syntax :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;ArrayVariableName&lt;b style="mso-bidi-font-weight:normal"&gt;[&lt;/b&gt;ArrayIndex1, ArrayIndex2, ArrayIndex3&lt;b style="mso-bidi-font-weight:normal"&gt;]&lt;/b&gt;;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;Example :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;TheData[1,3,4] := ‘A’;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;Writeln(TheData[1,3,4]);&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Readln(TheData[1,3,4]);&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;Example :&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;program Project1;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;   i, j, k : integer;&lt;br /&gt;   Thedata : array[1..2, 1..3, 1..2] of char;&lt;br /&gt;begin&lt;br /&gt;  TheData[1,1,1] := 'A';&lt;br /&gt;  TheData[1,1,2] := 'B';&lt;br /&gt;  TheData[1,2,1] := 'C';&lt;br /&gt;  TheData[1,2,2] := 'D';&lt;br /&gt;  TheData[1,3,1] := 'E';&lt;br /&gt;  TheData[1,3,2] := 'F';&lt;br /&gt;  TheData[2,1,1] := 'G';&lt;br /&gt;  TheData[2,1,2] := 'H';&lt;br /&gt;  TheData[2,2,1] := 'I';&lt;br /&gt;  TheData[2,2,2] := 'J';&lt;br /&gt;  TheData[2,3,1] := 'K';&lt;br /&gt;  TheData[2,3,2] := 'L';&lt;br /&gt;  for i := 1 to 2 do&lt;br /&gt;   begin&lt;br /&gt;      for j := 1 to 3 do&lt;br /&gt;         begin&lt;br /&gt;            for k := 1 to 2 do writeln(TheData[i,j,k]);&lt;br /&gt;         end;&lt;br /&gt;   end;&lt;br /&gt;  readln; &lt;br /&gt;end.&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;You can &lt;a href="http://www.ziddu.com/download/9983542/3-dimensionalarray.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-1483938586164132624?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/1483938586164132624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/3-dimensional-array.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1483938586164132624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1483938586164132624'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/3-dimensional-array.html' title='3-Dimensional Array'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_kLg3mPfGL6E/S_xsBdb5xOI/AAAAAAAAALQ/eGJlCrpaDEY/s72-c/three-dimensionsl+array.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-6937157633451198052</id><published>2010-05-24T19:10:00.000-07:00</published><updated>2010-05-25T17:37:51.788-07:00</updated><title type='text'>N-Dimensional Array</title><content type='html'>&lt;p class="MsoNormal"&gt;N-dimensional array is an array that has two or more indexes. To understand the concept of n-dimensional array, see the picture below.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S_syB14O5FI/AAAAAAAAALI/qGqBlpY1jnk/s1600/two-dimensionsl+array.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 182px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S_syB14O5FI/AAAAAAAAALI/qGqBlpY1jnk/s320/two-dimensionsl+array.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5475024779223163986" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;To declare two-dimensional array that can hold six character, we can us this statement :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Type&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;TwoDimensionalArray = &lt;b style="mso-bidi-font-weight:normal"&gt;array&lt;/b&gt;[1..2, 1..3] &lt;b style="mso-bidi-font-weight:normal"&gt;of&lt;/b&gt; char;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Var&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;TheData : TwoDimensionalArray;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;Or you can use this statement :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Var&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;TheData : &lt;b style="mso-bidi-font-weight:normal"&gt;array&lt;/b&gt;[1..2, 1..3] &lt;b style="mso-bidi-font-weight: normal"&gt;of&lt;/b&gt; char;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;To access an element in two-dimensional array use this syntax :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;ArrayVariableName&lt;b style="mso-bidi-font-weight:normal"&gt;[&lt;/b&gt;ArrayIndex1,ArrayIndex2&lt;b style="mso-bidi-font-weight:normal"&gt;]&lt;/b&gt;;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;Example :&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;TheData[1,3] := ‘A’;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;Writeln(TheData[1,3]);&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Readln(TheData[1,3]);&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;Example program :&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;program Project1;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;var&lt;br /&gt;   i, j : integer;&lt;br /&gt;   TheData : array[1..2, 1..3] of char;&lt;br /&gt;begin&lt;br /&gt;   //assigning values to array&lt;br /&gt;   TheData[1,1] := 'A';&lt;br /&gt;   TheData[1,2] := 'B';&lt;br /&gt;   TheData[1,3] := 'C';&lt;br /&gt;   TheData[2,1] := 'D';&lt;br /&gt;   TheData[2,2] := 'E';&lt;br /&gt;   TheData[2,3] := 'F';&lt;br /&gt;   for i := 1 to 2 do&lt;br /&gt;     begin&lt;br /&gt;        for j := 1 to 3 do writeln(TheData[i,j]);&lt;br /&gt;     end;&lt;br /&gt;   readln;&lt;br /&gt;end.&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;You can &lt;a href="http://www.ziddu.com/download/9983538/n-dimensionalarray.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;How to declare &lt;a href="http://123codegenerator.blogspot.com/2010/05/3-dimensional-array.html"&gt;a three-dimensional array&lt;/a&gt; and to use it in a program ?&lt;/p&gt;&lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-6937157633451198052?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/6937157633451198052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/n-dimensional-array.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6937157633451198052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6937157633451198052'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/n-dimensional-array.html' title='N-Dimensional Array'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/S_syB14O5FI/AAAAAAAAALI/qGqBlpY1jnk/s72-c/two-dimensionsl+array.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-6315905798306028630</id><published>2010-05-23T17:49:00.000-07:00</published><updated>2010-05-23T17:58:38.983-07:00</updated><title type='text'>Array Data Type</title><content type='html'>&lt;p class="MsoNormal" align="justify"&gt;Array is a structured data type that can hold some data which has same data type. Every element in an array has an index and it can be individually accessed. In Pascal, we can have one-dimensional array or n-dimensional array. &lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S_nN7gNjwHI/AAAAAAAAALA/v3AcbLZ-kAc/s1600/one+dimension+array.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 132px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S_nN7gNjwHI/AAAAAAAAALA/v3AcbLZ-kAc/s320/one+dimension+array.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5474633244188328050" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;To declare one-dimensional array that can hold six character, we can us this statement :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Type&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;OneDimensionalArray = &lt;b style="mso-bidi-font-weight:normal"&gt;array&lt;/b&gt;[1..6] &lt;b style="mso-bidi-font-weight: normal"&gt;of&lt;/b&gt; char;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Var&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;TheData : OneDimensionalArray;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;Or you can use this statement :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Var&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;TheData : &lt;b style="mso-bidi-font-weight:normal"&gt;array&lt;/b&gt;[1..6] &lt;b style="mso-bidi-font-weight: normal"&gt;of&lt;/b&gt; char;&lt;/p&gt;  &lt;p class="MsoNormal" align="justify"&gt;The statement above declares an array that can hold six elements. It is called &lt;i style="mso-bidi-font-style:normal"&gt;static array&lt;/i&gt;, because it has a fix amount of data. While a &lt;i style="mso-bidi-font-style: normal"&gt;dynamic array&lt;/i&gt; does not have a fix amount of data.&lt;/p&gt;&lt;p class="MsoNormal" align="justify"&gt;  &lt;p class="MsoNormal"&gt;To access an element in an array use this syntax :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;ArrayVariableName&lt;b style="mso-bidi-font-weight:normal"&gt;[&lt;/b&gt;ArrayIndex&lt;b style="mso-bidi-font-weight:normal"&gt;]&lt;/b&gt;;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;Example :&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;TheData[3] := ‘A’;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;Writeln(TheData[3]);&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Readln(TheData[3]);&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;Example program :&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;program Project1;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;var&lt;br /&gt;   i : integer;&lt;br /&gt;   TheData : array[1..5] of char;&lt;br /&gt;begin&lt;br /&gt;&lt;em&gt;   //assigning values to array&lt;/em&gt;&lt;br /&gt;   TheData[1] := 'A';&lt;br /&gt;   TheData[2] := 'B';&lt;br /&gt;   TheData[3] := 'C';&lt;br /&gt;   TheData[4] := 'D';&lt;br /&gt;   TheData[5] := 'E';&lt;br /&gt;   for i := 1 to 5 do writeln(TheData[i]);&lt;br /&gt;   readln;&lt;br /&gt;end.&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;You can &lt;a href="http://www.ziddu.com/download/9983506/OneDimensionalArray.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-6315905798306028630?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/6315905798306028630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/array-data-type.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6315905798306028630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6315905798306028630'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/array-data-type.html' title='Array Data Type'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_kLg3mPfGL6E/S_nN7gNjwHI/AAAAAAAAALA/v3AcbLZ-kAc/s72-c/one+dimension+array.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3901126515926416202</id><published>2010-05-20T19:52:00.000-07:00</published><updated>2010-05-20T20:00:27.830-07:00</updated><title type='text'>Creating Web Photo Gallery using Photoshop</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;It is quite simple to create a web photo gallery. Before we start creating a web photo gallery, first you have to group all picture you are going to use in your photo gallery into a folder / directory. Then you also need to prepare a folder / directory as a destination of your photo gallery. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;After you run Adobe Photoshop, choose &lt;b style="mso-bidi-font-weight:normal"&gt;File – Automate – Web Photo Gallery&lt;/b&gt;. See the picture below :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S_X1wXs1QVI/AAAAAAAAAKo/pfGaHBxQJGk/s1600/web+photo+gallery.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 241px; height: 320px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S_X1wXs1QVI/AAAAAAAAAKo/pfGaHBxQJGk/s320/web+photo+gallery.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5473551133483286866" /&gt;&lt;/a&gt;  &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;A dialog box will appear. Choose &lt;b style="mso-bidi-font-weight:normal"&gt;the&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;style&lt;/b&gt; of your photo gallery ( in this case I use &lt;b style="mso-bidi-font-weight:normal"&gt;simple&lt;/b&gt; style ) and &lt;b style="mso-bidi-font-weight: normal"&gt;the&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;extension&lt;/b&gt; of your &lt;b style="mso-bidi-font-weight:normal"&gt;index&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;file&lt;/b&gt; ( &lt;b style="mso-bidi-font-weight:normal"&gt;htm&lt;/b&gt; or &lt;b style="mso-bidi-font-weight:normal"&gt;html&lt;/b&gt; ). Define the directories or folders of your source images / pictures and the destination folder. In this case, I group all images / pictures in folder : &lt;b style="mso-bidi-font-weight: normal"&gt;D:\Fujiyama&lt;/b&gt; and the destination folder is &lt;b style="mso-bidi-font-weight: normal"&gt;D:\MyWebPhotoGallery&lt;/b&gt;. See the picture below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S_X2Qg8Ks-I/AAAAAAAAAKw/fxJumQuC8rs/s1600/web+photo+gallery+dialog+box.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 302px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S_X2Qg8Ks-I/AAAAAAAAAKw/fxJumQuC8rs/s320/web+photo+gallery+dialog+box.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5473551685719340002" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Press OK and relax while Adobe Photoshop is processing your images / pictures. After processing, you will get some folders and files as the result in the destination folder.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S_X2g1rBA5I/AAAAAAAAAK4/SEmlsCkuFLE/s1600/files.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 34px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S_X2g1rBA5I/AAAAAAAAAK4/SEmlsCkuFLE/s320/files.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5473551966162453394" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Now, you ready to upload all the files to your web server.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Download &lt;a href="http://www.ziddu.com/download/9931853/Fujiyama.rar.html"&gt;pictures&lt;/a&gt; and &lt;a href="http://www.ziddu.com/download/9931899/MyWebPhotoGallery.rar.html"&gt;web photo gallery&lt;/a&gt; here&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="'font-family:;font-size:12.0pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3901126515926416202?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3901126515926416202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/creating-web-photo-gallery-using.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3901126515926416202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3901126515926416202'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/creating-web-photo-gallery-using.html' title='Creating Web Photo Gallery using Photoshop'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/S_X1wXs1QVI/AAAAAAAAAKo/pfGaHBxQJGk/s72-c/web+photo+gallery.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-5644965911459227805</id><published>2010-05-19T17:35:00.000-07:00</published><updated>2010-05-23T18:09:47.193-07:00</updated><title type='text'>Break and Continue Statement ( Delphi Tutorial # 14 )</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;strong&gt;Break&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Break is a procedure to jump out or quit the looping statement (&lt;b style="mso-bidi-font-weight:normal"&gt;if&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;repeat&lt;/b&gt; or &lt;b style="mso-bidi-font-weight: normal"&gt;while&lt;/b&gt;). Break is usually called in an &lt;b style="mso-bidi-font-weight: normal"&gt;if&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;statement&lt;/b&gt;.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;{$APPTYPE CONSOLE}&lt;br /&gt;uses&lt;br /&gt;  SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  number, stop : integer;&lt;br /&gt;begin&lt;br /&gt;  write('Conter will be stopped at : ');&lt;br /&gt;  readln(stop);&lt;br /&gt;  for number := 1 to 1000 do&lt;br /&gt;    begin&lt;br /&gt;      if number = stop +1 then break;&lt;br /&gt;      writeln(number);&lt;br /&gt;    end;&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Continue&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Continue is a procedure that is used for skipping to next iteration in a looping statement (&lt;b style="mso-bidi-font-weight:normal"&gt;if&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal"&gt;repeat&lt;/b&gt; or &lt;b style="mso-bidi-font-weight:normal"&gt;while&lt;/b&gt;). It is also called in an &lt;b style="mso-bidi-font-weight:normal"&gt;if&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;statement.&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 1 (writing odd numbers from 1 to 20) :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;{$APPTYPE CONSOLE}&lt;br /&gt;uses&lt;br /&gt;  SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  number : integer;&lt;br /&gt;begin&lt;br /&gt;  for number := 1 to 20 do&lt;br /&gt;    begin&lt;br /&gt;      if Odd(number) then continue;&lt;br /&gt;      writeln(number);&lt;br /&gt;    end;&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 2 (writing even numbers from 1 to 20) :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;{$APPTYPE CONSOLE}&lt;br /&gt;uses&lt;br /&gt;  SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  number : integer;&lt;br /&gt;begin&lt;br /&gt;  for number := 1 to 20 do&lt;br /&gt;    begin&lt;br /&gt;      if not Odd(number) then continue;&lt;br /&gt;      writeln(number);&lt;br /&gt;    end;&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can &lt;a href="http://www.ziddu.com/download/9919911/examplebreakcontinue.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/05/while-statement-in-delphi-delphi.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/05/array-data-type.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-5644965911459227805?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/5644965911459227805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/break-and-continue-statement-delphi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/5644965911459227805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/5644965911459227805'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/break-and-continue-statement-delphi.html' title='Break and Continue Statement ( Delphi Tutorial # 14 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3658734457986830594</id><published>2010-05-18T19:51:00.000-07:00</published><updated>2010-05-21T19:24:41.274-07:00</updated><title type='text'>While Statement in Delphi ( Delphi Tutorial # 13 )</title><content type='html'>&lt;p class="MsoNormal"&gt;The syntax of &lt;b style="mso-bidi-font-weight:normal"&gt;while&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;statement&lt;/b&gt; is :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-family:courier new;"&gt;  while&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;i style="mso-bidi-font-style:normal"&gt;&lt;span style="font-family:courier new;"&gt;boolean expression&lt;/span&gt;&lt;/i&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;do&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;  begin&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;i style="mso-bidi-font-style:normal"&gt;&lt;span style="font-family:courier new;"&gt;first statement&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;.&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;.&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;i style="mso-bidi-font-style:normal"&gt;&lt;span style="font-family:courier new;"&gt;  last statement&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;  end&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:courier new;"&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;If the boolean expression is &lt;b style="mso-bidi-font-weight:normal"&gt;true&lt;/b&gt;, the statements will be executed until the boolean expression is &lt;b style="mso-bidi-font-weight:normal"&gt;false&lt;/b&gt;.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S_NS0sRLCEI/AAAAAAAAAKg/kkyM3uPRJ0I/s1600/while+do+flowchart.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 288px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S_NS0sRLCEI/AAAAAAAAAKg/kkyM3uPRJ0I/s320/while+do+flowchart.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5472809037375146050" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 1 ( writing numbers from 1 to 10 ) :&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;  &lt;p class="MsoNormal"&gt;program Project1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{$APPTYPE CONSOLE}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;uses&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;SysUtils;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;var&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;number : integer;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;number := 1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;while number&lt;span style="mso-spacerun:yes"&gt;  &lt;  &lt;/span&gt;11 do&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;writeln(number);&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;number := number + 1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;readln;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;end.&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;  &lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 2 ( adding numbers from 1 to 100 ) :&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;/strong&gt;  &lt;p class="MsoNormal"&gt;program Project1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{$APPTYPE CONSOLE}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;uses&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;SysUtils;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;var&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;number, sum : integer;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;number := 1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;sum := 0;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;while number   &lt;  101  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;sum := sum + number;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;number := number + 1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;writeln(sum); &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;readln;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;end.&lt;/p&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example 3 ( adding odd numbers from 1 to 10 ) :&lt;/strong&gt;program Project1;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;  &lt;p class="MsoNormal"&gt;program Project1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{$APPTYPE CONSOLE}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;uses&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;SysUtils;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;var&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;number, sum : integer;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;number := 1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;sum := 0;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;while number   &lt;  101  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;if Odd(number) then sum := sum + number;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;number := number + 1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;writeln(sum); &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;readln;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;end.&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;em&gt;&lt;/em&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 4 ( adding even numbers from 1 to 100 ) :&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;program Project1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{$APPTYPE CONSOLE}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;uses&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;SysUtils;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;var&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;number, sum : integer;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;number := 1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;sum := 0;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;while number   &lt;  101  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;if not Odd(number) then sum := sum + number;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;number := number + 1;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;writeln(sum); &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;readln;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;end.&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can &lt;a href="http://www.ziddu.com/download/9919853/examplewhiledo.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/05/repeat-statement-in-delphi-delphi.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/05/break-and-continue-statement-delphi.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3658734457986830594?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3658734457986830594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/while-statement-in-delphi-delphi.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3658734457986830594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3658734457986830594'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/while-statement-in-delphi-delphi.html' title='While Statement in Delphi ( Delphi Tutorial # 13 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/S_NS0sRLCEI/AAAAAAAAAKg/kkyM3uPRJ0I/s72-c/while+do+flowchart.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-1133968998195314983</id><published>2010-05-16T21:21:00.000-07:00</published><updated>2010-05-18T20:07:28.143-07:00</updated><title type='text'>Repeat Statement in Delphi ( Delphi Tutorial # 12 )</title><content type='html'>&lt;p class="MsoNormal"&gt;The syntax of repeat statement is :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;strong&gt;repeat&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;i style="mso-bidi-font-style: normal"&gt;&lt;span style="font-family:courier new;"&gt;  first statement&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;  .&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;  .&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;i style="mso-bidi-font-style: normal"&gt;&lt;span style="font-family:courier new;"&gt;  last statement&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;strong&gt;until&lt;/strong&gt; &lt;/span&gt;&lt;i style="mso-bidi-font-style:normal"&gt;&lt;span style="font-family:courier new;"&gt;boolean expression&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The first statement until the last statement will be executed once. If the boolean expression is false, all statements will be executed again until the boolean expression is true.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S_DEuZGHh7I/AAAAAAAAAKY/mSYK4FY0uao/s1600/repeat+until.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 187px; height: 320px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S_DEuZGHh7I/AAAAAAAAAKY/mSYK4FY0uao/s320/repeat+until.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5472089848544724914" /&gt;&lt;/a&gt;  &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 1 ( writing numbers from 1 to 10 ) :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  number : integer;&lt;br /&gt;begin&lt;br /&gt;  number := 1;&lt;br /&gt;  repeat&lt;br /&gt;   writeln(number);&lt;br /&gt;   number := number + 1;&lt;br /&gt;  until number = 11;&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 2 ( adding numbers from 1 to 100 ) :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  number, sum : integer;&lt;br /&gt;begin&lt;br /&gt;  number := 1;&lt;br /&gt;  sum := 0;&lt;br /&gt;  repeat&lt;br /&gt;   sum := sum + number;&lt;br /&gt;   number := number + 1;&lt;br /&gt;  until number = 101;&lt;br /&gt;  writeln(sum);&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 3 ( adding odd numbers from 1 to 10 ) :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  number, sum : integer;&lt;br /&gt;begin&lt;br /&gt;  number := 1;&lt;br /&gt;  sum := 0;&lt;br /&gt;  repeat&lt;br /&gt;   if Odd(number) then sum := sum + number;&lt;br /&gt;   number := number + 1;&lt;br /&gt;  until number = 101;&lt;br /&gt;  writeln(sum);&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 4 ( adding even numbers from 1 to 100 ) :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;   SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  number, sum : integer;&lt;br /&gt;begin&lt;br /&gt;  number := 1;&lt;br /&gt;  sum := 0;&lt;br /&gt;  repeat&lt;br /&gt;   if not Odd(number) then sum := sum + number;&lt;br /&gt;   number := number + 1;&lt;br /&gt;  until number = 101;&lt;br /&gt;  writeln(sum);&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;You can &lt;a href="http://www.ziddu.com/download/9891223/loopingrepeat.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/05/looping-statement-in-delphi-delphi.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/05/while-statement-in-delphi-delphi.html"&gt;Next&lt;/a&gt; Tutorial&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-1133968998195314983?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/1133968998195314983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/repeat-statement-in-delphi-delphi.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1133968998195314983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1133968998195314983'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/repeat-statement-in-delphi-delphi.html' title='Repeat Statement in Delphi ( Delphi Tutorial # 12 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/S_DEuZGHh7I/AAAAAAAAAKY/mSYK4FY0uao/s72-c/repeat+until.jpg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-1972077516019350472</id><published>2010-05-16T20:51:00.000-07:00</published><updated>2010-05-16T21:30:24.489-07:00</updated><title type='text'>Looping Statement in Delphi ( Delphi Tutorial # 11 )</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;Looping statement is used for repeating a process. For example, if we want to write numbers from 1 to 100, we can use looping statement instead of writing a hundreds statements. In Pascal, there are three looping statements :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;for&lt;/b&gt;  statement&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;repeat&lt;/b&gt;  statement&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;while&lt;/b&gt; statement&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;We have &lt;b style="mso-bidi-font-weight: normal"&gt;break&lt;/b&gt; statement and &lt;b style="mso-bidi-font-weight:normal"&gt;continue &lt;/b&gt;statement related to repetition process.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;For statement&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The syntax of for statement :&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;for &lt;/b&gt;&lt;i style="mso-bidi-font-style:normal"&gt;counter :=&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;first value&lt;/i&gt;&lt;b style="mso-bidi-font-weight:normal"&gt; to &lt;/b&gt;&lt;i style="mso-bidi-font-style:normal"&gt;last value &lt;/i&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;do&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;for &lt;/b&gt;&lt;i style="mso-bidi-font-style:normal"&gt;counter :=&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;first value&lt;/i&gt;&lt;b style="mso-bidi-font-weight:normal"&gt; downto &lt;/b&gt;&lt;i style="mso-bidi-font-style:normal"&gt;last value &lt;/i&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;do&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;Counter&lt;/i&gt; is an ordinal type variable (see Delphi Tutorial # 3 : Identifier and Data Type). &lt;i style="mso-bidi-font-style:normal"&gt;First value&lt;/i&gt; and &lt;i style="mso-bidi-font-style:normal"&gt;last value &lt;/i&gt;are expressions which data type is the same as &lt;i style="mso-bidi-font-style:normal"&gt;counter’s &lt;/i&gt;data type. &lt;i style="mso-bidi-font-style:normal"&gt;Counter&lt;/i&gt;’s value will change from the &lt;i style="mso-bidi-font-style:normal"&gt;first value&lt;/i&gt; to the &lt;i style="mso-bidi-font-style:normal"&gt;last value&lt;/i&gt;. And in every step of &lt;i style="mso-bidi-font-style:normal"&gt;counter&lt;/i&gt;, the statement will be executed.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 1 :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;{$APPTYPE CONSOLE}&lt;br /&gt;uses&lt;br /&gt;  SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  number : integer;&lt;br /&gt;  letter : char;&lt;br /&gt;begin&lt;br /&gt;  for number:=1 to 5 do&lt;br /&gt;   writeln(number);&lt;br /&gt;  for letter:='A' to 'E' do&lt;br /&gt;   writeln(letter);&lt;br /&gt;  for number:=5 downto 1 do&lt;br /&gt;   writeln(number);&lt;br /&gt;  for letter:='E' downto 'A' do&lt;br /&gt;   writeln(letter);&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 2 (adding numbers between 1 to 100) :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;{$APPTYPE CONSOLE}&lt;br /&gt;uses&lt;br /&gt;  SysUtils; &lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  i, sum : integer;&lt;br /&gt;begin&lt;br /&gt;  sum := 0;&lt;br /&gt;  for i:=1 to 100 do&lt;br /&gt;   begin&lt;br /&gt;    sum := sum + i;&lt;br /&gt;   end;&lt;br /&gt; writeln(sum);&lt;br /&gt; readln;&lt;br /&gt;end.&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;br /&gt;&lt;/b&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 3 (adding odd numbers between 1 to 100) :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;{$APPTYPE CONSOLE}&lt;br /&gt;uses&lt;br /&gt;  SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  i, sum : integer;&lt;br /&gt;begin&lt;br /&gt;  sum := 0;&lt;br /&gt;  for i:=1 to 100 do&lt;br /&gt;   begin&lt;br /&gt;    if Odd(i) then&lt;br /&gt;      sum := sum + i;&lt;br /&gt;   end;&lt;br /&gt;  writeln(sum);&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Example 4 (adding even numbers between 1 to 100) :&lt;/strong&gt;&lt;/p&gt;program Project1;&lt;br /&gt;{$APPTYPE CONSOLE}&lt;br /&gt;uses&lt;br /&gt;  SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  i, sum : integer;&lt;br /&gt;begin&lt;br /&gt;  sum := 0;&lt;br /&gt;  for i:=1 to 100 do&lt;br /&gt;   begin&lt;br /&gt;     if not Odd(i) then&lt;br /&gt;        sum := sum + i;&lt;br /&gt;   end;&lt;br /&gt;  writeln(sum);&lt;br /&gt;  readln;&lt;br /&gt;end.&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can &lt;a href="http://www.ziddu.com/download/9891188/loopingfor.rar.html"&gt;download the complete code here&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/05/multiple-conditional-statements-in.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/05/repeat-statement-in-delphi-delphi.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-1972077516019350472?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/1972077516019350472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/looping-statement-in-delphi-delphi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1972077516019350472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1972077516019350472'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/looping-statement-in-delphi-delphi.html' title='Looping Statement in Delphi ( Delphi Tutorial # 11 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-4168492637445350525</id><published>2010-05-16T19:15:00.000-07:00</published><updated>2010-05-16T21:19:27.211-07:00</updated><title type='text'>Multiple Conditional Statements in Delphi ( Delphi Tutorial # 10 )</title><content type='html'>&lt;p class="MsoNormal"&gt;You can use &lt;strong&gt;&lt;em&gt;if statement&lt;/em&gt;&lt;/strong&gt; for multiple conditional statement but it will be little bit &lt;strong&gt;messy&lt;/strong&gt;. &lt;/p&gt;&lt;p class="MsoNormal"&gt;For example :&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;program multiple_cond_if;&lt;br /&gt;{$APPTYPE CONSOLE}&lt;br /&gt;uses&lt;br /&gt; SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt; mark : integer;&lt;br /&gt;begin&lt;br /&gt; write('Your mark : ');&lt;br /&gt; readln(mark);&lt;br /&gt; write('Your grade is ');&lt;br /&gt; if mark &gt;= 90 then&lt;br /&gt;  writeln('A')&lt;br /&gt; else&lt;br /&gt;  if mark &gt;= 70 then&lt;br /&gt;   writeln('B')&lt;br /&gt;  else&lt;br /&gt;   if mark &gt;= 60 then&lt;br /&gt;     writeln('C')&lt;br /&gt;   else&lt;br /&gt;     if mark &gt;= 40 then&lt;br /&gt;       writeln('D')&lt;br /&gt;     else&lt;br /&gt;       writeln('E');&lt;br /&gt; readln;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;end&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;Instead of using &lt;b style="mso-bidi-font-weight:normal"&gt;if … then&lt;/b&gt; statement, it will be easier using &lt;b style="mso-bidi-font-weight: normal"&gt;case … of&lt;/b&gt; statement :&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;program multiple_cond_case;&lt;br /&gt;{$APPTYPE CONSOLE}&lt;br /&gt;uses&lt;br /&gt; SysUtils;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt; mark : integer;&lt;br /&gt;begin&lt;br /&gt; write('Your mark : ');&lt;br /&gt; readln(mark);&lt;br /&gt; write('Your grade is ');&lt;br /&gt; case mark of&lt;br /&gt;  0..39     : writeln('E');&lt;br /&gt;  40..59   : writeln('D');&lt;br /&gt;  60..69   : writeln('C');&lt;br /&gt;  70..89   : writeln('B');&lt;br /&gt;  90..100 : writeln('A');&lt;br /&gt; end;&lt;br /&gt;readln;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;end&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;a href="http://www.ziddu.com/download/9891138/multipleconditional.rar.html"&gt;Download the complete code here&lt;/a&gt;.&lt;/p&gt;&lt;p class="MsoNormal"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/05/if-statement-in-delphi-delphi-tutorial.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/05/looping-statement-in-delphi-delphi.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-4168492637445350525?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/4168492637445350525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/multiple-conditional-statements-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4168492637445350525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4168492637445350525'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/multiple-conditional-statements-in.html' title='Multiple Conditional Statements in Delphi ( Delphi Tutorial # 10 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-2761276232933039213</id><published>2010-05-13T18:57:00.000-07:00</published><updated>2010-05-13T19:29:37.199-07:00</updated><title type='text'>Using DLL file in Delphi</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;After we &lt;a href="http://123codegenerator.blogspot.com/2010/05/creating-dll-file-using-delphi.html"&gt;created a DLL file&lt;/a&gt; in the &lt;a href="http://123codegenerator.blogspot.com/2010/05/creating-dll-file-using-delphi.html"&gt;previous tutorial&lt;/a&gt;, now we’re going to use this DLL file in an application. First, you have to create a user interface like picture below :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S-yvBrwhzoI/AAAAAAAAAKQ/jSUXQzSuvRM/s1600/Using+DLL+in+Delphi.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S-yvBrwhzoI/AAAAAAAAAKQ/jSUXQzSuvRM/s320/Using+DLL+in+Delphi.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5470940090809306754" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Or you can &lt;a href="http://www.ziddu.com/download/9851867/UsingDLLinDelphi.rar.html"&gt;download this project here&lt;/a&gt;.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Before you write some codes in this project, you have to make sure that the DLL file you’re going to use and your project are &lt;strong&gt;in the same directory (folder)&lt;/strong&gt;. Or you can put the DLL file you’re going to use in directory : &lt;strong&gt;c:\windows\system&lt;/strong&gt;.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To use functions in a DLL file we’ve created, you must type the function after &lt;i style="mso-bidi-font-style: normal"&gt;{$R *.DFM}&lt;/i&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;em&gt;{$R *.DFM}&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{ place functions from DLL here }&lt;/em&gt;&lt;br /&gt;&lt;strong&gt;function&lt;/strong&gt; area(length, width : integer): integer; &lt;strong&gt;stdcall&lt;/strong&gt;; &lt;strong&gt;external&lt;/strong&gt; 'area_volume.dll';&lt;br /&gt;&lt;strong&gt;function&lt;/strong&gt; volume(length, width, height : integer): integer; &lt;strong&gt;stdcall&lt;/strong&gt;; &lt;strong&gt;external&lt;/strong&gt; 'area_volume.dll';&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;external&lt;/b&gt; clause means that the functions we use (&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;i style="mso-bidi-font-style:normal"&gt;area&lt;/i&gt;&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;&lt;i style="mso-bidi-font-style:normal"&gt;volume&lt;/i&gt;&lt;/b&gt;) are in an external file (&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;i style="mso-bidi-font-style:normal"&gt;area_volume.dll&lt;/i&gt;&lt;/b&gt;)&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To call &lt;b style="mso-bidi-font-weight: normal"&gt;&lt;i style="mso-bidi-font-style:normal"&gt;area function&lt;/i&gt;&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;&lt;i style="mso-bidi-font-style:normal"&gt;volume function&lt;/i&gt;&lt;/b&gt; see the codes below :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;procedure&lt;/strong&gt; TForm1.CalculateAreaButtonClick(Sender: TObject);&lt;br /&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;br /&gt;  L, W : integer;&lt;br /&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;  L := StrToInt(Edit1.Text);&lt;br /&gt;  W := StrToInt(Edit2.Text);&lt;br /&gt;  Label8.Caption := Label8.Caption + ' ' + IntToStr(&lt;strong&gt;area(L,W)&lt;/strong&gt;);&lt;br /&gt;&lt;strong&gt;end&lt;/strong&gt;;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;procedure&lt;/strong&gt; TForm1.CalculateVolumeButtonClick(Sender: TObject);&lt;br /&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;br /&gt;  L, W, H : integer;&lt;br /&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;  L := StrToInt(Edit3.Text);&lt;br /&gt;  W := StrToInt(Edit4.Text);&lt;br /&gt;  H := StrToInt(Edit5.Text);&lt;br /&gt;  Label9.Caption := Label9.Caption + ' ' + IntToStr(&lt;strong&gt;volume(L,W,H)&lt;/strong&gt;);&lt;br /&gt;&lt;strong&gt;end&lt;/strong&gt;;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;area(L,W)&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;volume(L,W,H)&lt;/b&gt; will return integer type values, so if you want to put these values into &lt;em&gt;label.caption&lt;/em&gt;, you have to convert them into string using &lt;b style="mso-bidi-font-weight: normal"&gt;IntToStr()&lt;/b&gt; procedure.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;You can &lt;a href="http://www.ziddu.com/download/9851867/UsingDLLinDelphi.rar.html"&gt;download the complete code here&lt;/a&gt;.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-2761276232933039213?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/2761276232933039213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/using-dll-file-in-delphi.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2761276232933039213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2761276232933039213'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/using-dll-file-in-delphi.html' title='Using DLL file in Delphi'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/S-yvBrwhzoI/AAAAAAAAAKQ/jSUXQzSuvRM/s72-c/Using+DLL+in+Delphi.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-8993147717847988294</id><published>2010-05-13T18:13:00.000-07:00</published><updated>2010-05-16T21:09:50.359-07:00</updated><title type='text'>if Statement in Delphi ( Delphi Tutorial # 9 )</title><content type='html'>&lt;p align="justify"&gt;There are two kinds of conditional statement : &lt;b style="mso-bidi-font-weight:normal"&gt;if&lt;/b&gt; statement and &lt;b style="mso-bidi-font-weight:normal"&gt;case&lt;/b&gt; statement. This both statements are for making decisions that involve two or more alternative choices or conditions.&lt;/p&gt;&lt;p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;In this tutorial, we will learn about if statement. There are two kinds of if statement :&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;if ….. then&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;if ….. then …. else&lt;/b&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;The syntax of &lt;b style="mso-bidi-font-weight:normal"&gt;if …. then&lt;/b&gt; statement is :&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify" align="center"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;     If&lt;/b&gt; &lt;i style="mso-bidi-font-style:normal"&gt;boolean&lt;/i&gt; &lt;i style="mso-bidi-font-style:normal"&gt;expression&lt;/i&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;then&lt;/b&gt; &lt;i style="mso-bidi-font-style:normal"&gt;statement;&lt;/i&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;Boolean expression can be &lt;b style="mso-bidi-font-weight:normal"&gt;true&lt;/b&gt; or &lt;b style="mso-bidi-font-weight: normal"&gt;false&lt;/b&gt;. If it is &lt;b style="mso-bidi-font-weight:normal"&gt;true&lt;/b&gt;, computer &lt;b style="mso-bidi-font-weight:normal"&gt;will&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;execute&lt;/b&gt; the statement. If it is &lt;b style="mso-bidi-font-weight: normal"&gt;false&lt;/b&gt;, computer &lt;b style="mso-bidi-font-weight:normal"&gt;will&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;not&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;execute&lt;/b&gt; the statement. &lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;The syntax of &lt;b style="mso-bidi-font-weight:normal"&gt;if …. then …. else&lt;/b&gt; statement is :&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;     If&lt;/b&gt; &lt;i style="mso-bidi-font-style:normal"&gt;boolean&lt;/i&gt; &lt;i style="mso-bidi-font-style:normal"&gt;expression&lt;/i&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;then&lt;/b&gt; &lt;i style="mso-bidi-font-style:normal"&gt;first_statement &lt;/i&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;else&lt;/b&gt; &lt;i style="mso-bidi-font-style: normal"&gt;second_statement;&lt;/i&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;If boolean expression is &lt;b style="mso-bidi-font-weight:normal"&gt;true&lt;/b&gt;, computer will execute the &lt;b style="mso-bidi-font-weight:normal"&gt;first&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;statement. &lt;/b&gt;If it is &lt;b style="mso-bidi-font-weight:normal"&gt;false&lt;/b&gt;, computer will execute the &lt;b style="mso-bidi-font-weight:normal"&gt;second&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;statement&lt;/b&gt;. &lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;The flowchart of &lt;b style="mso-bidi-font-weight:normal"&gt;if statement&lt;/b&gt; is below :&lt;/p&gt;&lt;p&gt;  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S-yrPovCUxI/AAAAAAAAAKI/bSuUygP_RAc/s1600/flowchart.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 218px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S-yrPovCUxI/AAAAAAAAAKI/bSuUygP_RAc/s320/flowchart.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5470935932469400338" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a href="http://www.ziddu.com/download/9852000/ifthen.rar.html"&gt;Example&lt;/a&gt; for &lt;b style="mso-bidi-font-weight: normal"&gt;if …. then&lt;/b&gt; statement :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;program&lt;/strong&gt; Project1;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;uses&lt;/strong&gt; SysUtils;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;score : integer;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;write('Your score : ');&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;readln(score);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;&lt;strong&gt;if&lt;/strong&gt; score &lt;strong&gt;&lt; &lt;/strong&gt;60&lt;strong&gt; then&lt;/strong&gt; writeln('You did not pass the exam');&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;&lt;strong&gt;if&lt;/strong&gt; score &gt;= 60 &lt;strong&gt;then&lt;/strong&gt; writeln('You passed the exam');&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;readln;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;end&lt;/strong&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a href="http://www.ziddu.com/download/9852009/ifthenelse.rar.html"&gt;Example&lt;/a&gt; for &lt;b style="mso-bidi-font-weight: normal"&gt;if …. then&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;…. else&lt;/b&gt; statement :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;program&lt;/strong&gt; Project2;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;uses&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;SysUtils;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;score : integer;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;write('Your score : ');&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;readln(score);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;&lt;strong&gt;if&lt;/strong&gt; score &lt;strong&gt;&lt; &lt;/strong&gt;60&lt;strong&gt; then&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;writeln('You did not pass the exam')&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;&lt;strong&gt;else&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;writeln('You passed the exam');&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;readln;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;end&lt;/strong&gt;.&lt;/p&gt;   &lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Both projects above will give you the same result.&lt;/p&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/05/square-root-and-exponential-function-in.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/05/multiple-conditional-statements-in.html"&gt;Next&lt;/a&gt; Tutorial&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-8993147717847988294?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/8993147717847988294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/if-statement-in-delphi-delphi-tutorial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8993147717847988294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8993147717847988294'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/if-statement-in-delphi-delphi-tutorial.html' title='if Statement in Delphi ( Delphi Tutorial # 9 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/S-yrPovCUxI/AAAAAAAAAKI/bSuUygP_RAc/s72-c/flowchart.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-6767507595322570786</id><published>2010-05-11T20:00:00.000-07:00</published><updated>2010-05-13T19:10:11.322-07:00</updated><title type='text'>Creating DLL file using Delphi</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;There are two kinds of&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;executable file in Windows, &lt;b style="mso-bidi-font-weight:normal"&gt;EXE&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;file&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;DLL&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;file&lt;/b&gt;. DLL (Dynamic Link Library) is an executable file with some procedures or functions in it. These procedures or functions can be used by some applications at the same time. Because, once DLL is loaded to memory, every program or application can use it. The other advantage of using DLL is our application becomes modular. It will be easier to change the application by replacing the DLL. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To create a DLL file, choose &lt;b style="mso-bidi-font-weight:normal"&gt;File – New – DLL&lt;/b&gt;. And you’ll get some codes below :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;library&lt;/strong&gt; Project1;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;em&gt;{ &lt;/em&gt;&lt;em&gt;Important note about DLL memory management: ShareMem must be the first unit in your library's USES clause AND your project's (select Project-View Source) USES clause if your DLL exports any procedures or&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;functions that pass strings as parameters or function results. This&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;applies to all strings passed to and from your DLL--even those that are nested in records and classes. ShareMem is the interface unit to the BORLNDMM.DLL shared memory manager, which must be deployed along with your DLL. To avoid using BORLNDMM.DLL, pass string information using PChar or ShortString parameters.&lt;/em&gt; &lt;em&gt;}&lt;/em&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;uses&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;SysUtils,&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Classes;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;em&gt;{&lt;/em&gt;&lt;em&gt;$R *.RES&lt;/em&gt;&lt;em&gt;}&lt;/em&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/p&gt;  &lt;span style="font-size:100%;"&gt;&lt;strong&gt;end&lt;/strong&gt;.&lt;/span&gt;&lt;span style="'font-family:;font-size:12.0pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;You can delete the unnecessary comment after &lt;strong&gt;library&lt;/strong&gt; clause and add &lt;strong&gt;exports&lt;/strong&gt; clause before &lt;strong&gt;begin….end&lt;/strong&gt; block.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;One thing you have to concern about is that all variables in DLL are private. Your application and DLL can not use the variables at the same time. You have to send values of the variables and receive a result. &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Now we’re going to insert some functions into DLL :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;library&lt;/strong&gt; area_volume;&lt;/p&gt;      &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;uses&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;SysUtils,&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Classes;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;em&gt;{$R *.RES}&lt;/em&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;function&lt;/strong&gt; area(length, width : integer): integer; &lt;strong&gt;stdcall&lt;/strong&gt;;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;area := length*width;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;end&lt;/strong&gt;;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;function&lt;/strong&gt; volume(length, width, height : integer): integer; &lt;strong&gt;stdcall&lt;/strong&gt;;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;volume := length*width*height;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;end&lt;/strong&gt;;&lt;/p&gt;      &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;exports&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;area, volume;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;end&lt;/strong&gt;.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a href="http://www.ziddu.com/download/9823672/CreateDLLfile.rar.html"&gt;You can download this source code here&lt;/a&gt;. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Now save the project as &lt;b style="mso-bidi-font-weight:normal"&gt;&lt;i style="mso-bidi-font-style:normal"&gt;area_volume.dpr&lt;/i&gt;&lt;/b&gt;. Remember that the project name and the DLL name have to be the same, in this case we name it &lt;i style="mso-bidi-font-style:normal"&gt;area_volume&lt;/i&gt;. Then build the DLL file by choosing &lt;b style="mso-bidi-font-weight:normal"&gt;Project – Build …&lt;/b&gt; And you’ll get &lt;b style="mso-bidi-font-weight:normal"&gt;area_volume.dll&lt;/b&gt; file. Then you can &lt;a href="http://123codegenerator.blogspot.com/2010/05/using-dll-file-in-delphi.html"&gt;create an application using this DLL&lt;/a&gt;.&lt;/p&gt;  &lt;span style="'font-family:;font-size:12.0pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-6767507595322570786?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/6767507595322570786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/creating-dll-file-using-delphi.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6767507595322570786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6767507595322570786'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/creating-dll-file-using-delphi.html' title='Creating DLL file using Delphi'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-2914012564592452071</id><published>2010-05-10T18:10:00.000-07:00</published><updated>2010-05-16T21:04:43.254-07:00</updated><title type='text'>Square Root and Exponential Function in Delphi ( Delphi Tutorial # 8 )</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Sqrt() function&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In this tutorial we’re going to write some mathematic formulas in &lt;st1:place&gt;Delphi&lt;/st1:place&gt;. The first formula is :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S-ivG8ihAvI/AAAAAAAAAJo/KwITW1b-6Zw/s1600/determinan.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 207px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S-ivG8ihAvI/AAAAAAAAAJo/KwITW1b-6Zw/s320/determinan.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5469814281306440434" /&gt;&lt;/a&gt;  &lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;To write the above formula in &lt;st1:place&gt;Delphi&lt;/st1:place&gt;, we use &lt;b style="mso-bidi-font-weight:normal"&gt;sqrt()&lt;/b&gt; function :&lt;/p&gt;  &lt;p class="MsoNormal" align="center"&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Sqrt((b*b-4*a*c)/(2*a))&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Exp() function&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S-ivcq9DXqI/AAAAAAAAAJw/Pn_dXacthnU/s1600/powering.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 166px; height: 154px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S-ivcq9DXqI/AAAAAAAAAJw/Pn_dXacthnU/s320/powering.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5469814654543027874" /&gt;&lt;/a&gt;  &lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify" align="justify"&gt;There’s no power operator in Pascal Object. But it does not mean that we can not calculate the formula above. Before we calculate the formula, we have to describe it into an exponential function :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S-kArBlVWdI/AAAAAAAAAKA/ExmYvCnZRDQ/s1600/exponential+function.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 172px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S-kArBlVWdI/AAAAAAAAAKA/ExmYvCnZRDQ/s320/exponential+function.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5469903961577576914" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify" align="justify"&gt;So we can write the formula using exp() function and ln() function :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify" align="center"&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;                                                   Exp(b*ln(a))&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal"&gt;Example :&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;program&lt;/strong&gt; Project1;&lt;br /&gt;{$APPTYPE CONSOLE}&lt;br /&gt;&lt;strong&gt;uses&lt;/strong&gt;&lt;br /&gt;SysUtils;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;br /&gt;x, y : real;&lt;br /&gt;a, b, c : integer;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;  // Insert user code here&lt;br /&gt;  a := 2;&lt;br /&gt;  b := 5;&lt;br /&gt;  c := 3;&lt;br /&gt;  x := sqrt((b*b-4*a*c)/(2*a));&lt;br /&gt;  writeln(x:0:1);&lt;br /&gt;  y := exp(b*ln(a));&lt;br /&gt;  writeln(y:0:0);&lt;br /&gt;  readln;&lt;br /&gt;&lt;strong&gt;end&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-7.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/05/if-statement-in-delphi-delphi-tutorial.html"&gt;Next&lt;/a&gt; Tutorial&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-2914012564592452071?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/2914012564592452071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/square-root-and-exponential-function-in.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2914012564592452071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2914012564592452071'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/square-root-and-exponential-function-in.html' title='Square Root and Exponential Function in Delphi ( Delphi Tutorial # 8 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/S-ivG8ihAvI/AAAAAAAAAJo/KwITW1b-6Zw/s72-c/determinan.jpg' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-1503081885739563657</id><published>2010-05-05T22:07:00.000-07:00</published><updated>2010-05-10T18:57:52.838-07:00</updated><title type='text'>Text Area Code Generator</title><content type='html'>&lt;div align="justify"&gt;In this first project, we're going to create an application that can generate HTML codes to create a text area. First you have to create a form like the picture below :&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S-JQu3xNCQI/AAAAAAAAAJg/E87shoVNkb0/s1600/user+interface.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 142px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S-JQu3xNCQI/AAAAAAAAAJg/E87shoVNkb0/s320/user+interface.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5468021663755733250" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Now, write the codes for each event of the components :&lt;/p&gt;&lt;p align="justify"&gt;When the first time we run the program, we set the default values of some component's properties. So we write some codes on &lt;strong&gt;FormActivate&lt;/strong&gt; event of &lt;em&gt;Form1&lt;/em&gt; :&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;strong&gt;procedure&lt;/strong&gt; TForm1.FormActivate(Sender: TObject);&lt;br /&gt;  &lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;   Memo1.Text := '';&lt;br /&gt;   Memo2.Text := '';&lt;br /&gt;   Memo2.SetFocus;&lt;br /&gt;   Edit1.Enabled := false;&lt;br /&gt;   Edit2.Enabled := false;&lt;br /&gt;   Edit3.Enabled := false;&lt;br /&gt;   RadioButton1.Checked := true;&lt;br /&gt;   RadioButton2.Checked := false;&lt;br /&gt;   RadioGroup1.ItemIndex := 0;&lt;br /&gt;   Edit4.Text := '1';&lt;br /&gt;   Edit5.Text := '1';&lt;br /&gt;  &lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The codes for RadioButtons ( &lt;em&gt;Text Only&lt;/em&gt; and &lt;em&gt;Link Codes&lt;/em&gt; ) :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;strong&gt;procedure&lt;/strong&gt; TForm1.RadioButton1Click(Sender: TObject);&lt;br /&gt;  &lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;   Edit1.Enabled := false;&lt;br /&gt;   Edit2.Enabled := false;&lt;br /&gt;   Edit3.Enabled := false;&lt;br /&gt;   Memo2.Enabled := true;&lt;br /&gt;   Memo2.SetFocus;&lt;br /&gt;  &lt;strong&gt;end;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;  &lt;strong&gt;procedure&lt;/strong&gt; TForm1.RadioButton2Click(Sender: TObject);&lt;br /&gt;  &lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;   Edit1.Enabled := true;&lt;br /&gt;   Edit2.Enabled := true;&lt;br /&gt;   Edit3.Enabled := true;&lt;br /&gt;   Memo2.Enabled := false;&lt;br /&gt;   Edit1.SetFocus;&lt;br /&gt;  &lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;We need to limit the input of &lt;strong&gt;rows&lt;/strong&gt; and &lt;strong&gt;columns&lt;/strong&gt; for numeric inputs only :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  procedure&lt;/strong&gt; TForm1.Edit4KeyPress(Sender: TObject; var Key: Char);&lt;br /&gt;&lt;strong&gt;  begin&lt;/strong&gt;&lt;br /&gt;   if not (key in ['0'..'9', #8]) then key := #0;&lt;br /&gt;&lt;strong&gt;  end;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;  procedure&lt;/strong&gt; TForm1.Edit5KeyPress(Sender: TObject; var Key: Char);&lt;br /&gt;&lt;strong&gt;  begin&lt;/strong&gt;&lt;br /&gt;   if not (key in ['0'..'9', #8]) then key := #0;&lt;br /&gt;&lt;strong&gt;  end;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;And the other codes for the events of the rest components are :&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure&lt;/strong&gt;&lt;/span&gt; TForm1.GenerateButtonClick(Sender: TObject);&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt; LinkBanner : &lt;strong&gt;string&lt;/strong&gt;;&lt;/p&gt;&lt;p align="left"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt; &lt;strong&gt;if&lt;/strong&gt; RadioButton1.Checked &lt;strong&gt;then&lt;/strong&gt;&lt;/p&gt;&lt;p align="left"&gt;  &lt;strong&gt;begin&lt;/strong&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;   memo1.Text :=&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;'&amp;lt;p align="'+RadioGroup1.Items.String&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;                [&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;RadioGroup1.ItemIndex]&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;+'"&amp;gt;&amp;lt;textarea name="code" rows="' + &lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;                Edit4.Text + '"  cols="' +Edit5.Text + '"&amp;gt;' + memo2.Text  + &lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;                '&amp;lt;/textarea&amp;gt;&amp;lt;/p&amp;gt;';&lt;/span&gt;                                  &lt;/p&gt;&lt;p align="left"&gt;  &lt;strong&gt;end&lt;/strong&gt; &lt;strong&gt;else&lt;/strong&gt;&lt;/p&gt;&lt;p align="left"&gt;  &lt;strong&gt;begin&lt;/strong&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;   LinkBanner := '&amp;lt;a href="' + Edit2.Text + &lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;                 '"&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;target="_blank"&amp;gt;&amp;lt;img src="'+Edit1.Text + &lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;                 '" border="0" alt="' &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;+ Edit3.Text + '" /&amp;gt;&amp;lt;/a&amp;gt;';&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;   memo1.Text := &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;RadioG&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;roup1.Items.Strings[RadioGroup1.ItemIndex] + &lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;                 '"&amp;gt;&amp;lt;textarea name="code" rows="' +           &lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;                 Edit4.Text + '" cols="'+Edit5.Text + '"&amp;gt;' + LinkBanner +&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;                 '&amp;lt;/textarea&amp;gt;&amp;lt;/p&amp;gt;';&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;  &lt;strong&gt;end&lt;/strong&gt;;&lt;/p&gt;&lt;p align="left"&gt;&lt;strong&gt;end&lt;/strong&gt;;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure&lt;/strong&gt; TForm1.ClearButtonClick(Sender: TObject);&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;  memo1.Text := '';&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure&lt;/strong&gt; TForm1.ExitButtonClick(Sender: TObject);&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;  Application.Terminate;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To see the complete codes you can &lt;a href="http://www.ziddu.com/download/9809923/TextAreaCodeGenerator.rar.html"&gt;download this project here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-1503081885739563657?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/1503081885739563657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/text-area-code-generator.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1503081885739563657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1503081885739563657'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/text-area-code-generator.html' title='Text Area Code Generator'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_kLg3mPfGL6E/S-JQu3xNCQI/AAAAAAAAAJg/E87shoVNkb0/s72-c/user+interface.jpg' height='72' width='72'/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-9116360232031901678</id><published>2010-05-05T21:54:00.000-07:00</published><updated>2010-05-05T23:26:54.590-07:00</updated><title type='text'>Creating Text Area</title><content type='html'>&lt;p class="MsoNormal"&gt;What is text area ? You can see the example of text area below :&lt;/p&gt;&lt;p align="center"&gt;&lt;textarea name="code" rows="6" cols="20"&gt; Your Text Here &lt;/textarea&gt;&lt;/p&gt;&lt;p align="justify"&gt;  &lt;p class="MsoNormal"&gt;To create a text area, use this HTML tag :&lt;/p&gt;&amp;lt;p align="center"&amp;gt;&amp;lt;textarea name="code" rows="6" cols="20"&amp;gt; Your Text Here &amp;lt;/textarea&amp;gt;&amp;lt;/p&amp;gt;&lt;p&gt;&lt;/p&gt;&lt;p align="justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can save some HTML codes that contain a link and a banner for link or banner exchange. So the codes can be copied and pasted into another web page. To create a text area with a link and a banner, use these HTML codes :&lt;/p&gt;&lt;p&gt;&amp;lt;a href="Link URL" target="_blank"&amp;gt;&amp;lt;img src="Image URL " border="0" alt="Tutorial Blog" /&amp;gt;&amp;lt;/a&amp;gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Text Area Code Generator&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can also use Text Area Code Generator to create a text area.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S-JM2j57r0I/AAAAAAAAAJY/KAxJyIgWHvA/s1600/Text+Area+Code+Generator.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 142px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S-JM2j57r0I/AAAAAAAAAJY/KAxJyIgWHvA/s320/Text+Area+Code+Generator.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5468017397816078146" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Using this software, you don’t need to type the HTML code to create a text area. You can generate the code by clicking Generate HTML Codes button. &lt;a href="http://123codegenerator.blogspot.com/2010/05/text-area-code-generator.html"&gt;Click here to download this software&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-9116360232031901678?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/9116360232031901678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/creating-text-area.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/9116360232031901678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/9116360232031901678'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/05/creating-text-area.html' title='Creating Text Area'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/S-JM2j57r0I/AAAAAAAAAJY/KAxJyIgWHvA/s72-c/Text+Area+Code+Generator.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-8122580909284301220</id><published>2010-04-28T22:54:00.000-07:00</published><updated>2010-04-29T17:37:54.623-07:00</updated><title type='text'>Operators ( Example Console Program using Delphi )</title><content type='html'>&lt;p&gt;&lt;span style="font-family:courier new;"&gt;This is an example program using &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-7.html"&gt;operators&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;program Using_Operators;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;em&gt;{$APPTYPE CONSOLE}&lt;/em&gt;&lt;br /&gt;uses&lt;br /&gt;SysUtils;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;em&gt;   // Insert user code here&lt;/em&gt;&lt;br /&gt;   writeln('7 + 8 = ', 7 + 8);&lt;br /&gt;   writeln('7 - 8 = ', 7 - 8);&lt;br /&gt;   writeln('7 x 8 = ', 7 * 8);&lt;br /&gt;   writeln('15 : 3 = ', 15/3:0:0);&lt;br /&gt;   &lt;em&gt;{ :0:0 is for formatting. You should try to ommit it }&lt;/em&gt;&lt;br /&gt;   &lt;em&gt;{ and see what happend at the result }&lt;/em&gt;&lt;br /&gt;   writeln('17 mod 4 = ', 17 mod 4);&lt;br /&gt;   writeln('17 div 4 = ', 17 div 4);&lt;br /&gt;   writeln('3 + 2 x 4 = ', 3 + 2 * 4);   &lt;em&gt;// see the different between&lt;/em&gt;&lt;br /&gt;   writeln('(3 + 2) x 4 = ', (3 + 2) * 4); &lt;em&gt;// these two expressions&lt;/em&gt;&lt;br /&gt;   writeln(8 shr 1); &lt;em&gt;// logic operator&lt;/em&gt;&lt;br /&gt;   writeln(8 shl 1); &lt;em&gt;// logic operator&lt;/em&gt;&lt;br /&gt;   writeln(1 = 2); &lt;em&gt;// boolean operator&lt;/em&gt;&lt;br /&gt;   writeln(not (1 = 2)); &lt;em&gt;// boolean operator&lt;/em&gt;&lt;br /&gt;   writeln(7 &gt;= 2); &lt;em&gt;// relational operator&lt;/em&gt;&lt;br /&gt;   writeln('a' &lt; 'b'); &lt;em&gt;// relational operator&lt;/em&gt;&lt;br /&gt;   writeln('123delphicodes' = '123&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;delphicodes&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;'); &lt;em&gt;// string operator&lt;/em&gt;&lt;br /&gt;   writeln('123&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;DelphiCodes&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;' = '123&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;delphicodes&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;'); &lt;em&gt;// string operator&lt;/em&gt;&lt;br /&gt;   writeln('123&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;DelphiCodes&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;' &lt; '123&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;delphicodes&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;'); &lt;em&gt;// string operator&lt;/em&gt;&lt;br /&gt;   readln; &lt;em&gt;// wait until enter button is pushed&lt;/em&gt;&lt;br /&gt;end.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-8122580909284301220?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/8122580909284301220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/operators-example-console-program-using.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8122580909284301220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8122580909284301220'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/operators-example-console-program-using.html' title='Operators ( Example Console Program using Delphi )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-6975082222725638820</id><published>2010-04-28T20:44:00.000-07:00</published><updated>2010-05-16T21:04:23.299-07:00</updated><title type='text'>Delphi Tutorial # 7</title><content type='html'>&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:100%;"&gt;Operators&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" align="justify"&gt;Operator is a symbol to do some operation, such as : sum, product, division, compare etc. Operator involves two or more operands. Operator and operand form an expression. Example :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;    12 + 15 = 27&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;see the table below :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Operators&lt;/th&gt;&lt;th&gt;Operands&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;+&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;=&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;27&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;arithmetic operators&lt;/strong&gt;&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Operator&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;*&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;/&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;div&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;mod&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;+&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;logic operators&lt;/strong&gt;&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Operator&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;not&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;and&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;or&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;xor&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;shl&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;shr&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;boolean operators&lt;/strong&gt;&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Operator&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;not&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;and&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;or&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;xor&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;relational operators &lt;/strong&gt;&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Operator&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt; &lt; &lt;/td&gt;&lt;tr&gt;&lt;td&gt;&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;string operator&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;all relational operators also can be use for string :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Operator&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt; &lt; &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;In the &lt;a href="http://123codegenerator.blogspot.com/2010/04/operators-example-console-program-using.html"&gt;example&lt;/a&gt;, I will show you how to use these operators.&lt;/p&gt;&lt;p&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-6.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/05/square-root-and-exponential-function-in.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-6975082222725638820?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/6975082222725638820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-7.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6975082222725638820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6975082222725638820'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-7.html' title='Delphi Tutorial # 7'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-8083698098134318667</id><published>2010-04-23T18:30:00.000-07:00</published><updated>2010-05-16T21:03:59.976-07:00</updated><title type='text'>Delphi Tutorial # 6</title><content type='html'>&lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;Console Application&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Before we go further with visual programming, it is important to understand the basic element of &lt;st1:place&gt;Delphi&lt;/st1:place&gt;. In the first tutorial about, I have mention that a console application is a DOS (Disk Operating System) application. It is a non Windows application. Using console programming, you can focus on the codes only. Meanwhile you can forget about visual programming, and learn about Pascal language.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To make a console application, choose File – Close All (if thee is still a form in IDE). Then choose File – New, select Console Application. &lt;st1:place&gt;Delphi&lt;/st1:place&gt; will show &lt;i style="mso-bidi-font-style:normal"&gt;Project1.dpr&lt;/i&gt; window :&lt;/p&gt;  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S9JLRl0S2AI/AAAAAAAAAJA/nxIeBivclbs/s1600/dpr.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 222px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S9JLRl0S2AI/AAAAAAAAAJA/nxIeBivclbs/s320/dpr.jpg" alt="" id="BLOGGER_PHOTO_ID_5463512063535142914" border="0" /&gt;&lt;/a&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Declare constants and variables after &lt;b style="mso-bidi-font-weight:normal"&gt;uses SysUtils&lt;/b&gt;; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;strong&gt;const&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  length : integer = 12;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  width : integer = 8;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  var&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  area : integer;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Insert user code between &lt;b style="mso-bidi-font-weight:normal"&gt;begin&lt;/b&gt; …. &lt;b style="mso-bidi-font-weight: normal"&gt;end.&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  area := length*width;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;writeln('Length of rectangle = ',length);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; writeln('Width of rectangle = ',width);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; writeln('The area = ',area);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; readln;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The complete codes of &lt;i style="mso-bidi-font-style:normal"&gt;&lt;strong&gt;Project1.dpr&lt;/strong&gt;&lt;/i&gt; :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  program Project1;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  {$APPTYPE CONSOLE}&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  uses&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; SysUtils;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  const&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  length : integer = 12;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  width : integer = 8;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  var&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  area : integer;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  begin&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;   &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;// &lt;/span&gt;&lt;/strong&gt;&lt;i style="mso-bidi-font-style:normal"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;Insert user code here&lt;/span&gt;&lt;/strong&gt;&lt;/i&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  area := length*width;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  writeln('Length of rectangle = ',length);&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  writeln('Width of rectangle = ',width);&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  writeln('The area = ',area);&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  readln;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  end.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Run the program, and the result is :&lt;/p&gt;  &lt;p&gt;  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S9JPXGo0itI/AAAAAAAAAJQ/LgkQxAQwYGI/s1600/result.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 176px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S9JPXGo0itI/AAAAAAAAAJQ/LgkQxAQwYGI/s320/result.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5463516556291246802" /&gt;&lt;/a&gt;  &lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The last code &lt;b style="mso-bidi-font-weight:normal"&gt;readln;&lt;/b&gt; is for delaying program until you press Enter button.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Comment&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;// &lt;i style="mso-bidi-font-style: normal"&gt;Insert user code here &lt;/i&gt;is an example of comment. Comment can be written in three ways :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;Written between { }&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;Written between * *&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;Begun with // like the example above&lt;/p&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Assigning a value to a variable&lt;/b&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;From the program above, we assign a value to &lt;b style="mso-bidi-font-weight:normal"&gt;area&lt;/b&gt; variable using assignment operator &lt;b style="mso-bidi-font-weight:normal"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;:=&lt;/i&gt;&lt;/b&gt;. The syntax is :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;    variable := value;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;so the code is :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;    area := length*width;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;/b&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-5-program-structure.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-7.html"&gt;Next&lt;/a&gt; Tutorial&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-8083698098134318667?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/8083698098134318667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-6.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8083698098134318667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8083698098134318667'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-6.html' title='Delphi Tutorial # 6'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_kLg3mPfGL6E/S9JLRl0S2AI/AAAAAAAAAJA/nxIeBivclbs/s72-c/dpr.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-6279045526621031859</id><published>2010-04-22T18:09:00.000-07:00</published><updated>2010-04-23T18:23:47.480-07:00</updated><title type='text'>Showing the Hidden Files in Windows XP</title><content type='html'>&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Windows hides the important system files. But Some of hidden files are dangerous to our system. And we can call them viruses. Here is the way to make all hidden files shown : Run windows explorer by clicking the mouse right button on Start Menu. Then choose Explore. &lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S9JIBDeN_pI/AAAAAAAAAIw/Gkq4_WWXx-A/s1600/Tools_Folder+Options.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 196px; height: 122px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S9JIBDeN_pI/AAAAAAAAAIw/Gkq4_WWXx-A/s320/Tools_Folder+Options.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5463508480902954642" /&gt;&lt;/a&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Choose &lt;b style="mso-bidi-font-weight: normal"&gt;Tools – Folder Option&lt;/b&gt;, like the picture above. The Folder Option window will appear :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S9D0kdr39tI/AAAAAAAAAIo/fp_dHhCU9t8/s1600/folder+options+view.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 264px; height: 320px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S9D0kdr39tI/AAAAAAAAAIo/fp_dHhCU9t8/s320/folder+options+view.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5463135255281530578" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Choose &lt;b style="mso-bidi-font-weight: normal"&gt;Show hidden files and folders&lt;/b&gt;. Remove the checklist form &lt;b style="mso-bidi-font-weight:normal"&gt;Hide&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;extensions&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;for&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;known&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;file&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;type&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;Hide protected operating system files (Recommended)&lt;/b&gt;. Click Apply, then OK. Now all hidden files will be shown.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-6279045526621031859?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/6279045526621031859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/showing-hidden-files-in-windows-xp.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6279045526621031859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6279045526621031859'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/showing-hidden-files-in-windows-xp.html' title='Showing the Hidden Files in Windows XP'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/S9JIBDeN_pI/AAAAAAAAAIw/Gkq4_WWXx-A/s72-c/Tools_Folder+Options.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-5749600967698786146</id><published>2010-04-21T22:03:00.000-07:00</published><updated>2010-04-22T18:16:32.699-07:00</updated><title type='text'>Enabling Turn Off Autoplay</title><content type='html'>Windows provides &lt;b style="mso-bidi-font-weight:normal"&gt;Autoplay&lt;/b&gt; feature to examine a removable media that newly discovered by the system. It is closely like AutoRun feature. Removable media can be a flashdisk, a CD, a DVD, a memory card or an external hard disk etc.   &lt;p class="MsoNormal" style="text-align:justify"&gt;But this feature has a disadvantage. If the removable media connected to the computer is infected by some viruses, the virus will be automatically loaded to memory, or even your system will be automatically infected. Virus is usually an &lt;b style="mso-bidi-font-weight: normal"&gt;executable hidden file&lt;/b&gt;. And in a certain way will be automatically executed when a media or a directory / folder&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;is being connected to the system. Usually by using an &lt;b style="mso-bidi-font-weight:normal"&gt;autorun.inf&lt;/b&gt; file.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To avoid this, we have to enable Turn Off Autoplay feature. From Start Up menu, choose Run. Type &lt;b style="mso-bidi-font-weight:normal"&gt;gpedit.msc&lt;/b&gt; then click OK.&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S8_ZD32xZJI/AAAAAAAAAHo/Js4PhMaT1MU/s1600/RUN.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 165px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S8_ZD32xZJI/AAAAAAAAAHo/Js4PhMaT1MU/s320/RUN.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5462823533580215442" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The Group Policy window will appear :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S8_aZwzgxAI/AAAAAAAAAIA/jCsZsMfcgKk/s1600/Group+Policy+window.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 229px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S8_aZwzgxAI/AAAAAAAAAIA/jCsZsMfcgKk/s320/Group+Policy+window.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5462825009156244482" /&gt;&lt;/a&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;There are two configuration : &lt;b style="mso-bidi-font-weight:normal"&gt;Computer Configuration&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;User Configuration&lt;/b&gt;. Form Computer Configuration, choose &lt;b style="mso-bidi-font-weight:normal"&gt;Administrative Templates&lt;/b&gt; - &lt;b style="mso-bidi-font-weight:normal"&gt;System&lt;/b&gt;, then choose &lt;b style="mso-bidi-font-weight:normal"&gt;Turn&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;off&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;Autoplay&lt;/b&gt; as the picture shown below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S8_aySeb8ZI/AAAAAAAAAII/RiTOAhJ3qSM/s1600/comp+configuration+autoplay.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 229px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S8_aySeb8ZI/AAAAAAAAAII/RiTOAhJ3qSM/s320/comp+configuration+autoplay.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5462825430511514002" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Then Turn off Autoplay Properties window will appear. Choose &lt;b style="mso-bidi-font-weight:normal"&gt;Enabled&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;All&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;drives&lt;/b&gt;. Then click &lt;b style="mso-bidi-font-weight:normal"&gt;Apply – OK&lt;/b&gt; :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S8_bDCTpLzI/AAAAAAAAAIQ/TQCfX8YO8F0/s1600/turn+off+autoplay+properties.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 289px; height: 320px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S8_bDCTpLzI/AAAAAAAAAIQ/TQCfX8YO8F0/s320/turn+off+autoplay+properties.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5462825718229053234" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You also have to do these steps for User Configuration. Choose &lt;b style="mso-bidi-font-weight:normal"&gt;Administrative&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;Templates&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;- System&lt;/b&gt;, then choose &lt;b style="mso-bidi-font-weight:normal"&gt;Turn&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;off&lt;/b&gt; &lt;b style="mso-bidi-font-weight: normal"&gt;Autoplay&lt;/b&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;as the picture shown below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S8_bpnfticI/AAAAAAAAAIY/nxOnugKT9yU/s1600/user+configuration+autoplay.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 229px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S8_bpnfticI/AAAAAAAAAIY/nxOnugKT9yU/s320/user+configuration+autoplay.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5462826381046811074" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Choose &lt;b style="mso-bidi-font-weight: normal"&gt;Enabled&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;All&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;drives&lt;/b&gt;. Then click &lt;b style="mso-bidi-font-weight: normal"&gt;Apply – OK&lt;/b&gt;.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Once the Turn Off Autoplay feature has been enabled, just remember &lt;b style="mso-bidi-font-weight:normal"&gt;do not&lt;/b&gt; ever double click a folder or a media that is infected by viruses. It is more save to use Windows Explorer, by clicking the mouse right button on &lt;b style="mso-bidi-font-weight:normal"&gt;Start Menu&lt;/b&gt;, then choose &lt;b style="mso-bidi-font-weight:normal"&gt;Explorer&lt;/b&gt;. In this way, the hidden viruses will not be executed. It will decrease the risk of viral infection to your system. Then all you have to do is deleting suspicious hidden files. But before you can do this, you have to make &lt;a href="http://123codegenerator.blogspot.com/2010/04/showing-hidden-files-in-windows-xp.html"&gt;all the hidden files shown&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-5749600967698786146?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/5749600967698786146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/enabling-turn-off-autoplay.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/5749600967698786146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/5749600967698786146'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/enabling-turn-off-autoplay.html' title='Enabling Turn Off Autoplay'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/S8_ZD32xZJI/AAAAAAAAAHo/Js4PhMaT1MU/s72-c/RUN.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-4734048242998440535</id><published>2010-04-14T18:24:00.000-07:00</published><updated>2010-05-16T21:03:36.378-07:00</updated><title type='text'>Delphi Tutorial # 5</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;strong&gt;Program Structure&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;A program is composed of three elements :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;- Program Title&lt;/p&gt;  &lt;p class="MsoNormal"&gt;- Uses Clauses&lt;/p&gt;  &lt;p class="MsoNormal"&gt;- Declarations and Statements&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Program title is the name of the program. Uses clauses include units that are used in the program. Declarations and statements are codes that will be executed by computer.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can see an example of &lt;st1:place&gt;Delphi&lt;/st1:place&gt; program structure in Delphi Tutorial # 2. See the codes &lt;b style="mso-bidi-font-weight: normal"&gt;project1.dpr &lt;/b&gt;file&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;below :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    program Project1;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    uses&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    Forms,&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    Unit1 in 'Unit1.pas' {MyForm};&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    {$R *.RES}&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    begin&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    Application.Initialize;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    Application.CreateForm(TMyForm, MyForm);&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    Application.Run;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    end.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The example above does not have declarations. Declaration is where we define constants, types, variables, procedures and functions. The structure of declarations is shown below :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;     Const&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;           &lt;/span&gt;{&lt;i style="mso-bidi-font-style: normal"&gt;constants list}&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;     Type&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;          {&lt;/span&gt;&lt;i style="mso-bidi-font-style:normal"&gt;types create by user}&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;     Var&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;          {&lt;/span&gt;&lt;i style="mso-bidi-font-style:normal"&gt;variables list}&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;span style="mso-spacerun:yes"&gt;         {&lt;/span&gt;&lt;i style="mso-bidi-font-style:normal"&gt;functions and procedures}&lt;/i&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;Function is a routine that can be called by the program and will return a value. Procedure is a routine that does not return a value.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;A program is usually formed by some source code modules that called units. A unit consist some routine (functions and procedures). It is saved as a unit file (.PAS). The structure of a unit is shown below :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;       Unit&lt;/b&gt; &lt;i style="mso-bidi-font-style:normal"&gt;unitname&lt;/i&gt;;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;       Interface &lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;       Uses &lt;/b&gt;{&lt;i style="mso-bidi-font-style:normal"&gt;units&lt;/i&gt;}&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;       {&lt;i style="mso-bidi-font-style: normal"&gt;interface&lt;/i&gt;}&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;       Implementation&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;       Uses &lt;/b&gt;{&lt;i style="mso-bidi-font-style:normal"&gt;units&lt;/i&gt;}&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;      {&lt;i style="mso-bidi-font-style: normal"&gt;implementation&lt;/i&gt;}&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;       Initialization&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;       {&lt;i style="mso-bidi-font-style: normal"&gt;Initialization&lt;/i&gt;}&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;       Finalization&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;       {&lt;i style="mso-bidi-font-style: normal"&gt;Finalization&lt;/i&gt;}&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;       End.&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The example of a unit is &lt;b style="mso-bidi-font-weight:normal"&gt;unit1.pas&lt;/b&gt; file :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    unit Unit1;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    interface&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    uses&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    Windows, Messages, SysUtils, Classes, Graphics, Controls,           Forms, Dialogs, &lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;StdCtrls;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    type&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    TMyForm = class(TForm)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    Label1: TLabel;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    ExitButton: TButton;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    procedure ExitButtonClick(Sender: TObject);&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    private&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    { Private declarations }&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    public&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;{ Public declarations }&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    end;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    var&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    MyForm: TMyForm;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    implementation&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    {$R *.DFM}&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    procedure TMyForm.ExitButtonClick(Sender: TObject);&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    begin&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    Application.Terminate;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    end;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;    end.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-4-identifier-and-data.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-6.html"&gt;Next&lt;/a&gt; Tutorial&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-4734048242998440535?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/4734048242998440535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-5-program-structure.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4734048242998440535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4734048242998440535'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-5-program-structure.html' title='Delphi Tutorial # 5'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-7010385143175557178</id><published>2010-04-12T17:58:00.000-07:00</published><updated>2010-04-12T18:06:03.343-07:00</updated><title type='text'>Click and Drag Mouse to Draw a Line Using Delphi</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify" align="justify"&gt;To draw a line with click and drag method, we use some events related with mouse : OnMouseDown, OnMouseMove and OnMouseUp. OnMouseDown is an event when we push the left mouse button. OnMouseMove is when we move the cursor. And OnMouseUp is when we release the mouse button. First, prepare a user interface ( a blank form and a button) :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S8PCWVoSSfI/AAAAAAAAAHg/siGmV4_ImzY/s1600/blankform.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S8PCWVoSSfI/AAAAAAAAAHg/siGmV4_ImzY/s320/blankform.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5459420862322199026" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" align="justify"&gt;Now, you have to decide what action should be done on each event ( OnMouseDown, OnMouseMove and OnMouseUp ) :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Event&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;OnMouseDown&lt;/td&gt;&lt;td&gt;get the x and y start point&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;OnMouseMove&lt;/td&gt;&lt;td&gt; - delete the old line&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt; - draw the new line&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;OnMouseUp&lt;/td&gt;&lt;td&gt;- draw the line&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;- finish drawing&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;The complete source code is listed below :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;unit Unit1;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;interface&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;uses&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;StdCtrls;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;type&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;TForm1 = class(TForm)&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Button1: TButton;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure FormMouseDown(Sender: TObject; Button: TMouseButton;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;      &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Shift: TShiftState; X, Y: Integer);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;      &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Y: Integer);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure FormMouseUp(Sender: TObject; Button: TMouseButton;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;      &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Shift: TShiftState; X, Y: Integer);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure Button1Click(Sender: TObject);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;private&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;{ Private declarations }&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;public&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;{ Public declarations }&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Form1: TForm1;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Drawing : boolean;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;StartX, StartY, EndX, EndY : integer;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;implementation&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;{$R *.DFM}&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Shift: TShiftState; X, Y: Integer);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Drawing := true;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;StartX := x;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;StartY := y;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;EndX := x;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;EndY := y;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Y: Integer);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;if Drawing then&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;   &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Canvas.Pen.Mode := pmNotXor;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;   &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Canvas.MoveTo(StartX,StartY);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;   &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Canvas.LineTo(EndX,EndY);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;   &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Canvas.MoveTo(StartX,StartY);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;   &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Canvas.LineTo(x,y);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;EndX := x;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;EndY := y;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Canvas.Pen.Mode := pmCopy;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Shift: TShiftState; X, Y: Integer);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Canvas.MoveTo(StartX,StartY);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Canvas.LineTo(x,y);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Drawing := false;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Application.Terminate;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;Run the program, and now you can click and drag your mouse to draw a line.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-7010385143175557178?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/7010385143175557178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/click-and-drag-mouse-to-draw-line-using.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7010385143175557178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7010385143175557178'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/click-and-drag-mouse-to-draw-line-using.html' title='Click and Drag Mouse to Draw a Line Using Delphi'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_kLg3mPfGL6E/S8PCWVoSSfI/AAAAAAAAAHg/siGmV4_ImzY/s72-c/blankform.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-4890703951592201694</id><published>2010-04-11T18:30:00.000-07:00</published><updated>2010-04-18T20:51:12.823-07:00</updated><title type='text'>Delphi Tutorial # 4</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Identifier and Data Type&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;In this tutorial, we’re going to learn about Pascal Object - that serves as a basic for &lt;st1:place&gt;Delphi&lt;/st1:place&gt; – such as data type, constant and variable. And you’ll be able to declare variables in a program and use operators in a statement.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Identifier&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Identifier is used to declare constant, variable, unit, function, procedure etc. An identifier can be preceded by an underscore ( _ ), next character can be number, character string or underscore. The length of an identifier can be more than 255 characters, but only 255 first characters will be considered as an identifier. The rest characters will be ignored. Capital letter or small letter will be considered the same. And an identifier has to be non reserved word :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th colspan="4"&gt;RESERVED WORD&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;and&lt;/td&gt;&lt;td&gt;array&lt;/td&gt;&lt;td&gt;as&lt;/td&gt;&lt;td&gt;asm&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;begin&lt;/td&gt;&lt;td&gt;case&lt;/td&gt;&lt;td&gt;class&lt;/td&gt;&lt;td&gt;const&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;constructor&lt;/td&gt;&lt;td&gt;destructor&lt;/td&gt;&lt;td&gt;dispinterface&lt;/td&gt;&lt;td&gt;div&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;do&lt;/td&gt;&lt;td&gt;downto&lt;/td&gt;&lt;td&gt;else&lt;/td&gt;&lt;td&gt;end&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;except&lt;/td&gt;&lt;td&gt;exports&lt;/td&gt;&lt;td&gt;file&lt;/td&gt;&lt;td&gt;finalization&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;finally&lt;/td&gt;&lt;td&gt;for&lt;/td&gt;&lt;td&gt;function&lt;/td&gt;&lt;td&gt;goto&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;if&lt;/td&gt;&lt;td&gt;implementation&lt;/td&gt;&lt;td&gt;in&lt;/td&gt;&lt;td&gt;inherited&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;initialization&lt;/td&gt;&lt;td&gt;inline&lt;/td&gt;&lt;td&gt;interface&lt;/td&gt;&lt;td&gt;is&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;label&lt;/td&gt;&lt;td&gt;library&lt;/td&gt;&lt;td&gt;mod&lt;/td&gt;&lt;td&gt;nil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;not&lt;/td&gt;&lt;td&gt;object&lt;/td&gt;&lt;td&gt;of&lt;/td&gt;&lt;td&gt;or&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;out&lt;/td&gt;&lt;td&gt;packed&lt;/td&gt;&lt;td&gt;procedure&lt;/td&gt;&lt;td&gt;program&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;property&lt;/td&gt;&lt;td&gt;raise&lt;/td&gt;&lt;td&gt;record&lt;/td&gt;&lt;td&gt;repeat&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;resourcestring&lt;/td&gt;&lt;td&gt;set&lt;/td&gt;&lt;td&gt;shl&lt;/td&gt;&lt;td&gt;shr&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;string&lt;/td&gt;&lt;td&gt;then&lt;/td&gt;&lt;td&gt;threadvar&lt;/td&gt;&lt;td&gt;to&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;try&lt;/td&gt;&lt;td&gt;type&lt;/td&gt;&lt;td&gt;unit&lt;/td&gt;&lt;td&gt;until&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;used&lt;/td&gt;&lt;td&gt;var&lt;/td&gt;&lt;td&gt;while&lt;/td&gt;&lt;td&gt;with&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;xor&lt;/td&gt;&lt;td&gt;private&lt;/td&gt;&lt;td&gt;protected&lt;/td&gt;&lt;td&gt;public&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;published automated&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Some examples of identifier are &lt;b style="mso-bidi-font-weight:normal"&gt;sum&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal"&gt;salary&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;price&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;year&lt;/b&gt; etc. &lt;b style="mso-bidi-font-weight: normal"&gt;SALARY&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;Salary&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;salary&lt;/b&gt; are the same, because capital letter or small letter are considered the same.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Simple Data Type&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Now we’ll learn some of data types in Pascal Object. Some of them categorize in simple data type. &lt;span style="font-size:100%;"&gt;There&lt;/span&gt; are two simple data type : &lt;b style="mso-bidi-font-weight:normal"&gt;ordinal&lt;/b&gt; (integer, char, Boolean, string etc) and &lt;b style="mso-bidi-font-weight:normal"&gt;real&lt;/b&gt;. &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Integer&lt;/strong&gt;&lt;span style="'font-family:;font-size:12.0pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Range&lt;/th&gt;&lt;th&gt;Memory Size&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Byte&lt;/td&gt;&lt;td&gt;0 &lt;strong&gt;to&lt;/strong&gt; 255&lt;/td&gt;&lt;td&gt;1 byte&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Word&lt;/td&gt;&lt;td&gt;0 &lt;strong&gt;to&lt;/strong&gt; 65535&lt;/td&gt;&lt;td&gt;2 byte&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ShortInt&lt;/td&gt;&lt;td&gt;-128 &lt;strong&gt;to&lt;/strong&gt; 127&lt;/td&gt;&lt;td&gt;1 byte&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;SmallInt&lt;/td&gt;&lt;td&gt;-32768 &lt;strong&gt;to&lt;/strong&gt; 32767&lt;/td&gt;&lt;td&gt;2 byte&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Integer&lt;/td&gt;&lt;td&gt;-2147483648 &lt;strong&gt;to&lt;/strong&gt; 2147483647&lt;/td&gt;&lt;td&gt;4 byte&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Cardinal&lt;/td&gt;&lt;td&gt;0 &lt;strong&gt;to &lt;/strong&gt;2147483647&lt;/td&gt;&lt;td&gt;4 byte&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;LongInt&lt;/td&gt;&lt;td&gt;-2147483648 &lt;strong&gt;to&lt;/strong&gt; 2147483647&lt;/td&gt;&lt;td&gt;4 byte&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Char&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Memory Size&lt;/th&gt;&lt;th&gt;Saved Character&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ANSIChar&lt;/td&gt;&lt;td&gt;1 byte&lt;/td&gt;&lt;td&gt;an ANSI Char&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;WideChar&lt;/td&gt;&lt;td&gt;2 byte&lt;/td&gt;&lt;td&gt;an Unicode Char&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Char&lt;/td&gt;&lt;td&gt;1 byte&lt;/td&gt;&lt;td&gt;like an ANSIChar&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Boolean&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Range&lt;/th&gt;&lt;th&gt;Memory Size&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Boolean&lt;/td&gt;&lt;td&gt;one byte&lt;/td&gt;&lt;td&gt;1 byte&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ByteBool&lt;/td&gt;&lt;td&gt;one byte&lt;/td&gt;&lt;td&gt;1 byte&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bool&lt;/td&gt;&lt;td&gt;one word&lt;/td&gt;&lt;td&gt;2 byte&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;WordBool&lt;/td&gt;&lt;td&gt;one word&lt;/td&gt;&lt;td&gt;2 byte&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;LongBool&lt;/td&gt;&lt;td&gt;double&lt;/td&gt;&lt;td&gt;4 byte&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Real&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S8J2Lr-YDuI/AAAAAAAAAHQ/F-s6A_wiqFM/s1600/real.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 109px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S8J2Lr-YDuI/AAAAAAAAAHQ/F-s6A_wiqFM/s320/real.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5459055641481449186" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;String&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S8J2bizC10I/AAAAAAAAAHY/K15oPxZttJ8/s1600/string.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 75px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S8J2bizC10I/AAAAAAAAAHY/K15oPxZttJ8/s320/string.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5459055913895909186" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Constant and Variable&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Constant is a fixed value that is used in a program. To define a constant in a program, we use a reserved word &lt;b style="mso-bidi-font-weight:normal"&gt;const&lt;/b&gt;. Example :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;  const&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;discount = 0.1&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;or&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;  const&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;discount : real = 0.1&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;discount is a constant which value is 0.1&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;But in a program, a value is not always fixed but it can be constantly changing. To handle this, we need &lt;b style="mso-bidi-font-weight:normal"&gt;variables&lt;/b&gt;. A variable can contain a value, and the value can be changed anytime. Before we can use a variable, it has to be declared first. Use reserved word &lt;b style="mso-bidi-font-weight: normal"&gt;var&lt;/b&gt; to declare a variable :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="font-family:courier new;"&gt;  Var&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Age : byte;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Address : string;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Salary : currency;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Age is a byte variable, its value can be 0 to 255. Address is a string variable. And Salary is a currency variable.&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-3-using-edit-box.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-5-program-structure.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-4890703951592201694?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/4890703951592201694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-4-identifier-and-data.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4890703951592201694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4890703951592201694'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-4-identifier-and-data.html' title='Delphi Tutorial # 4'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/S8J2Lr-YDuI/AAAAAAAAAHQ/F-s6A_wiqFM/s72-c/real.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-492872501353885752</id><published>2010-04-09T21:04:00.000-07:00</published><updated>2010-05-13T19:08:42.875-07:00</updated><title type='text'>Delphi Tutorial # 3</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Using Edit Box&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;In this tutorial, we’re going to learn using &lt;b style="mso-bidi-font-weight:normal"&gt;Edit&lt;/b&gt; component. Edit component or &lt;b style="mso-bidi-font-weight:normal"&gt;Edit&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;box&lt;/b&gt; is in Standard page of component palette. An &lt;b style="mso-bidi-font-weight:normal"&gt;Edit&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;box&lt;/b&gt; has some properties (such as &lt;b style="mso-bidi-font-weight:normal"&gt;Enabled&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal"&gt;Name&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;Text&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;MaxLength&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal"&gt;PasswordChar&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;ReadOnly&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;Visible&lt;/b&gt; etc.) and events (such as &lt;b style="mso-bidi-font-weight:normal"&gt;OnChange&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal"&gt;OnEnter&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;OnExit&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;OnKeyPress&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal"&gt;OnKeyUp&lt;/b&gt; etc.). Below is a table of some frequently used properties :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Using Edit Boxes for counting a rectangle area&lt;/strong&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;For practicing using edit box, you need to create a form with some component like picture shown below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S7_5Ik9hPmI/AAAAAAAAAHI/OaH1mIivv_E/s1600/form.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 161px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S7_5Ik9hPmI/AAAAAAAAAHI/OaH1mIivv_E/s320/form.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5458355199152307810" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;First, change the form’s properties like table below :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Property&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;Counting Rectangle Area&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;FormRectangleArea&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Position&lt;/td&gt;&lt;td&gt;poDesktopCenter&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Add three labels into the form. And each label has properties like table below :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Label&lt;/th&gt;&lt;th&gt;Property&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Label1&lt;/td&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;Width&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Label2&lt;/td&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;Length&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Label3&lt;/td&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;Area&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Then add three edit boxes into the form. Set the properties like table below :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Label&lt;/th&gt;&lt;th&gt;Property&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Label1&lt;/td&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;Width&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Label2&lt;/td&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;Length&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Label3&lt;/td&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;Area&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The last component you need is a button, which has properties like table below :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Property&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Caption&lt;/td&gt;&lt;td&gt;&amp;amp;Count&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;CountButton&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Now, save the project into a folder with any name. Remember, that you have to save the project into a folder, because a &lt;st1:place&gt;Delphi&lt;/st1:place&gt; project contains some files. Give meaningful names for the unit and the project you created, such as UnitRectangle and ProjectRectangle. Run the program by pressing F9. If you press the button, nothing happen because we haven’t written some codes yet.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Adding the codes&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Countbutton is meant to count rectangle area by multiplying the value of width and length. To add codes, first click Countbutton. Activate the object inspector, click event tab, then double click the OnClick event. Type these codes :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure TFormRectangleArea.CountButtonClick(Sender: TObject);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;W, L, A : integer;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;W := StrToInt(Width.Text);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;L := StrToInt(Length.Text);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;A := W * L;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Area.Text := IntToStr(A);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Function &lt;b style="mso-bidi-font-weight: normal"&gt;StrToInt()&lt;/b&gt; is for converting a string value to integer, and function &lt;b style="mso-bidi-font-weight:normal"&gt;IntToStr()&lt;/b&gt; is for converting an integer value to string. An error will occur when you input a wrong width or length value. Ie : if you input 1A into width or length value, an error message will appear because 1A can not be converted into an integer value. To avoid this error, type these codes for OnKeyPress event of Width edit box and Length edit box :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure TFormRectangleArea.WidthKeyPress(Sender: TObject; var Key: Char);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;if not (key in ['0'..'9', #8]) then key := #0;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure TFormRectangleArea.LengthKeyPress(Sender: TObject;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;var Key: Char);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;if not (key in ['0'..'9', #8]) then key := #0;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The code &lt;b style="mso-bidi-font-weight: normal"&gt;if not (key in ['0'..'9', #8] then key := #0 &lt;/b&gt;will set key value to #0 (null) if the value is not in 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 or #8. #8 is Backspace.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-2-visual-programming.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-4-identifier-and-data.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-492872501353885752?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/492872501353885752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-3-using-edit-box.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/492872501353885752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/492872501353885752'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-3-using-edit-box.html' title='Delphi Tutorial # 3'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_kLg3mPfGL6E/S7_5Ik9hPmI/AAAAAAAAAHI/OaH1mIivv_E/s72-c/form.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3547539870640718354</id><published>2010-04-09T20:48:00.000-07:00</published><updated>2010-04-18T20:50:06.116-07:00</updated><title type='text'>Delphi Tutorial # 2</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;Visual Programming Concept&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;In this tutorial, we’re going to learn about basic visual programming concept. We’re going to learn how to create a form including several components.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;There are three steps of visual programming : Creating a user interface, Writing codes and Compiling code and form into an executable file (.EXE). When you run the program, &lt;st1:place&gt;Delphi&lt;/st1:place&gt; will compile your codes into an EXE file automatically.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Creating a simple project&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To create a project, first you must create a user interface. Resize the blank form into a desired size you like (you have to find out how to resize the form yourself). Set form properties like table shown below :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;My First Delphi Project&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;MyForm&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Position&lt;/b&gt;&lt;/td&gt;&lt;td&gt;poDesktopCenter&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Add a label component, it is in Standard page of component palette. Set label properties like table shown below :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;This is my first Delphi project&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Add a button component, it is also in Standard page of component palette. Set button properties like table shown below :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;Exit&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;ExitButton&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Now, we have a user interface below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S7_2mvYvgPI/AAAAAAAAAG4/heoKHzVKCuc/s1600/User+Interface.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 123px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S7_2mvYvgPI/AAAAAAAAAG4/heoKHzVKCuc/s320/User+Interface.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5458352418812035314" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Adding codes for ExitButton&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;If you want to add some codes to ExitButton, you have to determine the event when the codes will be executed. Then you can write some codes for the event. In this case you have to write some codes for OnClick event of the ExitButton. From the event tab of object inspector, select or double click the OnClick event (see the picture).&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S7_28sZVTUI/AAAAAAAAAHA/sHFRWyNxwUw/s1600/Object+Inspector.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 182px; height: 320px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S7_28sZVTUI/AAAAAAAAAHA/sHFRWyNxwUw/s320/Object+Inspector.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5458352795966328130" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Start writing the codes :&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;procedure TMyForm.ExitButtonClick(Sender: TObject)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;begin&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Application.Terminate;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;end;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You only have to type a simple code : &lt;b style="mso-bidi-font-weight:normal"&gt;Application.Terminate;&lt;/b&gt; You have to put the(;) after the statement. This code will end your application.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/03/delphi-tutorial-1-introducing-delphi.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-3-using-edit-box.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3547539870640718354?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3547539870640718354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-2-visual-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3547539870640718354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3547539870640718354'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-2-visual-programming.html' title='Delphi Tutorial # 2'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/S7_2mvYvgPI/AAAAAAAAAG4/heoKHzVKCuc/s72-c/User+Interface.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3919809549606807104</id><published>2010-04-07T18:14:00.000-07:00</published><updated>2010-04-07T18:46:38.018-07:00</updated><title type='text'>Export an Interbase Table into an MS Excel File</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;After you create an MS Excel file ( &lt;a href="http://123codegenerator.blogspot.com/2010/04/creating-excel-file-using-delphi.html"&gt;previous tutorial 1&lt;/a&gt; ) and set its attributes ( &lt;a href="http://123codegenerator.blogspot.com/2010/04/setting-attributes-of-excel-file.html"&gt;previous tutorial 2&lt;/a&gt; ), now you can export your database to an MS Excel file. Add a table component into the form ( use the previous form you have created before ). Set the properties of the table :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Active&lt;/b&gt;&lt;/td&gt;&lt;td&gt;True&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DatabaseName&lt;/b&gt;&lt;/td&gt;&lt;td&gt;ALIASMYDATA&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;MyTable&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;TableName&lt;/b&gt;&lt;/td&gt;&lt;td&gt;EMPLOYEE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;Now the form will be like the picture below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S70y4nWHl-I/AAAAAAAAAGw/0MkqSyw2uHQ/s1600/form.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S70y4nWHl-I/AAAAAAAAAGw/0MkqSyw2uHQ/s320/form.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5457574271658727394" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To start exporting data from employee table to Excel, add some codes to our &lt;a href="http://123codegenerator.blogspot.com/2010/04/setting-attributes-of-excel-file.html"&gt;previous&lt;/a&gt; project in the &lt;a href="http://123codegenerator.blogspot.com/2010/04/setting-attributes-of-excel-file.html"&gt;previous&lt;/a&gt; tutorial. See the codes below, the new added codes are bold.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;unit Unit1;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;interface&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;uses&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;StdCtrls, ComObj, Db, DBTables;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;type&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;TForm1 = class(TForm)&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;CreateExcel: TButton;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;Exit: TButton;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;MyTable: TTable;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;procedure ExitClick(Sender: TObject);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;procedure CreateExcelClick(Sender: TObject);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;private&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;{ Private declarations }&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;public&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;{ Public declarations }&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;var&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Form1: TForm1;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;implementation&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;{$R *.DFM}&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;procedure TForm1.CreateExcelClick(Sender: TObject);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;var&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;ExcelApplication : variant;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet : variant;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;column, row : integer;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;try&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;ExcelApplication := CreateOleObject('Excel.Application');&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;ExcelApplication.Visible := true;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;except&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Showmessage('Cannot create an Excel file, make sure that MS Excel is installed on your system');&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Application.Terminate;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;ExcelApplication.WorkBooks.Add(-4167);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;ExcelApplication.WorkBooks[1].WorkSheets[1].Name := 'my data';&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet := ExcelApplication.WorkBooks[1].WorkSheets['my data'];&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Range['A1:D7'].Borders.LineStyle := 7;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Range['A1:D7'].Borders.color := clblue;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Columns[1].ColumnWidth := 4;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Columns[2].ColumnWidth := 30;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Columns[3].ColumnWidth := 8;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Columns[4].ColumnWidth := 20;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Cells[1,1] := 'ID';&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Cells[1,2] := 'NAME';&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Cells[1,3] := 'AGE';&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Cells[1,4] := 'PHONE NUMBER';&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;for row := 1 to MyTable.RecordCount do&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;begin&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;for column := 1 to MyTable.FieldCount do&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;begin&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;Sheet.Cells[row+1,column] := MyTable.Fields[column-1].AsString;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;end;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;MyTable.Next;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;end;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;procedure TForm1.ExitClick(Sender: TObject);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Application.Terminate;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;end.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;Now you have an MS Excel File which consist data from employee table &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/04/setting-attributes-of-excel-file.html"&gt;Previous&lt;/a&gt; Tutorial ( Setting Attributes of an Excel File )&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3919809549606807104?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3919809549606807104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/export-interbase-table-into-ms-excel.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3919809549606807104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3919809549606807104'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/export-interbase-table-into-ms-excel.html' title='Export an Interbase Table into an MS Excel File'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_kLg3mPfGL6E/S70y4nWHl-I/AAAAAAAAAGw/0MkqSyw2uHQ/s72-c/form.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-8751458526746679321</id><published>2010-04-06T17:15:00.000-07:00</published><updated>2010-04-07T18:48:49.213-07:00</updated><title type='text'>Setting Attributes of an Excel File</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;In the &lt;a href="http://123codegenerator.blogspot.com/2010/04/creating-excel-file-using-delphi.html"&gt;previous&lt;/a&gt; tutorial ( Creating an Excel File using Delphi ), you have learned how to create an MS Excel file. Now we need to set some attributes of the MS Excel file. In an MS Excel file, a cell has some attributes ie : font, color, border etc. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To set cell border, use this code :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;ExcelApplication.WorkBooks[1].WorkSheets['my data']. Range['A1: D7'].Borders.LineStyle := 7;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Or&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Sheet.Range['A1: D7'].Borders.LineStyle := 7;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;We can replace &lt;b style="mso-bidi-font-weight:normal"&gt;ExcelApplication.WorkBooks[1].WorkSheets['my data']&lt;/b&gt; with &lt;b style="mso-bidi-font-weight:normal"&gt;Sheet&lt;/b&gt; because in the previous tutorial we have set our working worksheet into &lt;b style="mso-bidi-font-weight: normal"&gt;Sheet&lt;/b&gt; variable. The LineStyle value can be 0, 1, 2 ……13. You can try each value and see what happen to the worksheet.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal"&gt;To set cell border color :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sheet.Range['A1:D7'].Borders.color := clblue;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;To set cell font attributes :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sheet.Range['A1: D7'].Font.color := clred;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sheet.Range['A1: D7'].Font.Bold := true;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;To set columns width :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sheet.Columns[1].ColumnWidth := 4;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sheet.Columns[2].ColumnWidth := 30;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sheet.Columns[3].ColumnWidth := 8;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sheet.Columns[4].ColumnWidth := 20;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;To set rows height :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sheet.Rows[1].RowHeight := 25;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sheet.Rows[2].RowHeight:= 40;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;Entering a value to a cell&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;In MS Excel worksheet, every cell has a name like &lt;strong&gt;A1, B12, AA7, BC8&lt;/strong&gt; etc. But we can not access cells with these names. Imagine that a worksheet is a &lt;strong&gt;two dimension array of cells&lt;/strong&gt;. &lt;strong&gt;A1&lt;/strong&gt; equals to &lt;strong&gt;Cells[1,1]&lt;/strong&gt;, &lt;strong&gt;B12&lt;/strong&gt; equals to &lt;strong&gt;Cells[12,2]&lt;/strong&gt;, &lt;strong&gt;AA7&lt;/strong&gt; equals to &lt;strong&gt;Cells[7,27]&lt;/strong&gt; etc. To enter a value to A1, B1, C1 and D1 cells, use these codes :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Sheet.Cells[1,1] := 'ID';&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Sheet.Cells[1,2] := 'NAME';&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Sheet.Cells[1,3] := 'AGE';&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Sheet.Cells[1,4] := 'PHONE NUMBER';&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Now add some codes to our previous project in the &lt;a href="http://123codegenerator.blogspot.com/2010/04/creating-excel-file-using-delphi.html"&gt;previous&lt;/a&gt; tutorial. See the codes below, the new added codes are bold.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;unit Unit1;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;interface&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;uses&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;StdCtrls, ComObj;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;type&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;TForm1 = class(TForm)&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;CreateExcel: TButton;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;Exit: TButton;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;procedure ExitClick(Sender: TObject);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;procedure CreateExcelClick(Sender: TObject);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;private&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;{ Private declarations }&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;public&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;{ Public declarations }&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;var&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Form1: TForm1;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;implementation&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;{$R *.DFM}&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;procedure TForm1.CreateExcelClick(Sender: TObject);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;var&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;ExcelApplication : variant;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet : variant;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;try&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;ExcelApplication := CreateOleObject('Excel.Application');&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;ExcelApplication.Visible := true;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;except&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Showmessage('Cannot create an Excel file, make sure that MS Excel is installed on your system');&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Application.Terminate;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;ExcelApplication.WorkBooks.Add(-4167);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;ExcelApplication.WorkBooks[1].WorkSheets[1].Name := 'my data';&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet := ExcelApplication.WorkBooks[1].WorkSheets['my data'];&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Sheet.Range['A1:D7'].Borders.LineStyle := 7;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Range['A1:D7'].Borders.color := clblue;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Columns[1].ColumnWidth := 4;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Columns[2].ColumnWidth := 30;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Columns[3].ColumnWidth := 8;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Columns[4].ColumnWidth := 20;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Cells[1,1] := 'ID';&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Cells[1,2] := 'NAME';&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Cells[1,3] := 'AGE';&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sheet.Cells[1,4] := 'PHONE NUMBER';&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;procedure TForm1.ExitClick(Sender: TObject);&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;begin&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Application.Terminate;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;end;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;end.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/04/creating-excel-file-using-delphi.html"&gt;Previous&lt;/a&gt; Tutorial ( Creating an Excel File using Delphi ) &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;or &lt;a href="http://123codegenerator.blogspot.com/2010/04/export-interbase-table-into-ms-excel.html"&gt;Next&lt;/a&gt; Tutorial ( Export an Interbase Table into an MS Excel File )&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-8751458526746679321?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/8751458526746679321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/setting-attributes-of-excel-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8751458526746679321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8751458526746679321'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/setting-attributes-of-excel-file.html' title='Setting Attributes of an Excel File'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-4350871940175635837</id><published>2010-04-05T17:58:00.000-07:00</published><updated>2010-04-07T18:07:08.807-07:00</updated><title type='text'>Creating an Excel File using Delphi</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;In my opinion, knowing how to create an Excel file using &lt;st1:place&gt;Delphi&lt;/st1:place&gt; is very important. Especially when you work with a database, sometimes - not always - you need to make a report in an Excel file. To do this, you have to use &lt;b style="mso-bidi-font-weight:normal"&gt;Object Linking and Embedding (OLE)&lt;/b&gt; function. OLE function will &lt;b style="mso-bidi-font-weight:normal"&gt;link to&lt;/b&gt; or &lt;b style="mso-bidi-font-weight:normal"&gt;embed&lt;/b&gt; data from other applications (servers) in another application (the client). In this case, MS Excel is the server application and our &lt;st1:place&gt;Delphi&lt;/st1:place&gt; project is the client application.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Before we go further, create a user interface like picture below :&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S7qH87Rm2tI/AAAAAAAAAGY/A8Dw6EP4IkM/s1600/Form4CreatingExcel.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S7qH87Rm2tI/AAAAAAAAAGY/A8Dw6EP4IkM/s320/Form4CreatingExcel.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5456823379286219474" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The OLE function for creating an Excel application is :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;function CreateOleObject(const ClassName: string)&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;This function is in ComObj unit. Add this unit into the uses declaration in the program. Then type the codes below :&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;unit Unit1;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;interface&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;uses&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;StdCtrls, &lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;ComObj&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;type&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;TForm1 = class(TForm)&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;CreateExcel: TButton;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Exit: TButton;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure ExitClick(Sender: TObject);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure CreateExcelClick(Sender: TObject);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;private&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;{ Private declarations }&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;public&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;    &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;{ Public declarations }&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Form1: TForm1;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;implementation&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;{$R *.DFM}&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure TForm1.CreateExcelClick(Sender: TObject);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;ExcelApplication : variant;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Sheet : variant;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;try&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;   &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;ExcelApplication := CreateOleObject('Excel.Application');&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;   &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;ExcelApplication.Visible := true;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;except&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Showmessage('Cannot create an Excel file, make sure that MS Excel is installed on your system');&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Application.Terminate;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;ExcelApplication.WorkBooks.Add(-4167); &lt;/strong&gt;&lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;   &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;ExcelApplication.WorkBooks[1].WorkSheets[1].Name := 'my data'; &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Sheet := ExcelApplication.WorkBooks[1].WorkSheets['my data']; &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;procedure TForm1.ExitClick(Sender: TObject);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Application.Terminate;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;  &lt;/strong&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;end.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;The explanation :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Action&lt;/th&gt;&lt;th&gt;Codes&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Declare two variables : ExcelApplication and Sheet as variant&lt;/td&gt;&lt;td&gt;ExcelApplication : variant;&lt;br /&gt;Sheet : variant;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Create an MS Excel application using try…except… clause and CreateOleObject function. Then make it visible&lt;/td&gt;&lt;td&gt;ExcelApplication := CreateOleObject('Excel.Application');&lt;br /&gt;ExcelApplication.Visible := true;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Create a blank Excel workbook&lt;/td&gt;&lt;td&gt;ExcelApplication.WorkBooks.Add(-4167);&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Create a blank Excel worksheet&lt;/td&gt;&lt;td&gt;ExcelApplication.WorkBooks[1].WorkSheets[1].Name := 'my data';&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Set the working worksheet into Sheet variable&lt;/td&gt;&lt;td&gt;Sheet := ExcelApplication.WorkBooks[1].WorkSheets['my data'];&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Why do we need to set the working worksheet into &lt;b style="mso-bidi-font-weight:normal"&gt;Sheet&lt;/b&gt; variable ? It is in order to avoid typing a long character string : &lt;b style="mso-bidi-font-weight: normal"&gt;ExcelApplication.WorkBooks[1].WorkSheets['my data']&lt;/b&gt; to access the worksheet.&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/04/setting-attributes-of-excel-file.html"&gt;Next&lt;/a&gt; Tutorial ( Setting Attributes of an Excel File )&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-4350871940175635837?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/4350871940175635837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/creating-excel-file-using-delphi.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4350871940175635837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4350871940175635837'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/04/creating-excel-file-using-delphi.html' title='Creating an Excel File using Delphi'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/S7qH87Rm2tI/AAAAAAAAAGY/A8Dw6EP4IkM/s72-c/Form4CreatingExcel.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-7575598738524676536</id><published>2010-03-30T22:22:00.000-07:00</published><updated>2010-04-18T20:50:25.598-07:00</updated><title type='text'>Delphi Tutorial # 1</title><content type='html'>&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;Introducing Delphi&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;st1:place&gt;Delphi&lt;/st1:place&gt; is an application development tool in Windows platform. Using this software you can build some Windows application. With visual approach, you can create application with some codes. &lt;st1:place&gt;Delphi&lt;/st1:place&gt; based on Pascal Object language. If you are familiar with Pascal, it will be very easy to understand &lt;st1:place&gt;Delphi&lt;/st1:place&gt;. But if you don’t know Pascal, you can learn both &lt;st1:place&gt;Delphi&lt;/st1:place&gt; and Pascal in my tutorial at the same time.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;There are some words that have to be clear before we start learning &lt;st1:place&gt;Delphi&lt;/st1:place&gt;, such as &lt;b style="mso-bidi-font-weight:normal"&gt;application&lt;/b&gt;, &lt;b style="mso-bidi-font-weight: normal"&gt;form&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;component&lt;/b&gt;.&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Application&lt;/b&gt; or &lt;b style="mso-bidi-font-weight:normal"&gt;application&lt;/b&gt; &lt;b style="mso-bidi-font-weight:normal"&gt;program&lt;/b&gt; is rows of codes to be done by computer. There are two kinds of application. &lt;b style="mso-bidi-font-weight: normal"&gt;Windows application&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;console application&lt;/b&gt;. Windows application is an application that runs under Windows. Non-Windows application, such as DOS application usually called console application. Generally, a Windows application has a form, but of course an application can have some forms. When we execute a form in a program, it will become a window. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;A form usually contains some other components (a form is also a component). Label, button, edit box are components. Some components are visible. Label, button and edit box are visible components. The invisible component is called &lt;b style="mso-bidi-font-weight: normal"&gt;control&lt;/b&gt;. In &lt;st1:place&gt;Delphi&lt;/st1:place&gt;, a project contains an application, and an application contains some forms.&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Running the IDE&lt;/b&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;IDE&lt;/b&gt; or &lt;b style="mso-bidi-font-weight:normal"&gt;Integrated Development Environment&lt;/b&gt; is a part of &lt;st1:place&gt;Delphi&lt;/st1:place&gt; where we can create our application. In IDE we can visually create a user interface and write some codes.&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align:justify"&gt;We can run the Delphi IDE from start menu. The main appearance of Delphi IDE shows a new project (&lt;b style="mso-bidi-font-weight:normal"&gt;project1&lt;/b&gt;) and a form (&lt;b style="mso-bidi-font-weight:normal"&gt;form1&lt;/b&gt;). Now we will see the Delphi IDE below :&lt;/p&gt;&lt;p&gt;  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S7LdT34opsI/AAAAAAAAAFg/JV7dZkw2KH0/s1600/IDE.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 206px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S7LdT34opsI/AAAAAAAAAFg/JV7dZkw2KH0/s320/IDE.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5454665432187840194" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;Main menu contains some menus (&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;u&gt;F&lt;/u&gt;ile&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;&lt;u&gt;E&lt;/u&gt;dit&lt;/b&gt;, &lt;b style="mso-bidi-font-weight:normal"&gt;Search&lt;/b&gt;…etc)&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;Toolbar contains some icons / tools.&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;Form Window is where you design your interface visually&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;Object Inspector contains two tabs : Properties and Events&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in; mso-list:l0 level1 lfo1;tab-stops:list .5in"&gt;&lt;span style="mso-list:Ignore"&gt;-&lt;span style="'font:7.0pt"&gt;         &lt;/span&gt;&lt;/span&gt;Component Palette contains components you can place in the form.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Changing Form Properties&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;An object has some characteristics. A person has name, age, weight etc. As an object, a form also has some characteristics : name, height, width, color etc.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can change the properties of form through the object inspector. A form has fifty properties. But only some of them we often use. Now let’s change the name and the caption of&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;our form from the object inspector, and see what happen to it : &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Name : My_Form&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Caption : My First Form&lt;/p&gt;&lt;p&gt;  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S7LeL4-aRhI/AAAAAAAAAFo/33PHKmEpRKU/s1600/object+properties+1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 160px; height: 320px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S7LeL4-aRhI/AAAAAAAAAFo/33PHKmEpRKU/s320/object+properties+1.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5454666394553173522" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Why should we set a name for our form ? because if we have more than one form in our project, My_Form is more easily remembered rather than Form1, Form2……. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Saving Project&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Now we’re going to save our first project by choosing File – Save All. You must create a new folder, ie : PracticingDelphi. After you create a new folder then give a unit name and project name. &lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S7LgMkoIHaI/AAAAAAAAAF4/yI9XiOMEgfI/s1600/saving+project.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 220px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S7LgMkoIHaI/AAAAAAAAAF4/yI9XiOMEgfI/s320/saving+project.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5454668605294124450" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S7LeyJJZC0I/AAAAAAAAAFw/PaEGjqeMmxg/s1600/saving+unit.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 220px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S7LeyJJZC0I/AAAAAAAAAFw/PaEGjqeMmxg/s320/saving+unit.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5454667051729226562" /&gt;&lt;/a&gt;  &lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;And there will be some files saved in the folder :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S7LgmyzEPVI/AAAAAAAAAGA/6GugZFwUjNw/s1600/fies.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 46px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S7LgmyzEPVI/AAAAAAAAAGA/6GugZFwUjNw/s320/fies.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5454669055774702930" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;.cfg : contains project configurations&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;.dof : contains project options (linker, compiler, searching directories etc)&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;.dpr : a project file&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;.res : contains standard windows resources&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;.dfm : a form file&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;.pas : a unit resources file (Pascal object codes)&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Running Program&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;You can press F9 to run the program. And the result is only a blank windows, because we haven’t added anything to our form :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S7Lg8sGO8bI/AAAAAAAAAGI/Uov6qcjj_Ho/s1600/running+program.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S7Lg8sGO8bI/AAAAAAAAAGI/Uov6qcjj_Ho/s320/running+program.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5454669431933170098" /&gt;&lt;/a&gt;  &lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;After we run the program &lt;st1:place&gt;Delphi&lt;/st1:place&gt; create an executable file named MyProject.exe&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S7LhKj5ZvzI/AAAAAAAAAGQ/JeJy2fzPdDA/s1600/files+after+run.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 31px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S7LhKj5ZvzI/AAAAAAAAAGQ/JeJy2fzPdDA/s320/files+after+run.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5454669670250037042" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/04/delphi-tutorial-2-visual-programming.html"&gt;Next&lt;/a&gt; tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-7575598738524676536?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/7575598738524676536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/delphi-tutorial-1-introducing-delphi.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7575598738524676536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7575598738524676536'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/delphi-tutorial-1-introducing-delphi.html' title='Delphi Tutorial # 1'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_kLg3mPfGL6E/S7LdT34opsI/AAAAAAAAAFg/JV7dZkw2KH0/s72-c/IDE.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-5781357650580530033</id><published>2010-03-29T18:52:00.000-07:00</published><updated>2010-04-06T17:56:56.221-07:00</updated><title type='text'>Delphi - Interbase Tutorial # 7 : Modifying Query’s SQL Statement</title><content type='html'>&lt;p class="MsoNormal"&gt;In the previous tutorial I have shared how to use a Query component. We can modify the SQL statement in a Query. Use the previous form. Add a Label component, two Edit components and a Database component. A Database component is used for data connection, so when we run the program, the login form will appear at the first place. Our form will be like this :&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S7FaT2egVQI/AAAAAAAAAFQ/wvLW_hNiS6Q/s1600/Form+with+Database+Component.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S7FaT2egVQI/AAAAAAAAAFQ/wvLW_hNiS6Q/s320/Form+with+Database+Component.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5454239920809858306" /&gt;&lt;/a&gt;  &lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Set the properties of the new added components&lt;/p&gt;&lt;p&gt;Label1&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Edit1&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Text&lt;/b&gt;&lt;/td&gt;&lt;td&gt;"blank"&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Edit2&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Text&lt;/b&gt;&lt;/td&gt;&lt;td&gt;"blank"&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Database1&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;AliasName&lt;/b&gt;&lt;/td&gt;&lt;td&gt;ALIASMYDATA&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DatabaseName&lt;/b&gt;&lt;/td&gt;&lt;td&gt;MyDatabase&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Change the DatabaseName property of the Query&lt;/p&gt;&lt;p&gt;Label1&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DatabaseName&lt;/b&gt;&lt;/td&gt;&lt;td&gt;MyDatabase&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;Type the code below for the OnClick event of&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;the GO button :&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;begin&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; Query1.Close;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;Query1.SQL.Clear;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; Query1.SQL.Add&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;   &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;('Select * from EMPLOYEE');&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; Query1.SQL.Add&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; ('where AGE &gt;= :firstparameter');&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; Query1.SQL.Add&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; ('and AGE &lt;= :secondparameter');&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; Query1.Prepare;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; Query1.Params[0].Value := StrToInt(Edit1.Text);&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; Query1.Params[1].Value := StrToInt(Edit2.Text);&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;span style="mso-spacerun:yes"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt; Query1.Open;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;end;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;If you run the program and fill 32 in Edit1 and 35 in Edit2, you’ll get the result like this picture :&lt;p class="MsoNormal" style="text-align:justify"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S7FcOHIQ92I/AAAAAAAAAFY/rTi1Aw2l72U/s1600/result.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S7FcOHIQ92I/AAAAAAAAAFY/rTi1Aw2l72U/s320/result.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5454242021224019810" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify"&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;To modify the SQL statement in a Query component, first you have to deactivate the Query (&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;i style="mso-bidi-font-style:normal"&gt;Query1.Close;&lt;/i&gt;&lt;/b&gt;), clear the SQL statement (&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;i style="mso-bidi-font-style: normal"&gt;Query1.SQL.Clear;&lt;/i&gt;&lt;/b&gt;) and then you can add some SQL statement (&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;i style="mso-bidi-font-style:normal"&gt;Query1.SQL.Add(‘SQL statement’)&lt;/i&gt;;&lt;/b&gt;). You can type SQL statement as much as you need. If you use parameters in the SQL statement, you can name the parameters with any meaningful names. In this example I name the first parameter with firstparameter and the second one with secondparameter. Then put the actual value into params() property of the Query. I put &lt;b style="mso-bidi-font-weight: normal"&gt;StrToInt(Edit1.Text)&lt;/b&gt; into &lt;b style="mso-bidi-font-weight:normal"&gt;params(0)&lt;/b&gt; and &lt;b style="mso-bidi-font-weight:normal"&gt;StrToInt(Edit2.Text)&lt;/b&gt; into &lt;b style="mso-bidi-font-weight:normal"&gt;params(1)&lt;/b&gt;. You can also have parameters as much as you need. It begins with params(0).&lt;/p&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/03/query-delphi-interbase-tutorial-6.html"&gt;Previous&lt;/a&gt; Tutorial&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-5781357650580530033?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/5781357650580530033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/delphi-interbase-tutorial-modifying.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/5781357650580530033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/5781357650580530033'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/delphi-interbase-tutorial-modifying.html' title='Delphi - Interbase Tutorial # 7 : Modifying Query’s SQL Statement'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/S7FaT2egVQI/AAAAAAAAAFQ/wvLW_hNiS6Q/s72-c/Form+with+Database+Component.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-6465002360529928609</id><published>2010-03-23T18:32:00.000-07:00</published><updated>2010-03-29T19:08:31.186-07:00</updated><title type='text'>Delphi - Interbase Tutorial # 6 : Query</title><content type='html'>&lt;p class="MsoNormal"&gt;In &lt;st1:place&gt;Delphi&lt;/st1:place&gt;, you can also use SQL to access your data. You have to use Query component that is in the Data Access Page of the component palette. &lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;First, create a user interface like picture shown below :&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6lsks1wNzI/AAAAAAAAAE4/m-tUu0aOwtE/s1600-h/form.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6lsks1wNzI/AAAAAAAAAE4/m-tUu0aOwtE/s320/form.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5452008201676404530" /&gt;&lt;/a&gt;  &lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;Set the properties of the components&lt;/p&gt;&lt;p&gt;DataSource1&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataSet&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Query1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button1&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;G O&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;DBGrid1&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataSource&lt;/b&gt;&lt;/td&gt;&lt;td&gt;DataSource1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Query1&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DatabaseName&lt;/b&gt;&lt;/td&gt;&lt;td&gt;ALIASMYDATA&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;SQL&lt;/b&gt;&lt;/td&gt;&lt;td&gt;select * from employee where age &gt;=30&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;You have to type the SQL code in the String List editor of Query component, see the picture below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6ltdaJ9wlI/AAAAAAAAAFA/Atkdpzket9Y/s1600-h/sql+code.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 223px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6ltdaJ9wlI/AAAAAAAAAFA/Atkdpzket9Y/s320/sql+code.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5452009175913448018" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;Type the code below for the OnClick event of&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;the GO button : &lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt;Query1.Open;&lt;br /&gt;end; &lt;br /&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;What is the meaning of Query1.Open&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;?&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;p class="MsoNormal"&gt;This statement activate the Query and execute the SQL statement in SQL property of Query1. The result is like the picture shown below :&lt;/p&gt;&lt;p&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;/b&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6lw4U55zvI/AAAAAAAAAFI/PnUkWTczmT4/s1600-h/result.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6lw4U55zvI/AAAAAAAAAFI/PnUkWTczmT4/s320/result.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5452012936895254258" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal"&gt;You can also add an exit button into the user interface above.&lt;/p&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/03/create-user-interface-for-manipulating_21.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/03/delphi-interbase-tutorial-modifying.html"&gt;Next&lt;/a&gt; Tutorial&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-6465002360529928609?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/6465002360529928609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/query-delphi-interbase-tutorial-6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6465002360529928609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6465002360529928609'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/query-delphi-interbase-tutorial-6.html' title='Delphi - Interbase Tutorial # 6 : Query'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/S6lsks1wNzI/AAAAAAAAAE4/m-tUu0aOwtE/s72-c/form.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-8615251370340937349</id><published>2010-03-21T22:18:00.000-07:00</published><updated>2010-03-29T18:52:10.569-07:00</updated><title type='text'>Delphi - Interbase Tutorial # 5 : Create a user interface for manipulating table using DBEdit</title><content type='html'>&lt;p align="justify"&gt;In the previous tutorial we created a user interface for manipulating table using DBGrid. Now we’re going to create one using DBEdit. We can use our previous program. Replace the DBGrid in the previous program with some labels and DBEdits, like the picture shown below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6b-xVoURnI/AAAAAAAAAEw/finAgrhm900/s1600-h/formwithdbedit.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6b-xVoURnI/AAAAAAAAAEw/finAgrhm900/s320/formwithdbedit.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5451324522551854706" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;Set the properties of the labels and DBEdits like tables below :&lt;/p&gt;&lt;p&gt;Label1&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;ID&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Label2&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;NAME&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Label3&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;AGE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Label4&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;PHONE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;DBEdit1&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataSource&lt;/b&gt;&lt;/td&gt;&lt;td&gt;DataSource1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataField&lt;/b&gt;&lt;/td&gt;&lt;td&gt;ID&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;DBEdit2&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataSource&lt;/b&gt;&lt;/td&gt;&lt;td&gt;DataSource1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataField&lt;/b&gt;&lt;/td&gt;&lt;td&gt;NAME&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;DBEdit3&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataSource&lt;/b&gt;&lt;/td&gt;&lt;td&gt;DataSource1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataField&lt;/b&gt;&lt;/td&gt;&lt;td&gt;AGE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;DBEdit4&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataSource&lt;/b&gt;&lt;/td&gt;&lt;td&gt;DataSource1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataField&lt;/b&gt;&lt;/td&gt;&lt;td&gt;PHONENUMBER&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify" align="justify"&gt;Use the codes for the OnClick event of the buttons. Do not change the properties of Form, Table, DataSource and Buttons. Run the program, and now we can manipulate the ‘employee’ table using Buttons and DBEdits. &lt;/p&gt;&lt;p class="MsoNormal" style="text-align:justify" align="justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/03/exception-handler-delphi-interbae.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/03/query-delphi-interbase-tutorial-6.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-8615251370340937349?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/8615251370340937349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/create-user-interface-for-manipulating_21.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8615251370340937349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8615251370340937349'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/create-user-interface-for-manipulating_21.html' title='Delphi - Interbase Tutorial # 5 : Create a user interface for manipulating table using DBEdit'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/S6b-xVoURnI/AAAAAAAAAEw/finAgrhm900/s72-c/formwithdbedit.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-8491906136188008242</id><published>2010-03-17T00:22:00.000-07:00</published><updated>2010-03-17T17:33:19.045-07:00</updated><title type='text'>Free Software for Learning HTML</title><content type='html'>&lt;p class="MsoNormal"&gt;(&lt;a href="http://www.ziddu.com/download/8973926/LearningHTML.rar.html"&gt;Download Here&lt;/a&gt;)&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-size:100%;"&gt;When we learn HTML (Hyper Text Markup Language), we need a text editor, such as Notepad and a browser. Once we have finished writing some HTML codes, we save the codes in a file with .html extension. Then we run an internet browser to see if the codes run well or not. If it doesn’t, we go to the text editor and modify our HTML codes then try it in the browser again and so on. This makes me inconvenience. So I try to make it more convenient by creating a program that can free me from this to and fro situation.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify" align="justify"&gt;Using this software we can get the result of HTML codes instantly by clicking RUN button. Type the HTML codes in the left window, and the result is in the right window.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6CDwAY3OFI/AAAAAAAAAEY/JIX5lK5lcNo/s1600-h/1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6CDwAY3OFI/AAAAAAAAAEY/JIX5lK5lcNo/s320/1.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5449500409879541842" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify;line-height:150%"&gt;type the HTML codes below, in the left window :&lt;/p&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&amp;lt;a href="http://www.google.com"&amp;gt;Google.com&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&amp;lt;a href="http://www.yahoo.com"&amp;gt;Yahoo.com&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&amp;lt;a href="http://www.123codegenerator.blogspot.com"&amp;gt;Download This Software Here&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;p&gt;  &lt;p class="MsoNormal" style="text-align:justify"&gt;then click &lt;u&gt;R&lt;/u&gt;un to see the result&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6CEll7tycI/AAAAAAAAAEg/Kdd59fCZbrc/s1600-h/2.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S6CEll7tycI/AAAAAAAAAEg/Kdd59fCZbrc/s320/2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5449501330490902978" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S6CE7RNDbrI/AAAAAAAAAEo/bTYx0jnCePc/s1600-h/3.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S6CE7RNDbrI/AAAAAAAAAEo/bTYx0jnCePc/s320/3.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5449501702883602098" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;You can get this free software &lt;a href="http://www.ziddu.com/download/8973926/LearningHTML.rar.html"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-8491906136188008242?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/8491906136188008242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/free-software-for-learning-html.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8491906136188008242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8491906136188008242'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/free-software-for-learning-html.html' title='Free Software for Learning HTML'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/S6CDwAY3OFI/AAAAAAAAAEY/JIX5lK5lcNo/s72-c/1.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-234971333508969550</id><published>2010-03-09T16:49:00.000-08:00</published><updated>2010-03-29T18:51:45.542-07:00</updated><title type='text'>Delphi - Interbase Tutorial # 4 : Exception Handler</title><content type='html'>&lt;p&gt;In the &lt;a href="http://123codegenerator.blogspot.com/2010/03/create-user-interface-for-manipulating.html"&gt;previous tutorial&lt;/a&gt;, an error occur when you try to delete a record in ‘employee’ table. It is because of the ‘salary’ table refers to the record. An error message will appear. To avoid this, we’re going to create an exception handle. &lt;/p&gt;&lt;p&gt;Let’s see what kind of error will happen if we try to delete a record in ‘employee’ table. Run the program from Delphi IDE (not the executable file). You’ll see the error message below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S5bvP-2AiCI/AAAAAAAAAEI/BMwkkCSEwo4/s1600-h/error+message.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 73px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S5bvP-2AiCI/AAAAAAAAAEI/BMwkkCSEwo4/s320/error+message.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5446803857197795362" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;From the message, the exception that raised is EDBEngineError. Let’s see our code for OnClick event of Delete button. You have to add an exception handle code using TRY…..EXCEPT :&lt;/p&gt;&lt;p&gt;procedure TForm1.DeleteClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt; try&lt;br /&gt;  Table1.Delete;&lt;br /&gt; except&lt;br /&gt;  on EDBEngineError do&lt;br /&gt;   begin&lt;br /&gt;    MessageDlg('You can not delete this record because another table is currently using the data',&lt;br /&gt;              mtError,[mbOK],0)&lt;br /&gt;   end;&lt;br /&gt; end;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;Then if you run the program and try to delete a record in ‘employee’ table that a record in ‘salary’ table refers to it, you’ll get a message like picture below :&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S5bvyPQ133I/AAAAAAAAAEQ/e89Lyi6xslA/s1600-h/exception+handler.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 86px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S5bvyPQ133I/AAAAAAAAAEQ/e89Lyi6xslA/s320/exception+handler.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5446804445720862578" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/03/create-user-interface-for-manipulating.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/03/create-user-interface-for-manipulating_21.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-234971333508969550?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/234971333508969550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/exception-handler-delphi-interbae.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/234971333508969550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/234971333508969550'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/exception-handler-delphi-interbae.html' title='Delphi - Interbase Tutorial # 4 : Exception Handler'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_kLg3mPfGL6E/S5bvP-2AiCI/AAAAAAAAAEI/BMwkkCSEwo4/s72-c/error+message.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-9195154632916599866</id><published>2010-03-04T18:18:00.000-08:00</published><updated>2010-03-29T18:50:43.841-07:00</updated><title type='text'>Delphi - Interbase Tutorial # 3 : Create a user interface for manipulating table without DBNavigator</title><content type='html'>&lt;p&gt;In the previous tutorial we have created a tiny user interface for manipulating table. Now we’re going to create a user interface without using a DBNavigator. If there is no DBNavigator, how do we manipulate our table ?. We’re going to use some buttons and codes to manipulate our table. Let’s see our blank form, add some components into it : a DBGrid, a Table, a DataSource, ten Buttons (Button1……Button10)&lt;/p&gt;&lt;p&gt;Set the properties of our components :&lt;/p&gt;&lt;p&gt;Form&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;EMPLOYEE TABLE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Table&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Active&lt;/b&gt;&lt;/td&gt;&lt;td&gt;True&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DatabaseName&lt;/b&gt;&lt;/td&gt;&lt;td&gt;ALIASMYDATA&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;TableName&lt;/b&gt;&lt;/td&gt;&lt;td&gt;EMPLOYEE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;DataSource&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataSet&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Table1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button1&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;First&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;First&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button2&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;Last&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Last&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button3&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;Previous&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Previous&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button4&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;Next&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Next&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button5&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;Add&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Add&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button6&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;Edit&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Edit&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button7&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;Save&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Save&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button8&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;Cancel&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Cancel&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button9&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;Delete&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Delete&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button10&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;E&amp;amp;xit&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Exit&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Now our form appears like the picture below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S5Bqx0WCROI/AAAAAAAAAD4/SR3HtR-vQ10/s1600-h/Form+with+components2.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S5Bqx0WCROI/AAAAAAAAAD4/SR3HtR-vQ10/s320/Form+with+components2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5444969353588131042" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Type the code for the OnClick event of  the buttons :&lt;br /&gt;&lt;br /&gt;procedure TForm1.ExitClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt; Application.Terminate;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.FirstClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt; Table1.First;&lt;em&gt;{go to the first record}&lt;/em&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.LastClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt; Table1.Last;&lt;em&gt;{go to the last record}&lt;/em&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.PreviousClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt; Table1.Prior;&lt;em&gt;{go to the previous record}&lt;/em&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.NextClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt; Table1.Next;&lt;em&gt;{go to the next record}&lt;/em&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.AddClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt; Table1.Append;&lt;em&gt;{insert new record }&lt;/em&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.EditClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt; Table1.Edit;&lt;em&gt;{edit existing record }&lt;/em&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.SaveClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt; Table1.Post;&lt;em&gt;{save record }&lt;/em&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.CancelClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt; Table1.Cancel;&lt;em&gt;{cancel record }&lt;/em&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.DeleteClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt; Table1.Delete;&lt;em&gt;{delete record }&lt;/em&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;To insert data we can use Table1.Append or Table1.Insert procedure. Find out yourself, the different between these two procedures.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Run the program. You can navigate and manipulating employee table by clicking the button. Notice that you can not delete any record in ‘employee’ table, because there another table that refers to ‘id’ column value of table employee. If you try to click Delete button, an error message will be appear :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S5BrUuYpLTI/AAAAAAAAAEA/pPAaTmSsm7g/s1600-h/error+message.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 101px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S5BrUuYpLTI/AAAAAAAAAEA/pPAaTmSsm7g/s320/error+message.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5444969953283878194" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;In the next tutorial I will show you how to handle this exception.&lt;/p&gt;&lt;p&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/03/delphi-interbase-tutorial-1.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/03/exception-handler-delphi-interbae.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-9195154632916599866?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/9195154632916599866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/create-user-interface-for-manipulating.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/9195154632916599866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/9195154632916599866'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/create-user-interface-for-manipulating.html' title='Delphi - Interbase Tutorial # 3 : Create a user interface for manipulating table without DBNavigator'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_kLg3mPfGL6E/S5Bqx0WCROI/AAAAAAAAAD4/SR3HtR-vQ10/s72-c/Form+with+components2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-1339911053127929823</id><published>2010-03-01T17:12:00.000-08:00</published><updated>2010-03-29T18:50:09.532-07:00</updated><title type='text'>Delphi - Interbase Tutorial # 2 : Create a user interface for manipulating table</title><content type='html'>&lt;p&gt;After we create an alias name for our database, we’re going to create a tiny user interface for manipulating and retrieving the tables in the database. Run Delphi from start menu, you’ll have a project with a form. Add a &lt;strong&gt;Button&lt;/strong&gt;, a &lt;strong&gt;DBgrid&lt;/strong&gt;, a &lt;strong&gt;DBNavigator&lt;/strong&gt;, a &lt;strong&gt;Table&lt;/strong&gt; and a &lt;strong&gt;DataSource&lt;/strong&gt;.&lt;/p&gt;&lt;p align="justify"&gt;Button component is in the Standard page of component palette. DBGrid and DBNavigator are in Data Controls page of component palette. Table and DataSource are in the Data Access page of component palette Then set the properties as the table shown below :&lt;/p&gt;&lt;p align="justify"&gt;Form&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;EMPLOYEE TABLE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Button&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Caption&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&amp;amp;Exit&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Exit&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Table&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Active&lt;/b&gt;&lt;/td&gt;&lt;td&gt;True&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DatabaseName&lt;/b&gt;&lt;/td&gt;&lt;td&gt;ALIASMYDATA&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;TableName&lt;/b&gt;&lt;/td&gt;&lt;td&gt;EMPLOYEE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;DataSource&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataSet&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Table1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;DBGrid&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataSource&lt;/b&gt;&lt;/td&gt;&lt;td&gt;DataSource1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;DB Navigator&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;DataSource&lt;/b&gt;&lt;/td&gt;&lt;td&gt;DataSource1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Now our form appears like the picture below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S4xpGoyqkXI/AAAAAAAAADw/xckgWoTxPZE/s1600-h/Form+with+components.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S4xpGoyqkXI/AAAAAAAAADw/xckgWoTxPZE/s320/Form+with+components.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5443841612334141810" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Type the code for the OnClick event of  Exit button :&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;    procedure TForm1.ExitClick(Sender: TObject);&lt;br /&gt;    begin&lt;br /&gt;     Application.Terminate;&lt;br /&gt;    end;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Run the program. You can navigate and manipulate employee table using DBNavigator. To exit program click the Exit button.&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/borland-database-engine.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/03/create-user-interface-for-manipulating.html"&gt;Next&lt;/a&gt; Tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-1339911053127929823?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/1339911053127929823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/delphi-interbase-tutorial-1.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1339911053127929823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1339911053127929823'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/03/delphi-interbase-tutorial-1.html' title='Delphi - Interbase Tutorial # 2 : Create a user interface for manipulating table'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/S4xpGoyqkXI/AAAAAAAAADw/xckgWoTxPZE/s72-c/Form+with+components.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-1594900117628890955</id><published>2010-02-26T20:15:00.000-08:00</published><updated>2010-03-29T18:49:21.185-07:00</updated><title type='text'>Delphi - Interbase Tutorial # 1 : Borland Database Engine</title><content type='html'>&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:100%;"&gt;Connecting Interbase Database Using BDE (Borland Database Engine)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p align="justify"&gt;Manipulating and retrieving a database using some SQL codes is such a nightmare for me. But it does not mean that my previous &lt;strong&gt;Interbase Tutorials&lt;/strong&gt; are useless. For database programmer, knowing SQL is a must. But the users do not need to know about SQL.&lt;/p&gt;&lt;p align="justify"&gt;Now, I am going to share how to create user interface for manipulating, retrieving and maintaining a database. We can use any development tools to create the interface, but in this tutorial I use Delphi.&lt;/p&gt;&lt;p align="justify"&gt;Before we start working with Delphi, we have to make an alias of the database. There many method of connecting database, but we’re going to use &lt;strong&gt;BDE (Borland Database Engine)&lt;/strong&gt;. After we start BDE Administrator from start menu, the main window will appear :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S4ic8rP3KNI/AAAAAAAAADI/nMS1mlVoXVA/s1600-h/main.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 154px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S4ic8rP3KNI/AAAAAAAAADI/nMS1mlVoXVA/s320/main.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5442772715892582610" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;You can start creating a new connection by choosing Object – New&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S4idUS8K2cI/AAAAAAAAADQ/I_RT9ADtsrg/s1600-h/file-new.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 154px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S4idUS8K2cI/AAAAAAAAADQ/I_RT9ADtsrg/s320/file-new.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5442773121684396482" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Choose the Interbase as database driver, then press OK :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S4idooX_22I/AAAAAAAAADY/Bd37wAYQaDk/s1600-h/new+database+alias.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 254px; height: 178px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S4idooX_22I/AAAAAAAAADY/Bd37wAYQaDk/s320/new+database+alias.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5442773471035644770" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;You’ll get an alias name &lt;strong&gt;INTERBASE1&lt;/strong&gt; (see the picture below)&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S4ieMcaGS1I/AAAAAAAAADg/kEAQ3rkPbTE/s1600-h/interbase1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 154px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S4ieMcaGS1I/AAAAAAAAADg/kEAQ3rkPbTE/s320/interbase1.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5442774086298520402" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;You can rename the alias name. In this case we use the alias name : &lt;strong&gt;ALIASMYDATA&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S4ie2vfDFpI/AAAAAAAAADo/epJhUbVQkhI/s1600-h/apply.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 154px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S4ie2vfDFpI/AAAAAAAAADo/epJhUbVQkhI/s320/apply.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5442774812974061202" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Fill in the SERVER NAME the location of our database :  &lt;strong&gt;C:\mydata\MYDATA.GDB&lt;/strong&gt;&lt;br /&gt;And USER NAME : &lt;strong&gt;NEW_USER&lt;/strong&gt;&lt;br /&gt;If our database located in a remote computer, we have to put the computer / server name. Use slash not back slash : &lt;strong&gt;server_name:/mydata/MYDATA.GDB&lt;/strong&gt;&lt;br /&gt;Then click apply as the picture above.&lt;br /&gt;Now we have an alias for MYDATA.GBD. The user interface we’re going to develop using Delphi have to be connected to the alias : ALIASMYDATA&lt;br /&gt;&lt;br /&gt;To test the connection choose &lt;strong&gt;File – Diagnostics&lt;/strong&gt;. The Communication diagnostic Tool window will appear. Type the password, then click Test. If the connection work, you’ll get the results message that InterBase Communication Test Passed!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-15.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/03/delphi-interbase-tutorial-1.html"&gt;Next&lt;/a&gt; tutorial&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-1594900117628890955?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/1594900117628890955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/borland-database-engine.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1594900117628890955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/1594900117628890955'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/borland-database-engine.html' title='Delphi - Interbase Tutorial # 1 : Borland Database Engine'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_kLg3mPfGL6E/S4ic8rP3KNI/AAAAAAAAADI/nMS1mlVoXVA/s72-c/main.jpg' height='72' width='72'/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3228341528318281094</id><published>2010-02-26T18:33:00.000-08:00</published><updated>2010-03-07T19:31:57.457-08:00</updated><title type='text'>Stored Procedures ( Interbase Tutorial # 15 )</title><content type='html'>&lt;p&gt;Every programming language allows programmers to create procedures, if it doesn’t, we can call it a bad programming language. A stored procedure is a program to be stored in the database server. And it can be called or run manually by other program. &lt;/p&gt;&lt;p align="justify"&gt;A stored procedure contains &lt;strong&gt;header&lt;/strong&gt; and &lt;strong&gt;body&lt;/strong&gt;. Header contains &lt;strong&gt;procedure name&lt;/strong&gt;, &lt;strong&gt;input parameter(s)&lt;/strong&gt; and &lt;strong&gt;output parameter(s)&lt;/strong&gt;. Body contains &lt;strong&gt;local variable(s)&lt;/strong&gt; ( optional )  and &lt;strong&gt;a block of  statements&lt;/strong&gt;.&lt;/p&gt;&lt;p align="justify"&gt;To be clear, let’s see the table below :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td rowspan="5"&gt;A Stored Procedure&lt;/td&gt;&lt;td rowspan="3"&gt;Header&lt;/td&gt;&lt;td&gt;Procedure Name&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Input Parameter(s)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Output Parameter(s)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Body&lt;/td&gt;&lt;td&gt;Local Variable(s)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;A Block of Statements&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;The general syntax of a stored procedure is :&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  CREATE PROCEDURE procedure_name (input_variable(s) data_type(s))&lt;br /&gt;  RETURNS (output_variable(s) data_type(s))&lt;br /&gt;  AS&lt;br /&gt;   BEGIN&lt;br /&gt;     Local variable(s)&lt;br /&gt;     A block of Statements if procedure and trigger language&lt;br /&gt;   END&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Example :&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In the previous tutorial we have learnt how to retrieve data using SELECT. Let us review again how to get employee’s name whose age is above 27. The statement is :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    select name from employee where age&gt;27&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The output is :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;NAME                           &lt;br /&gt;============= &lt;br /&gt;Isaac Newton               &lt;br /&gt;Archimedes                 &lt;br /&gt;Frank Borland              &lt;br /&gt;Max Planck&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Now we can get same output, but this time we’re going to create a procedure. The procedure will be :&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  create procedure get_name (employee_age integer)&lt;br /&gt;  returns (employee_name char(30))&lt;br /&gt;  as&lt;br /&gt;  begin&lt;br /&gt;     for select name&lt;br /&gt;             from employee&lt;br /&gt;             where age &gt; :employee_age&lt;br /&gt;             into :employee_name&lt;br /&gt;     do&lt;br /&gt;            suspend;&lt;br /&gt;  end&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;suspend send the value back to the calling application ( Interbase Windows ISQL )&lt;/p&gt;&lt;p&gt;Execute the procedure above in the SQL windows. Now execute this blow statement :&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    select * from get_name(27)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;You’ll get the same output :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;NAME                           &lt;br /&gt;============= &lt;br /&gt;Isaac Newton               &lt;br /&gt;Archimedes                 &lt;br /&gt;Frank Borland              &lt;br /&gt;Max Planck&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Using Local Variables&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Let us modify the procedure above using a local variable&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;  create procedure get_name_line (employee_age integer)&lt;br /&gt;  returns (line_number integer, employee_name char(30))&lt;br /&gt;  as&lt;br /&gt;  begin&lt;br /&gt;   line_number = 0;&lt;br /&gt;    for select name&lt;br /&gt;             from employee&lt;br /&gt;             where age &gt; :employee_age&lt;br /&gt;             into :employee_name&lt;br /&gt;    do&lt;br /&gt;       begin&lt;br /&gt;          line_number=line_number+1;&lt;br /&gt;          suspend;&lt;br /&gt;      end&lt;br /&gt;  end&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;after you execute the procedure, you can try this statement below :&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    select * from get_name_line(27)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The output is :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;LINE_NUMBER       EMPLOYEE_NAME                  &lt;br /&gt;============================== &lt;br /&gt;                    1            Isaac Newton &lt;br /&gt;                    2             Archimedes                 &lt;br /&gt;                    3    Frank Borland &lt;br /&gt;                    4    Max Planck&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-14.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/borland-database-engine.html"&gt;Next&lt;/a&gt; Tutorial&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3228341528318281094?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3228341528318281094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-15.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3228341528318281094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3228341528318281094'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-15.html' title='Stored Procedures ( Interbase Tutorial # 15 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-6112239438771568622</id><published>2010-02-26T18:17:00.000-08:00</published><updated>2010-03-07T19:31:44.456-08:00</updated><title type='text'>Access Privileges ( Interbase Tutorial # 14 )</title><content type='html'>&lt;p&gt;So far we have learnt how to develop a database. But only the owner of the database ( in this case NEW_USER ) and SYSDBA can access the database. Some other users may use the database. We can grant some privileges to these users, so they can retrieve or manipulate the table.&lt;/p&gt;&lt;p align="justify"&gt;Before we start learning about access privileges, you need to create a new user. You can see how to create a new user in my &lt;a href="http://123codegenerator.blogspot.com/2010/01/interbase-tutorial-1.html"&gt;first tutorial&lt;/a&gt;. Let’s name the new user OTHER_USER, and you can give any password you want for this user.&lt;/p&gt;&lt;p align="justify"&gt;Now there are three users in your interbase server : SYSDBA, NEW_USER and OTHER_USER. SYSDBA can access the database created by NEW_USER, but OTHER_USER can’t. If you want OTHER_USER to retrieve or manipulate your database, you have to give some privileges to this user.&lt;/p&gt;&lt;p align="justify"&gt;You can see the available access privileges in the table below :&lt;/p&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;SELECT&lt;/td&gt;&lt;td&gt;Read data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DELETE&lt;/td&gt;&lt;td&gt;Delete data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;INSERT&lt;/td&gt;&lt;td&gt;Write new data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;UPDATE&lt;/td&gt;&lt;td&gt;Modify existing data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;REFERENCES&lt;/td&gt;&lt;td&gt;Create a table with a foreign key refers to the primary key&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;EXECUTE&lt;/td&gt;&lt;td&gt;Call stored procedures&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ALL&lt;/td&gt;&lt;td&gt;SELECT, DELETE, INSERT, UPDATE and REFERENCES&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ROLE&lt;/td&gt;&lt;td&gt;All privileges assigned to the ROLE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;strong&gt;Giving Access privileges using GRANT&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The syntax is :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    GRANT privilege(s) ON table TO user&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Example : We want to give SELECT privilege on ‘employee’ table to OTHER_USER, so OTHER_USER can retrieve the database. The statement will be :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    grant select on employee to other_user&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;With Grant Option&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;We can use WITH GRANT OPTION clause to allow the user to give the privileges we’ve given to other users.&lt;/p&gt;&lt;p&gt;Example : &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    grant select, delete on employee to other_user&lt;br /&gt;    with grant option&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Revoking Privileges&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;We can also revoke the privileges we’ve given to a user. The syntax is :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    REVOKE privilege(s) ON table FROM user&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Example : We want to revoke SELECT privilege on ‘employee’ table from OTHER_USER. The statement will be :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    revoke select on employee from other_user&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;ROLE&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;If you want to give one or more privileges to some user using GRANT, you will type a lot of GRANT statement. You can create a ROLE to reduce the statement you type. A ROLE can contain one or more privileges. Follow these steps below to create and grant a ROLE to users :&lt;/p&gt;&lt;p&gt;- Define a ROLE &lt;br /&gt;   The syntax : CREATE ROLE role_name&lt;br /&gt;- Inserting privileges to the ROLE&lt;br /&gt;   The syntax : GRANT privileges(s) ON table TO role_name&lt;br /&gt;- Granting ROLE to users&lt;br /&gt;   GRANT role_name TO user(s)&lt;/p&gt;&lt;p&gt;Example :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    create ROLE myrole&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    grant select, update, insert, delete on employee to myrole&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    grant myrole to other_user&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-13.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-15.html"&gt;Next&lt;/a&gt; Tutorial&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-6112239438771568622?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/6112239438771568622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-14.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6112239438771568622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/6112239438771568622'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-14.html' title='Access Privileges ( Interbase Tutorial # 14 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-7425922395014986952</id><published>2010-02-21T17:25:00.000-08:00</published><updated>2010-03-07T19:31:26.428-08:00</updated><title type='text'>String Operator and Converting Uppercase ( Interbase Tutorial # 13 )</title><content type='html'>&lt;p&gt;&lt;strong&gt;String Operator&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;We can also join two or more character strings into a single string using string operator. The string to be joined can be the value of a column we retrieve, or we may add some character strings. The operator for joining some character strings is || .&lt;/p&gt;&lt;p&gt;Execute these some SQL statements below :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    &lt;strong&gt;select name || ‘ is ’ || age || ‘ years old’ from employee&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;and we’ll get the data output :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;================================== &lt;br /&gt;Isaac Newton is 30 years old                             &lt;br /&gt;Blaise Pascal is 25 years old                            &lt;br /&gt;Archimedes is 32 years old                               &lt;br /&gt;George Boole is 27 years old                             &lt;br /&gt;Frank Borland is 31 years old                            &lt;br /&gt;Max Planck is 28 years old&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;select ’Boolean Algebra is developed by ‘ || name from employee&lt;br /&gt;    where name=’George Boole’&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;the output is :&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;==================================== &lt;br /&gt;Boolean Algebra is developed by George Boole&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;select  name || ‘ earns USD ‘ || totalsalary || ‘ per month’&lt;br /&gt;from employee, salary&lt;br /&gt;where id=employee_id&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;the output is :&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;================================ &lt;br /&gt;Isaac Newton earns USD 1100 per month                           &lt;br /&gt;Blaise Pascal earns USD 2200 per month                          &lt;br /&gt;Archimedes earns USD 3300 per month                             &lt;br /&gt;George Boole earns USD 4400 per month   &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;select ‘The highest salary is USD ‘ || max(totalsalary)&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;from salary&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;the output is :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;====================================== &lt;br /&gt;The highest salary is USD 4400&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;select ‘The total expense for salary is USD ‘ || sum(totalsalary)   from salary&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;the output is :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;================================================ &lt;br /&gt;The total expense for salary is USD 11000&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Now you can try another combinations of some character strings.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Converting Uppercase&lt;/strong&gt;&lt;/p&gt;&lt;p align="justify"&gt;To convert character values to uppercase, we use UPPER function. When you create a domain, use CHECK constraint to ensure that the value you enter is always in uppercase.&lt;br /&gt;If you want the value of ‘name’ column always in uppercase, the statement to create domain is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    CREATE DOMAIN string30 AS varchar(30)&lt;br /&gt;    CHECK (VALUE = UPPER (VALUE))&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-12.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-14.html"&gt;Next&lt;/a&gt; Tutorial&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-7425922395014986952?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/7425922395014986952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-13.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7425922395014986952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7425922395014986952'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-13.html' title='String Operator and Converting Uppercase ( Interbase Tutorial # 13 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3266770235654740404</id><published>2010-02-21T17:05:00.000-08:00</published><updated>2010-03-07T19:31:08.549-08:00</updated><title type='text'>Inner Join and Outer Join ( Interbase Tutorial # 12 )</title><content type='html'>&lt;p&gt;In Interbase you can join two or more tables. As a result of joining tables, Interbase will build a new table, which sometimes called  ‘dynamic table’ or ‘virtual table’. Two kind of joins supported by Interbase : Inner Join and Outer Join.&lt;br /&gt;Before we start to learn about Inner Join and Outer Join, execute these statement below :&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;    insert into employee (id, name, age, phonenumber) &lt;br /&gt;    values ('5',’Frank Borland','31','555-9999')&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;    insert into employee (id, name, age, phonenumber) &lt;br /&gt;    values ('6',’Max Planck’,'28','555-1199')&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;INNER JOIN&lt;/strong&gt;&lt;/p&gt;&lt;p align="justify"&gt;Inner join link rows in tables based on specified join conditions and return only those rows that match the join conditions. If a joined column contains a NULL value for a given row, that row is not included in the results table. Inner joins are the more common type because they restrict the data returned and show a clear relationship between two or more tables.&lt;br /&gt;&lt;br /&gt;Example : You want to build a virtual table which contains two columns : id and total salary. The SQL statement is :&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;    select a.name, b.salary from employee a inner join salary b&lt;br /&gt;    on a.id = b.employee_id&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;note :&lt;br /&gt;a is correlation name or alias of ‘employee’ table&lt;br /&gt;b is correlation name or alias of ‘salary’ table&lt;br /&gt;you can make any alias name, ie : a, b, table1, table2, alias1, alias2....... etc&lt;/em&gt;&lt;/p&gt;&lt;p align="justify"&gt;the output is :&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;NAME                                             SALARY &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;======================== &lt;br /&gt;Isaac Newton                                 1000 &lt;br /&gt;Blaise Pascal                               2000 &lt;br /&gt;Archimedes                                     3000 &lt;br /&gt;George Boole                                 4000 &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;OUTER JOIN&lt;/strong&gt;&lt;/p&gt;&lt;p align="justify"&gt;Outer joins link rows in tables based on specified join conditions but return rows whether they match the join conditions or not. Outer joins are useful for viewing joined rows in the context of rows that do not meet the join conditions. &lt;/p&gt;&lt;p align="justify"&gt;Example : You also want to build a virtual table which contains two columns : id and total salary. But this time you use OUTER JOIN. The SQL statement is :&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;    select a.name, b.salary from employee a left outer join salary b&lt;br /&gt;    on a.id = b.employee_id&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;the output is :&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;NAME                                                SALARY &lt;br /&gt;============================ &lt;br /&gt;Isaac Newton                                    1000 &lt;br /&gt;Blaise Pascal                                  2000 &lt;br /&gt;Archimedes                                        3000 &lt;br /&gt;George Boole                                    4000 &lt;br /&gt;Frank Borland                              &lt;&gt;&lt;null&gt;&lt;br /&gt;Max Planck                                    &lt;&gt;&lt;null&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Form the output of both examples above, you can see the difference between INNER JOIN and OUTER JOIN. OUTER JOIN returns NULL value rows, but INNER JOIN doesn’t.&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-11.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-13.html"&gt;Next&lt;/a&gt; Tutorial&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3266770235654740404?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3266770235654740404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-12.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3266770235654740404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3266770235654740404'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-12.html' title='Inner Join and Outer Join ( Interbase Tutorial # 12 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3016734214311331768</id><published>2010-02-19T19:15:00.000-08:00</published><updated>2010-02-19T19:28:01.636-08:00</updated><title type='text'>Adding Free Hit Counter to Your Blog or Website</title><content type='html'>&lt;p&gt;You can also view this post in &lt;a href="http://123codegeneratorina.blogspot.com/2010/02/menambah-hit-counter-pada-blog-atau.html"&gt;Bahasa Indonesia&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Sometimes we want to know how many visitors have visited our blog or website. It can be done by adding a hit counter. To add a hit counter to your blog or website, &lt;a href="http://www.hit-counter-download.com/"&gt;click here&lt;/a&gt;. You’ll be directed to hit-counter-download.com main page, see the picture below :&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S39UkYQRsuI/AAAAAAAAACw/iExzpNef4yM/s1600-h/mainpage.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 250px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S39UkYQRsuI/AAAAAAAAACw/iExzpNef4yM/s320/mainpage.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5440159858849592034" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Choose one of the available hit counter. This page provide many kinds of hit counter :&lt;br /&gt;- Basics Hit Counters&lt;br /&gt;- Cool Hit Counters&lt;br /&gt;- Digital Hit Counters&lt;br /&gt;- Fancy Hit Counters&lt;br /&gt;&lt;br /&gt;Then you’ll be directed to the submission form :&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S39VP_aW55I/AAAAAAAAAC4/IljbYyeI3Ps/s1600-h/submit.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 225px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S39VP_aW55I/AAAAAAAAAC4/IljbYyeI3Ps/s320/submit.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5440160608095233938" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Fill the form, like picture above. Of course you need to enter your password. After you click Submit you’ll get HTML code that you can copy and paste into your blog or website&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S39VmXzRwBI/AAAAAAAAADA/T-wUi3Fwlbs/s1600-h/html+result.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 146px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S39VmXzRwBI/AAAAAAAAADA/T-wUi3Fwlbs/s320/html+result.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5440160992599326738" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3016734214311331768?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3016734214311331768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/adding-free-hit-counter-to-your-blog-or.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3016734214311331768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3016734214311331768'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/adding-free-hit-counter-to-your-blog-or.html' title='Adding Free Hit Counter to Your Blog or Website'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_kLg3mPfGL6E/S39UkYQRsuI/AAAAAAAAACw/iExzpNef4yM/s72-c/mainpage.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-7984351908781592731</id><published>2010-02-18T16:29:00.000-08:00</published><updated>2010-03-07T19:30:43.411-08:00</updated><title type='text'>Retrieving Data from Two Table ( Interbase Tutorial # 11 )</title><content type='html'>&lt;p&gt;We already have two tables in our database. Each table contains some populations. Now let’s see what we have in each table using SELECT statement.&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    &lt;strong&gt;select * from employee&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;         ID NAME                                           AGE PHONENUMBER  &lt;br /&gt;==================================&lt;br /&gt;&lt;br /&gt;          1 Isaac Newton                              30 555-5555     &lt;br /&gt;          2 Blaise Pascal                            25 555-1234     &lt;br /&gt;          3 Archimedes                                  32 555-2233     &lt;br /&gt;          4 George Boole                              27 555-4521&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    &lt;strong&gt;select * from salary&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt; SALARY_ID   EMPLOYEE_ID        SALARY       BONUS TOTALSALARY &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;======================================================= &lt;br /&gt;&lt;br /&gt;                 1                       1            1000           100               1100 &lt;br /&gt;                 2                       2            2000           200               2200 &lt;br /&gt;                 3                       3            3000           300               3300 &lt;br /&gt;                 4                       4            4000           400               4400&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span&gt;Now we’re going to get employee’s name and their total salary. It will be a little bit complicated, because the ‘name’ column is in ‘employee’ table and the ‘totalsalary’ column is in ‘salary’ table. But don’t be worry, we can also retrieve data from two table using SQL statement. And the statement is :&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;    select name, totalsalary from employee, salary &lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    where employee.id = salary.employee_id&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span&gt;The output is :&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span&gt;NAME                                           TOTALSALARY&lt;br /&gt;========================&lt;br /&gt;&lt;br /&gt;Isaac Newton                                                   1100&lt;br /&gt;Blaise Pascal                                                   2200&lt;br /&gt;Archimedes                                                       3300&lt;br /&gt;George Boole                                                   4400&lt;br /&gt;&lt;br /&gt;The WHERE clause is for comparing the value of ‘id’ column in ‘employee’ table with the value of ‘employee_id’ in ‘salary’ table.&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span&gt;Now we’re going to get  names and their total salaries of  employee whose age is 30 year above. The statement will be :&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;select name, totalsalary from employee, salary &lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;where age&gt;=30 and employee.id = salary.employee_id&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span&gt;The output is :&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;NAME                                   TOTALSALARY &lt;br /&gt;========================= &lt;br /&gt;&lt;br /&gt;Isaac Newton                                 1100 &lt;br /&gt;Archimedes                                     3300 &lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-10.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-12.html"&gt;Next&lt;/a&gt; Tutorial&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-7984351908781592731?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/7984351908781592731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7984351908781592731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7984351908781592731'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-11.html' title='Retrieving Data from Two Table ( Interbase Tutorial # 11 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-2565689792976520339</id><published>2010-02-16T21:02:00.000-08:00</published><updated>2010-02-19T19:24:49.323-08:00</updated><title type='text'>facebook widget</title><content type='html'>&lt;p&gt;&lt;strong&gt;Adding a Facebook Widget to your Blog/Web&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;You can also view this post in &lt;a href="http://123codegeneratorina.blogspot.com/2010/02/menambahkan-facebook-widget-di-blog.html"&gt;Bahasa Indonesia&lt;/a&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;It’s quite simple to add a FaceBook Widget to your blog or website. Just follow these steps below :&lt;/p&gt;&lt;p&gt;1. From your profile click Create a Profile Badge text link&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S3t5AJbmrOI/AAAAAAAAACQ/lDX7PaL1684/s1600-h/create+profile+badge.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 150px; height: 52px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S3t5AJbmrOI/AAAAAAAAACQ/lDX7PaL1684/s320/create+profile+badge.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5439074018418666722" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;2. You can edit your badge by clicking Edit this badge&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S3t5bclaAOI/AAAAAAAAACY/HTtWqftTtOc/s1600-h/creating+badge.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 106px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S3t5bclaAOI/AAAAAAAAACY/HTtWqftTtOc/s320/creating+badge.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5439074487416520930" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;3. You can choose the displayed items on your badge by checking them in the list. Then click save.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S3t5xZMmT8I/AAAAAAAAACg/wiHzKCzeZ7Q/s1600-h/edit+badge.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 165px; height: 320px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S3t5xZMmT8I/AAAAAAAAACg/wiHzKCzeZ7Q/s320/edit+badge.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5439074864464285634" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;4. If you have a Blogspot or TypePad account, you’ll be directed to the page. If you click other, you’ll get the code. You can copy and paste the code to wherever you want.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S3t6GUBeBRI/AAAAAAAAACo/w2ZHiVWWmJk/s1600-h/copy+codes.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 106px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S3t6GUBeBRI/AAAAAAAAACo/w2ZHiVWWmJk/s320/copy+codes.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5439075223852680466" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-2565689792976520339?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/2565689792976520339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/facebook-widget.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2565689792976520339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2565689792976520339'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/facebook-widget.html' title='facebook widget'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_kLg3mPfGL6E/S3t5AJbmrOI/AAAAAAAAACQ/lDX7PaL1684/s72-c/create+profile+badge.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3854975908564048484</id><published>2010-02-16T19:54:00.000-08:00</published><updated>2010-03-07T19:30:15.030-08:00</updated><title type='text'>Subquery and Aggregate function ( Interbase Tutorial # 10 )</title><content type='html'>&lt;p&gt;&lt;strong&gt;Subquery&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;In a WHERE clause, you have a column, a comparative operator and a value to be compared with the column. Subquery provide a value from the other table that will be compared with the column you have in a WHERE clause. In some case we need a subquery for retrieving data.&lt;/p&gt;&lt;p&gt;For example, we want to get a name who earns 3300 a month. The problem is, we don’t have ‘name’ column in the ‘salary’ table. In this case we have to use subquery to get a value to be compared.&lt;/p&gt;&lt;p&gt;In ‘salary’ table we have ‘employee_id’ column which has a constraint value that refers to ‘id’ column in ‘employee’ table. Fist, we have to get an employee_id who earns 3300 from ‘salary’ table, then we compare the employee_id with ‘id’ column in ‘employee’ table to get a name. and the SQL statement will be :&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;  select name from employee&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;  where id = (select employee_id from salary where totalsalary=3300)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;and the output will be :&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;NAME                           &lt;br /&gt;============================== &lt;br /&gt;&lt;br /&gt;Archimedes&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Now, I will give you a problem :&lt;br /&gt;&lt;/span&gt;&lt;span&gt;We want to get the total salary of the employee whose phone number is 555-1234.&lt;br /&gt;Figure out the SQL statement to solve this problem !&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Aggregate Function&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;SQL provide some aggregate functions that calculate some values in columns. There are five aggregate functions that provided by SQL :&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;AVG &lt;br /&gt;Get the average value in a group of rows&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;COUNT &lt;br /&gt;Count the number of rows. You can use WHERE clause here to specify the rows you count&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;MIN &lt;br /&gt;Get the minimum value in a group of rows&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;MAX&lt;br /&gt;Get the minimum value in a group of rows&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;SUM&lt;br /&gt;Adds numeric values in a group of rows&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Some examples of using aggregate function :&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;span style="font-family:courier new;"&gt;   select avg(age) from employee&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;span style="font-family:courier new;"&gt;   select avg(totalsalary) from salary&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;span style="font-family:courier new;"&gt;   select min(salary) from salary&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;span style="font-family:courier new;"&gt;   select count(totalsalary) from salary where totalsalary&gt;2000&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;span style="font-family:courier new;"&gt;   select sum(totalsalary) from salary&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;You can try other SQL statement using aggregate functions.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutoril-9.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-11.html"&gt;Next&lt;/a&gt; tutorial&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3854975908564048484?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3854975908564048484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-10.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3854975908564048484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3854975908564048484'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-10.html' title='Subquery and Aggregate function ( Interbase Tutorial # 10 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3976129076783754706</id><published>2010-02-15T17:24:00.000-08:00</published><updated>2010-03-07T19:29:55.336-08:00</updated><title type='text'>Search Condition ( Interbase Tutorial # 9 )</title><content type='html'>&lt;strong&gt;NOT&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You can use NOT if you want to retrieve data which value is not equal to the condition. The syntax is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    SELECT column FROM table&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    WHERE NOT column = value&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The other way to get the same data is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    SELECT column FROM table&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    WHERE column != value&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example 1 : we want to retrieve all data except data which age is above or equal to 30.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    select * from employee where not age&amp;lt;30&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;the statement above will have the same output with this statement below :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    select * from employee where age&gt;=30&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example 2 : we want to retrieve data except the data which name is Archimedes.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    select * from employee where name!=’Archimedes’&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;LIKE&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;LIKE is used for retrieving data which has a particular matches with the pattern condition you give. The syntax is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    SELECT column FROM table&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    WHERE column LIKE ‘%pattern’&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example 3 : we want to retrieve data which name is ended with a particular pattern ‘ton’ &lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    select * from employee where name like ‘%ton’&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example 4 : we want to retrieve data which name has a particular pattern ‘chi’ in the middle.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    select * from employee where name like ‘%chi%’&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;Example 5 : we want to retrieve data which name is started with a particular pattern ‘Ge’ &lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    select * from employee where name like ‘Ge%’&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;STARTING WITH&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;You can use STARTING WITH if you want to retrieve data which column’s value started with a pattern. The syntax is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    SELECT column FROM table&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    WHERE column STARTING WITH pattern&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example 6 : we want to retrieve data which name is started with ‘Bla’&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    select * from employee where name STARTING WITH ‘Bla’&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;it will have same output with the statement below :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    select * from employee where name like ‘Bla%’&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CONTAINING&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You can use CONTAINING to retrieve data which contain a value. The syntax is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    SELECT column FROM table&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    WHERE column CONTAINING value&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example 7 : we want to retrieve data which name contains ‘s’ letter&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    select * from employee where name containing ‘s’&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;BETWEEN&lt;/strong&gt; and &lt;strong&gt;IN&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;BETWEEN is for retrieving data within a range value. The syntax is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    SELECT column FROM table&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    WHERE column BETWEEN value1 AND value2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The statement below will get the data which name is started with a letter between C and J.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    select * from employee where name between ‘C’ and ‘J’&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;IN is for retrieving data with several values to be compared. The syntax is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    SELECT column FROM table&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    WHERE column IN (value1, value2, value3…….)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The statement below will get the data which age is 25, 27 or 32&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    select * from employee where age in (‘25’,’27’,’32’)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-8.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-10.html"&gt;Next&lt;/a&gt; Tutorial&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3976129076783754706?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3976129076783754706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutoril-9.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3976129076783754706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3976129076783754706'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutoril-9.html' title='Search Condition ( Interbase Tutorial # 9 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-2310588341416689997</id><published>2010-02-14T16:53:00.000-08:00</published><updated>2010-03-07T19:29:38.200-08:00</updated><title type='text'>Retrieving Data ( Interbase Tutorial # 8 )</title><content type='html'>Now we’re going to populate our database again. To avoid typing the SQL statement and executing them one by one in the Interbase Windows ISQL, type these SQL statements below in a text editor :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  connect 'c:\mydata\mydata.gdb'&lt;br /&gt;  user 'NEW_USER' password 'password';&lt;br /&gt;&lt;br /&gt;  insert into employee (id, name, age, phonenumber) &lt;br /&gt;  values ('1','Isaac Newton','30','555-5555');&lt;br /&gt;&lt;br /&gt;  insert into employee (id, name, age, phonenumber) &lt;br /&gt;  values ('2','Blaise Pascal','25','555-1234');&lt;br /&gt;&lt;br /&gt;  insert into employee (id, name, age, phonenumber) &lt;br /&gt;  values ('3','Archimedes','32','555-2233');&lt;br /&gt;&lt;br /&gt;  insert into employee (id, name, age, phonenumber) &lt;br /&gt;  values ('4','George Boole','27','555-4521');&lt;br /&gt;&lt;br /&gt;  insert into salary (salary_id, employee_id, salary, bonus) &lt;br /&gt;  values ('1','1','1000','100');&lt;br /&gt;&lt;br /&gt;  insert into salary (salary_id, employee_id, salary, bonus) &lt;br /&gt;  values ('2','2','2000','200');&lt;br /&gt;&lt;br /&gt;  insert into salary (salary_id, employee_id, salary, bonus) &lt;br /&gt;  values ('3','3','3000','300');&lt;br /&gt;&lt;br /&gt;  insert into salary (salary_id, employee_id, salary, bonus) &lt;br /&gt;  values ('4','4','4000','400');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(note : if you type SQL statements in a text editor, you have to put a ‘;’ at the end of each statement) &lt;br /&gt; &lt;br /&gt;Save the statements above in a file named ‘inputdata.txt’. Then execute it in the Interbase Windows ISQL by choosing File – Run an ISQL Script.&lt;br /&gt;&lt;br /&gt;After populating our database, now we’re going to get the data out and use them. To get the data out we use SELECT statement. The SELECT statement is the most important, because if we have a data structure but we can not get them out and use them, it will be useless. The syntax is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  SELECT column1,column2….  FROM TableName&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;or&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  SELECT  *  FROM TableName&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT statement has six keywords : &lt;strong&gt;DISTINCT&lt;/strong&gt;, &lt;strong&gt;FROM&lt;/strong&gt;, &lt;strong&gt;WHERE&lt;/strong&gt;, &lt;strong&gt;GROUP BY&lt;/strong&gt;, &lt;strong&gt;HAVING&lt;/strong&gt; and &lt;strong&gt;ORDER BY&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;WHERE clause&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;WHERE clause will limit the retrieved rows with specified conditions. Only the rows which has the specified conditions will be retrieved. The syntax is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  SELECT column1,column2….  FROM TableName&lt;br /&gt;  WHERE condition&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Execute these statements below and see what happen in the output windows :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  select * from employee where age&gt;=30&lt;br /&gt;&lt;br /&gt;  select name, phonenumber from employee where age&gt;=30 &lt;br /&gt;&lt;br /&gt;  select name, phonenumber from employee where not age&gt;=30 &lt;br /&gt;&lt;br /&gt;  select name, phonenumber from employee where (age&gt;=30) and (id&gt;1)&lt;br /&gt;&lt;br /&gt;  select * from employee where (age&gt;30) or (age&lt;26)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ORDER BY clause&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;ORDER BY clause will order the output of a SELECT statement by the specified column. OERDER BY has a syntax :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  ORDER BY column ASC&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;or&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  ORDER BY column DESC&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Execute these statements below and see what happen in the output windows :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  select * from employee order by age asc&lt;br /&gt;&lt;br /&gt;  select * from employee order by age desc&lt;br /&gt;&lt;br /&gt;  select * from employee where age &lt;&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;DISTINCT clause&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;DISTINCT clause will eliminate duplicate rows of the output of a SELECT statement. The syntax is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  SELECT DISTINCT column FROM table&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;GROUP BY&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;GROUP BY clause will group rows according the value of specified column. The syntax is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  SELECT column FROM table GROUP BY column&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HAVING clause&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Having clause will specify search condition and to use with GROUP BY clause. The syntax is :&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;  SELECT column FROM table GROUP BY column HAVING search_condition&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/primary-key-foreign-key-constraint.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutoril-9.html"&gt;Next&lt;/a&gt; Tutorial&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-2310588341416689997?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/2310588341416689997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2310588341416689997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2310588341416689997'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-8.html' title='Retrieving Data ( Interbase Tutorial # 8 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-2797366011527574598</id><published>2010-02-12T20:57:00.000-08:00</published><updated>2010-03-07T19:28:50.371-08:00</updated><title type='text'>Primary Key, Foreign Key, Constraint ( Interbase Tutorial # 7 )</title><content type='html'>Every table must have a primary key. Only one primary key can be created in a table. But we may have a collective combination of  some columns to form a primary key. Primary key has to be a column which has a unique value. In our case, ‘employee’ table also must have a primary key. The column which has a unique value is ‘id’ column. &lt;br /&gt;The better way to create ‘employee’ table with a primary key is :&lt;br /&gt;&lt;br /&gt;&lt;em&gt;(Note : before you execute the SQL codes below, you have to drop your previous table in the database)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   create table employee(&lt;br /&gt;   id domain_id not null primary key,&lt;br /&gt;   name string30 not null,&lt;br /&gt;   age domain_age not null,&lt;br /&gt;   phonenumber string12 not null);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;a table can also has a foreign key. Foreign key is a column or a combination of some columns in a table. The value must refer to the primary key which is in the table or other table. Now we’re going to create a table which has a foreign key refers to the primary key of ‘employee’ table.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; create table salary(&lt;br /&gt; salary_id domain_id not null primary key,&lt;br /&gt; employee_id domain_id not null,&lt;br /&gt; salary integer not null,&lt;br /&gt; bonus integer not null,&lt;br /&gt; totalsalary computed by (salary+bonus),&lt;br /&gt; constraint fk1 foreign key (employee_id) references employee(id));&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;em&gt;(note : fk1 is the name of the constraint)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;now we have a better database than our previous. We can see what is in our database by choosing Metadata - Extract Table. And the output is :&lt;br /&gt;&lt;br /&gt;/* Extract Database D:\mydata\MYDATA.GDB */&lt;br /&gt;CREATE DATABASE "D:\mydata\MYDATA.GDB" PAGE_SIZE 1024 &lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;/* Domain definitions */&lt;br /&gt;CREATE DOMAIN STRING30 AS VARCHAR(30);&lt;br /&gt;CREATE DOMAIN STRING12 AS VARCHAR(12);&lt;br /&gt;CREATE DOMAIN DOMAIN_ID AS INTEGER&lt;br /&gt;         check(value&gt;0);&lt;br /&gt;CREATE DOMAIN DOMAIN_AGE AS INTEGER&lt;br /&gt;         check(value&gt;18 and value&lt;55);&gt;/* Grant permissions for this database */&lt;p&gt;&lt;/p&gt;&lt;p&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-6.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-8.html"&gt;Next&lt;/a&gt; Tutorial&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-2797366011527574598?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/2797366011527574598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/primary-key-foreign-key-constraint.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2797366011527574598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/2797366011527574598'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/primary-key-foreign-key-constraint.html' title='Primary Key, Foreign Key, Constraint ( Interbase Tutorial # 7 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-8170796583007024774</id><published>2010-02-09T16:03:00.000-08:00</published><updated>2010-03-07T19:28:18.141-08:00</updated><title type='text'>Modifying Table and Computed Column ( Interbase Tutorial # 6 )</title><content type='html'>You can modify your table using ALTER TABLE statement. With this statement you can add a columns into your table or you can delete a column as well. The syntax of this statement is :&lt;br /&gt;&lt;br /&gt;For adding a column :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    ALTER TABLE TableName ADD columnname datatype&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For dropping a column :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    ALTER TABLE TableName DROP columnname&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example 1 : in ‘employee’ table, we have four columns : id, name, age and phonenumber. We’re going to delete age column and add a column named bithdate. &lt;br /&gt;First we delete age column using this statement :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    Alter table employee drop age&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Age column has been dropped. Now we’re adding birthdate column using this statement :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    Alter table employee add birthdate date&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;We use date data type for birtdate column. Now we have four column in ‘employee’ table : id, name, phonenumber, birthdate.&lt;/p&gt;&lt;p&gt;To see the changes we've made in 'employee' table, choose &lt;strong&gt;Metadata - Extract Table&lt;/strong&gt;. And the output is :&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;/* Extract Table EMPLOYEE */&lt;br /&gt;&lt;br /&gt;/* Table: EMPLOYEE, Owner: NEW_USER */&lt;br /&gt;CREATE TABLE EMPLOYEE (ID INTEGER NOT NULL,&lt;br /&gt;        NAME VARCHAR(30) NOT NULL,&lt;br /&gt;        PHONENUMBER VARCHAR(12) NOT NULL,&lt;br /&gt;        BIRTHDATE DATE);&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;strong&gt;Computed column&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We can also have a column that has a value based on the values of other columns in the table. The syntax to create a computed column is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   ColumnName COMPUTED BY ( arithmetic operation ) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example 2 : in ‘employee’ table we’re going to add three columns : salary, bonus, totalsalary. And the totalsalary column’s value =  salary column’s value + bonus column’s value.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;The statement will be like this :&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;br /&gt;    Alter table employee add salary integer&lt;br /&gt;&lt;br /&gt;    Alter table employee add bonus integer&lt;br /&gt;&lt;br /&gt;    Alter table employee add totalsalary computed by (salary+bonus)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You have to execute the statements above one by one in the InterBase Interactive SQL window. Now we have ‘employee’ table which has seven columns : id, name, phonenumber, birthdate, salary, bonus and totalsalary.&lt;br /&gt;To see what we have in mydata.gdb database choose &lt;strong&gt;Metadata – Extract Database&lt;/strong&gt;. And the output is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/* &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Extract&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; Database D:\mydata\MYDATA.GDB */&lt;br /&gt;CREATE DATABASE "D:\mydata\MYDATA.GDB" PAGE_SIZE 1024 &lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;/* Domain definitions */&lt;br /&gt;CREATE DOMAIN STRING30 AS VARCHAR(30);&lt;br /&gt;CREATE DOMAIN STRING12 AS VARCHAR(12);&lt;br /&gt;CREATE DOMAIN DOMAIN_ID AS INTEGER&lt;br /&gt;         check(value&amp;gt;0);&lt;br /&gt;CREATE DOMAIN DOMAIN_AGE AS INTEGER&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;         check(value&amp;gt;18 and value&amp;lt;55);&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-5.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/primary-key-foreign-key-constraint.html"&gt;Next&lt;/a&gt; Tutorial&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-8170796583007024774?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/8170796583007024774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8170796583007024774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/8170796583007024774'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-6.html' title='Modifying Table and Computed Column ( Interbase Tutorial # 6 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-3796457681139683761</id><published>2010-02-05T18:09:00.000-08:00</published><updated>2010-03-07T19:27:21.373-08:00</updated><title type='text'>Domain ( Interbase Tutorial # 5 )</title><content type='html'>What is Domain ?&lt;br /&gt;&lt;br /&gt;Let us see our SQL script in the previous tutorial for creating table ‘employee’ :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    create table employee(&lt;br /&gt;id integer not null,&lt;br /&gt;name varchar(30) not null,&lt;br /&gt;age integer not null,&lt;br /&gt;phonenumber varchar(12) not null)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We have an integer data type for column ‘id’ and ‘age’. As we know integer has range value between -2,147,483,648 to 2,147,483,647. We can insert a negative value to these columns. But in the real world, id and age can not have a negative value.&lt;br /&gt;We can solve this problem by creating a DOMAIN. DOMAIN is a customized column definition.&lt;br /&gt;&lt;br /&gt;The syntax to create a domain is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    CREATE DOMAIN domain_name AS data type&lt;br /&gt;DEFAULT devault_value NOT NULL&lt;br /&gt;CHECK (condition)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;DEFAULT clause and CHECK clause are optional.&lt;br /&gt;&lt;br /&gt;Type the codes below in the text editor, and save it with file name ‘mydata_domain.txt’.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    create database 'c:\mydata\mydata.gdb'&lt;br /&gt;user 'NEW_USER' password 'password';&lt;br /&gt;&lt;br /&gt;create domain string30 as varchar(30);&lt;br /&gt;create domain string12 as varchar(12);&lt;br /&gt;create domain domain_id as integer check(value&gt;0);&lt;br /&gt;create domain domain_age as integer&lt;br /&gt;check(value&gt;18 and value&lt;55);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Go to InterBase Interactive SQL window. &lt;/p&gt;&lt;p&gt;You can not run the script above, because database 'c:\mydata\mydata.gdb' is slready exist. You need to drop the old database first.&lt;br /&gt;&lt;/p&gt;Connect to the old database, then choose File – Drop Database. So the old database ‘c:\mydata\mydata.gdb' is now deleted. Then you run the script above by choosing File – Run an ISQL Script. And choose your ISQL script file : ‘mydata_domain.txt’. Now you have a better column definition in your table ‘employee’.&lt;br /&gt;&lt;br /&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-4.html"&gt;Previous&lt;/a&gt;    Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-6.html"&gt;Next&lt;/a&gt;Tutorial&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-3796457681139683761?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/3796457681139683761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-5.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3796457681139683761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/3796457681139683761'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-5.html' title='Domain ( Interbase Tutorial # 5 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-7949961840742192087</id><published>2010-02-04T19:35:00.000-08:00</published><updated>2010-03-07T19:26:55.681-08:00</updated><title type='text'>Inserting, Reading, Updating and Deleting Data ( Interbase Tutorial # 4 )</title><content type='html'>&lt;div align="justify"&gt;We already have a database ‘mydata.gdb’, and it contains a table ‘employee’. Now we’re going to populate our database.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Inserting Data&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The syntax for inserting data into a table is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    INSERT INTO TableName (field1,field2,field3,….)&lt;br /&gt;VALUES (‘value1’,’value2’,’value3’,…)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Go to the Interbase Windows ISQL from the start menu. Connect to your database. Insert first record into your table ‘employee’ by typing these SQL codes in the SQL statement area :&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;insert into employee (id, name, age, phonenumber)&lt;/span&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;values ('1','Isaac Newton','30','555-5555')&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then execute the codes. Now you have your first record in your table :&lt;br /&gt;&lt;br /&gt;Id : 1&lt;br /&gt;Name : Isaac Newton&lt;br /&gt;Age : 30&lt;br /&gt;Phonenumber : 555-5555&lt;br /&gt;&lt;br /&gt;Now insert records below into your table ‘employee’ with the same way :&lt;br /&gt;&lt;br /&gt;Id : 2&lt;br /&gt;Name : Blaise Pascal&lt;br /&gt;Age : 25&lt;br /&gt;Phonenumber : 555-1234&lt;br /&gt;&lt;br /&gt;Id : 3&lt;br /&gt;Name : Archimedes&lt;br /&gt;Age : 32&lt;br /&gt;Phonenumber : 555-2233&lt;br /&gt;&lt;br /&gt;Id : 4&lt;br /&gt;Name : George Boole&lt;br /&gt;Age : 27&lt;br /&gt;Phonenumber : 555-4521&lt;br /&gt;&lt;br /&gt;You have to type the same SQL codes for each record. If you’ve got hundreds of records, it will be a nightmare to do this. And I won’t do this. Of course there is more civilized way to do this. Soon I will share how to create a “user friendly interface”.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reading Data&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We have four records in our table, now we’re reading the record using this syntax :&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;SELECT column1,column2….  FROM TableName&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you want to read all columns of your records, the syntax is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    SELECT  *  FROM TableName&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example1 : if you want to read all columns in table ‘employee’ the code will be&lt;br /&gt;&lt;br /&gt;    select * from employee&lt;br /&gt;&lt;br /&gt;Example2 : If you only want to read column ‘name’ and ‘age’ of your table, the codes will be&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;select name, age from employee &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Updating Data&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div align="justify"&gt;If you want to update your data in the table use this syntax :&lt;/div&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;    UPDATE TableName&lt;br /&gt;SET column = value&lt;br /&gt;WHERE condition   &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;WHERE is optional. If there’s no WHERE, all the records will be updated. Otherwise, it will make restrictive change to the record which is in the condition.&lt;br /&gt;&lt;br /&gt;Example 3 : You want to increase all ages of your record by 1&lt;br /&gt;&lt;/p&gt;&lt;p&gt;          &lt;span style="font-family:courier new;"&gt;update employee set age = age + 1&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;Example 4 : If you want to change Archimedes’ phone number, you have to use WHERE clause&lt;br /&gt;&lt;p&gt;          &lt;span style="font-family:courier new;"&gt;update employee set phonenumber = ‘555-7777’&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    where name=’Archimedes’&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;strong&gt;Deleting Data&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;To delete data from your table use this syntax :&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;DELETE from TableName &lt;/span&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;WHERE condition&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If there is no WHERE clause, all the record will be deleted from the table. If you use WHERE clause, only a record which has the condition will be deleted.&lt;br /&gt;&lt;br /&gt;Example 5 : You want to delete employee whose age is above 30&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;delete from employee where age &gt; 30&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Committing Your Work&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;After you execute some SQL codes, you need to commit your work. If you don’t, other users won’t see the changes you have made. Commit your work by choosing &lt;strong&gt;File – Commit work&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/toturial-interbase-3.html"&gt;Previous&lt;/a&gt;  Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-5.html"&gt;Next&lt;/a&gt;Tutorial&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-7949961840742192087?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/7949961840742192087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7949961840742192087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/7949961840742192087'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-4.html' title='Inserting, Reading, Updating and Deleting Data ( Interbase Tutorial # 4 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-5378405656514552882</id><published>2010-02-02T20:58:00.000-08:00</published><updated>2010-03-07T19:26:21.055-08:00</updated><title type='text'>Creating a Database ( Interbase Tutorial # 3 )</title><content type='html'>&lt;div align="justify"&gt;What is database ?&lt;br /&gt;&lt;br /&gt;A database is like a container. You have some tables in the container. Each table related to others with some special ways, so the owner of the database can easily maintain or manipulate the tables.&lt;br /&gt;&lt;/div&gt;&lt;p align="justify"&gt;To create new database we have to run InterBase Windows Interactive SQL from the start menu. &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S2kC43pAPkI/AAAAAAAAACA/iV6HzIixLoM/s1600-h/interbase+interactive+windows.jpg"&gt;&lt;img style="cursor: pointer; width: 318px; height: 320px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S2kC43pAPkI/AAAAAAAAACA/iV6HzIixLoM/s320/interbase+interactive+windows.jpg" alt="" id="BLOGGER_PHOTO_ID_5433877601431076418" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p align="justify"&gt;Choose Create database, then the Create Database Window appears.&lt;br /&gt;&lt;br /&gt;Enter your database name, for example :      &lt;span style="font-family:courier new;"&gt;c:\mydata\mydatabase.gdb&lt;/span&gt;&lt;br /&gt;Enter your  &lt;span style="font-family:courier new;"&gt;username&lt;/span&gt;  and &lt;span style="font-family:courier new;"&gt; password&lt;/span&gt;  &lt;span&gt;then press OK&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Now you’ve got a database named  ‘&lt;span style="font-family:courier new;"&gt;mydatabase.gdb&lt;/span&gt;’  in folder  ‘&lt;span style="font-family:courier new;"&gt;mydata&lt;/span&gt;’ , but you haven’t got any tables in it.&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;Creating a table&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A table always has some rows and columns. Where each row represent each record of your table and each column represent each field of your record.&lt;br /&gt;&lt;br /&gt;For example&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S2kD78v_aeI/AAAAAAAAACI/8alpUnTDDbI/s1600-h/a+table.jpg"&gt;&lt;img style="cursor: pointer; width: 480px; height: 63px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S2kD78v_aeI/AAAAAAAAACI/8alpUnTDDbI/s320/a+table.jpg" alt="" id="BLOGGER_PHOTO_ID_5433878753853794786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;a record of the table above has four fields : ID, Name, Age and PhoneNumber&lt;br /&gt;&lt;br /&gt;To create a table in interbase, you have to write some Structured Query Language (SQL) codes in the InterBase Interactive SQL window. The SQL codes to create the table above is shown below :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   create table employee(&lt;br /&gt;id integer not null,&lt;br /&gt;name varchar(30) not null,&lt;br /&gt;age integer not null,&lt;br /&gt;phonenumber varchar(12) not null)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then execute your codes.&lt;br /&gt;Now, see each field we have in the table ‘employee’ :&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;fields&lt;/strong&gt;                      &lt;strong&gt;data&lt;/strong&gt; &lt;strong&gt;type&lt;/strong&gt;&lt;br /&gt;id                              integer&lt;br /&gt;name                       string (has maximum character = 30)&lt;br /&gt;age                           integer&lt;br /&gt;phonenumber       string (has maximum character = 12)&lt;br /&gt;&lt;br /&gt;‘&lt;span style="font-family:courier new;"&gt;not null&lt;/span&gt;’ means that each field must have a value&lt;br /&gt;&lt;br /&gt;Now you already have a database contains a table named ‘&lt;span style="font-family:courier new;"&gt;employee&lt;/span&gt;’. You can create another table with the same way. The number of table depends on your need.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Creating a Database Using Text Editor&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Another way to create a database, you can type your SQL codes in a text editor (ie : notepad) before you execute them in InterBase Interactive SQL window.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Type these SQL codes in the text editor, then save it with a name : ‘&lt;span style="font-family:courier new;"&gt;mydata.txt&lt;/span&gt;’.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   create database 'c:\mydata\mydata.gdb'&lt;br /&gt;user 'NEW_USER' password 'password';&lt;br /&gt;&lt;br /&gt;create table employee(&lt;br /&gt;id integer not null,&lt;br /&gt;name varchar(30) not null,&lt;br /&gt;age integer not null,&lt;br /&gt;phonenumber varchar(12) not null);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Go to the InterBase Interactive SQL window and execute the codes by choosing &lt;strong&gt;File – Run an ISQL script&lt;/strong&gt;. And choose your ISQL script file : ‘&lt;span style="font-family:courier new;"&gt;mydata.txt&lt;/span&gt;’. If your SQL script has no errors, the database ‘&lt;span style="font-family:courier new;"&gt;mydata.gdb&lt;/span&gt;’ will be created and it contains a table ‘&lt;span style="font-family:courier new;"&gt;employee&lt;/span&gt;’.&lt;/p&gt;&lt;p align="justify"&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-2-see-picture-below.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-4.html"&gt;Next&lt;/a&gt;Tutorial&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-5378405656514552882?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/5378405656514552882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/toturial-interbase-3.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/5378405656514552882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/5378405656514552882'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/toturial-interbase-3.html' title='Creating a Database ( Interbase Tutorial # 3 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kLg3mPfGL6E/S2kC43pAPkI/AAAAAAAAACA/iV6HzIixLoM/s72-c/interbase+interactive+windows.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-327407803161036703</id><published>2010-02-01T18:18:00.001-08:00</published><updated>2010-03-07T19:26:03.602-08:00</updated><title type='text'>Changing the SYSDBA default password ( Interbase Tutorial # 2 )</title><content type='html'>You can also see this post in &lt;a href="http://123codegeneratorina.blogspot.com/2010/02/cara-mengubah-default-password-sysdba.html"&gt;Bahasa Indonesia&lt;/a&gt;&lt;p&gt;In the previous tutorial, we have learnt to create a new user. The default password that we use to log in is ‘masterkey’. It is the default password of super user SYSDBA.&lt;br /&gt;&lt;/p&gt;Now, we are going to change this default password using our own. Because everyone can be easily connected to your database, and may do some harmful actions to your database, if we are still using the default password.&lt;br /&gt;&lt;br /&gt;First, we have to run the command prompt from the start menu. Go to the directory where the executable file ‘gsec.exe’ located.  It is usually located in :&lt;br /&gt;&lt;br /&gt;       C:\Program Files\InterBase Corp\InterBase\bin&gt;&lt;br /&gt;&lt;br /&gt;See the picture below&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S2eL5sgKiNI/AAAAAAAAAB4/idt7yESAlpw/s1600-h/directory.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 154px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S2eL5sgKiNI/AAAAAAAAAB4/idt7yESAlpw/s320/directory.jpg" alt="" id="BLOGGER_PHOTO_ID_5433465298760665298" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Then we need to log in using SYSDBA and the default password. Type this command :&lt;br /&gt;&lt;br /&gt;       &lt;span style="font-family:courier new;"&gt; gsec –user sysdba –password masterkey&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;change the  password using this command :&lt;br /&gt;&lt;br /&gt;       &lt;span style="font-family:courier new;"&gt; modify sysdba –pw newpassword&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The default password now has been changed with the new one : ‘newpassword’&lt;br /&gt;Type ‘quit’ to exit the program.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Go To &lt;a href="http://123codegenerator.blogspot.com/2010/01/interbase-tutorial-1.html"&gt;Previous&lt;/a&gt; Tutorial or &lt;a href="http://123codegenerator.blogspot.com/2010/02/toturial-interbase-3.html"&gt;Next&lt;/a&gt;Tutorial&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-327407803161036703?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/327407803161036703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-2-see-picture-below.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/327407803161036703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/327407803161036703'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-2-see-picture-below.html' title='Changing the SYSDBA default password ( Interbase Tutorial # 2 )'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/S2eL5sgKiNI/AAAAAAAAAB4/idt7yESAlpw/s72-c/directory.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2510980799611716564.post-4682210205296355205</id><published>2010-01-31T21:16:00.000-08:00</published><updated>2010-03-07T19:22:20.714-08:00</updated><title type='text'>Creating a New User in Interbase ( Interbase Tutorial # 1)</title><content type='html'>In this first tutorial, I want to share how to create a new user using interbase 5.0 (in interbase 6.0 is quite the same). First, you have to make sure that the interbase server has been installed to your computer. It will run automatically when you turn on your computer. If it doesn’t, then you need to run the interbase guardian manually by choosing the icon from the start menu.&lt;br /&gt;&lt;br /&gt;Starting the interbase server manager&lt;br /&gt;&lt;br /&gt;Run the interbase server manager from the folder on start menu. Then the interbase sever manager form will appear as the picture shown below.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S2ZkmLe5nYI/AAAAAAAAAA4/X8cip5I8Sb4/s1600-h/Interbase+Server+Manager.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 180px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S2ZkmLe5nYI/AAAAAAAAAA4/X8cip5I8Sb4/s320/Interbase+Server+Manager.jpg" alt="" id="BLOGGER_PHOTO_ID_5433140607549283714" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Logging in interbase server&lt;br /&gt;&lt;br /&gt;First you need to log in to the local interbase sever. Choose File – Server Login as the picture shown below.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kLg3mPfGL6E/S2ZlAcPFIvI/AAAAAAAAABA/MsoXoLMg8Nk/s1600-h/File+-+Server+Login.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 180px;" src="http://3.bp.blogspot.com/_kLg3mPfGL6E/S2ZlAcPFIvI/AAAAAAAAABA/MsoXoLMg8Nk/s320/File+-+Server+Login.jpg" alt="" id="BLOGGER_PHOTO_ID_5433141058722931442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Then the interbase login form will appear&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kLg3mPfGL6E/S2ZlTscB5tI/AAAAAAAAABI/QL_AnzIFPCA/s1600-h/Interbase+Login.jpg"&gt;&lt;img style="cursor: pointer; width: 258px; height: 300px;" src="http://4.bp.blogspot.com/_kLg3mPfGL6E/S2ZlTscB5tI/AAAAAAAAABI/QL_AnzIFPCA/s320/Interbase+Login.jpg" alt="" id="BLOGGER_PHOTO_ID_5433141389489727186" border="0" /&gt;&lt;/a&gt;&lt;p&gt;Input the user name : SYSDBA. It is the default user. Type the password : masterkey. Then press OK.&lt;br /&gt;After you log in, the interbase server manager will show the connection and the server summary.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S2Zl053dB_I/AAAAAAAAABQ/5jI4E-zfvhM/s1600-h/Interbase+Server+Manager+after+login.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 180px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S2Zl053dB_I/AAAAAAAAABQ/5jI4E-zfvhM/s320/Interbase+Server+Manager+after+login.jpg" alt="" id="BLOGGER_PHOTO_ID_5433141960030095346" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The picture shows that you have been connected to the local server, and the user being connected is SYSDBA&lt;br /&gt;&lt;br /&gt;Creating a new user&lt;br /&gt;&lt;br /&gt;To start creating a new user, choose Tasks – User Security as the picture shown below.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_kLg3mPfGL6E/S2ZmaEUVJDI/AAAAAAAAABY/x3s5AtQxpR8/s1600-h/Tasks+-+User+Security.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 180px;" src="http://2.bp.blogspot.com/_kLg3mPfGL6E/S2ZmaEUVJDI/AAAAAAAAABY/x3s5AtQxpR8/s320/Tasks+-+User+Security.jpg" alt="" id="BLOGGER_PHOTO_ID_5433142598490727474" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Then the interbase security form will appear&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S2Zm1XWPbAI/AAAAAAAAABg/3Liz_hZ1UoU/s1600-h/Interbase+Security.jpg"&gt;&lt;img style="cursor: pointer; width: 299px; height: 292px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S2Zm1XWPbAI/AAAAAAAAABg/3Liz_hZ1UoU/s320/Interbase+Security.jpg" alt="" id="BLOGGER_PHOTO_ID_5433143067455482882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;then click Add User&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S2ZnLjFel1I/AAAAAAAAABo/ZqKKjS_5akg/s1600-h/User+Configuration.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 246px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S2ZnLjFel1I/AAAAAAAAABo/ZqKKjS_5akg/s320/User+Configuration.jpg" alt="" id="BLOGGER_PHOTO_ID_5433143448563521362" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Type your new user name. Type and re-type your 8 character password. If you type more than 8 characters, the rest of them will not be used. Then click OK. A new user has been created as shown below.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_kLg3mPfGL6E/S2ZnqHQg6oI/AAAAAAAAABw/pJyL7UuGx_s/s1600-h/Interbase+Security+new+user's+been+created.jpg"&gt;&lt;img style="cursor: pointer; width: 299px; height: 292px;" src="http://1.bp.blogspot.com/_kLg3mPfGL6E/S2ZnqHQg6oI/AAAAAAAAABw/pJyL7UuGx_s/s320/Interbase+Security+new+user's+been+created.jpg" alt="" id="BLOGGER_PHOTO_ID_5433143973669563010" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Go to &lt;a href="http://123codegenerator.blogspot.com/2010/02/interbase-tutorial-2-see-picture-below.html"&gt;Next Tutorial&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2510980799611716564-4682210205296355205?l=123codegenerator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://123codegenerator.blogspot.com/feeds/4682210205296355205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://123codegenerator.blogspot.com/2010/01/interbase-tutorial-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4682210205296355205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2510980799611716564/posts/default/4682210205296355205'/><link rel='alternate' type='text/html' href='http://123codegenerator.blogspot.com/2010/01/interbase-tutorial-1.html' title='Creating a New User in Interbase ( Interbase Tutorial # 1)'/><author><name>Ari Christianto</name><uri>http://www.blogger.com/profile/12277107783848171091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_kLg3mPfGL6E/S2ZkmLe5nYI/AAAAAAAAAA4/X8cip5I8Sb4/s72-c/Interbase+Server+Manager.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
