EvilZone

Programming and Scripting => Other => Topic started by: Kulverstukas on October 03, 2010, 10:10:13 PM

Title: Starting Delphi programming - Setting up a Delphi environment
Post by: Kulverstukas on October 03, 2010, 10:10:13 PM
Starting Delphi programming
Setting up a Delphi environment
Tutorial by Kulverstukas for Evilzone

Contents _
0x00 - Delphi
0x01 - Software
0x02 - Starting Delphi programming



0x00 - Delphi
Delphi - another word for "Object Pascal" given by "Borland", now known as "Embarcadero". First there was "Pascal" - for command line programming, and then it became "Object Pascal" - for OOP programming. Today, Borland a.k.a Embarcadero is still developing the Delphi language and is closed source and not free. There are ofcourse free ones, like FreePascal which is also Open Source. FreePascal by itself is a compiler. There are IDE's for FreePascal too. More on that later.
Delphi is also CrossPlatform :)



0x01 - Software
To compile any of the Delphi projects you will need a compiler and an IDE. To view the source you should only need a notepad.

Windows
Borland Delphi can be downloaded once you pay for it (or you know where to get it...) or you can use an alternative - Lazarus which uses FreePascal compiler that is maintained by a large community and the main IDE - Lazarus is always updated and maintained. Since I am more of a Open Source person, I will focus more on Lazarus. Before I go deeper I must say that Lazarus supports converting Borland Delphi projects/packages into it's own (Lazarus) projects and packages, ofcourse Lazarus does not have the same libraries that Borland Delphi has so when converting - you should take into consideration that it may not work so you will have to re-write the code. It's ofcourse a good idea to have 2 IDE's.
Lazarus: http://www.lazarus.freepascal.org/
FreePascal compiler: http://www.freepascal.org/


0x02 - Starting Delphi programming
Programming in Delphi is very easy. I assume that you are creating a GUI application, since that is the default when you open Lazarus. So without further confusion click on a Button component in Component palette and drop it onto your form, drop a Label component aswell. Now double click the button component on the form and start programming! here are few code samples:

Simple Hello World print
Code: [Select]
Label1.Caption := 'Hello World!';

Variable print
Code: [Select]
Variable1 := "Hello World!";
Label1.Caption := Variable1;

Math + print
Code: [Select]
Var1 := 10;
Var2 := 10;
Var3 := Var1 + Var2;
Label1.Caption := Var3;

A great site for learning the basics: http://delphi.about.com/ and http://www.delphibasics.co.uk/
A great site for a quick reference about Run-Time Library: http://www.freepascal.org/docs-html/rtl/
Good site with tutorials for intermediate Delphi programmers: http://codegearguru.com/index.php?option=com_content&task=blogsection&id=4&Itemid=27
Title: Re: Starting Delphi programming - Setting up a Delphi environment
Post by: th3g00n on April 30, 2012, 12:36:16 AM
What compiler do you use?
Title: Re: Starting Delphi programming - Setting up a Delphi environment
Post by: Kulverstukas on April 30, 2012, 07:20:30 AM
Mostly I use Borland's (now embarcadero) compiler that comes with their IDE's. Before that I was using FPC, but that didn't go very well since it's opensource so it lacks some stuff.
Title: Re: Starting Delphi programming - Setting up a Delphi environment
Post by: th3g00n on May 01, 2012, 02:31:04 AM
www.embarcadero.com/products/delphi

Did you buy this or did you get it for free? :-\
Title: Re: Starting Delphi programming - Setting up a Delphi environment
Post by: Kulverstukas on May 01, 2012, 08:04:49 AM
Does it look like I can spend 3k euros on software? I don't think so.
Title: Re: Starting Delphi programming - Setting up a Delphi environment
Post by: Axon on May 01, 2012, 10:41:00 AM
Is there a portable compiler for Delphi/Pascal ?
Title: Re: Starting Delphi programming - Setting up a Delphi environment
Post by: Kulverstukas on May 01, 2012, 02:24:45 PM
Is there a portable compiler for Delphi/Pascal ?
There is one for FreePascal, it's called FPC: http://www.freepascal.org/download.var
Title: Re: Starting Delphi programming - Setting up a Delphi environment
Post by: p_2001 on May 02, 2012, 11:43:13 AM
apart from learning another language, can you perhaps point out some advantages of it?
I mean most of us already know c,c++,java or some other language, what is the advantage of object pascal? especially in hacking?


Title: Re: Starting Delphi programming - Setting up a Delphi environment
Post by: Kulverstukas on May 02, 2012, 12:46:19 PM
That I do not know. It's easy, it's one of the oldest languages I guess... I know it because I had to learn Pascal at school, then I learned Delphi on my own to pwn the teachers.
Title: Re: Starting Delphi programming - Setting up a Delphi environment
Post by: erc on August 08, 2013, 09:15:06 AM
i downloaded and install Lazarus but this ide for pascal,i don't understand write and compile delphi :/
Title: Re: Starting Delphi programming - Setting up a Delphi environment
Post by: Kulverstukas on August 10, 2013, 01:57:41 PM
i downloaded and install Lazarus but this ide for pascal,i don't understand write and compile delphi :/
You sir, clearly did not read the whole post and references at the end of a post.