Author Topic: Starting Delphi programming - Setting up a Delphi environment  (Read 11513 times)

0 Members and 1 Guest are viewing this topic.

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Starting Delphi programming - Setting up a Delphi environment
« 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

th3g00n

  • Guest
Re: Starting Delphi programming - Setting up a Delphi environment
« Reply #1 on: April 30, 2012, 12:36:16 am »
What compiler do you use?

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Starting Delphi programming - Setting up a Delphi environment
« Reply #2 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.

th3g00n

  • Guest
Re: Starting Delphi programming - Setting up a Delphi environment
« Reply #3 on: May 01, 2012, 02:31:04 am »
www.embarcadero.com/products/delphi

Did you buy this or did you get it for free? :-\

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Starting Delphi programming - Setting up a Delphi environment
« Reply #4 on: May 01, 2012, 08:04:49 am »
Does it look like I can spend 3k euros on software? I don't think so.

Offline Axon

  • VIP
  • King
  • *
  • Posts: 2047
  • Cookies: 319
    • View Profile
Re: Starting Delphi programming - Setting up a Delphi environment
« Reply #5 on: May 01, 2012, 10:41:00 am »
Is there a portable compiler for Delphi/Pascal ?

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Starting Delphi programming - Setting up a Delphi environment
« Reply #6 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

Offline p_2001

  • Royal Highness
  • ****
  • Posts: 684
  • Cookies: -64
    • View Profile
Re: Starting Delphi programming - Setting up a Delphi environment
« Reply #7 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?


"Always have a plan"

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Starting Delphi programming - Setting up a Delphi environment
« Reply #8 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.

Offline erc

  • NULL
  • Posts: 3
  • Cookies: 0
  • Anarchism!
    • View Profile
Re: Starting Delphi programming - Setting up a Delphi environment
« Reply #9 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 :/

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Starting Delphi programming - Setting up a Delphi environment
« Reply #10 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.