Getting started with Delphi

Posted on 2006-05-08
Last Modified: 2010-04-05
Any advice on how to get started in Delphi? I do alot of .Net - C#, VB.Net. Have done some Java. I don't even know what IDE to use. Thanks.
Question by:seinc
    LVL 3

    Assisted Solution

    LVL 22

    Accepted Solution

    start with Delphi 2006, so you could work with native Delphi win32 compiler and .Net too, beside the C# builder which included in Delphi 2006 IDE

    to start work with D2006, here are few links to help you get started

    Delphi Basics

    Learning Delphi Online

    Delphi land
    LVL 5

    Assisted Solution

    Now heres a interesting question, well every person here probably got started on delphi by just messing around with it.

    For information on how to do stuff in delphi just search google on the function or search for the information in the standard delphi help file, they are well documented and have loads of example to work off of. A book like Dummies for Delphi?

    Other wise if the question is to difficult just ask away here on EE where there are millions of people, and im sure 1 of them knows how to solve your problem.

    As for which Delphi Version to use id suggest "Delphi 7 Enterprise" no idea why well mabey cause 7 is my lucky number :P

    Peace Scay7

    PS welcome to the delphi world, the best dam place in da universe...
    LVL 16

    Assisted Solution

    Hi Seinc.

    First i'd like to say that i agree with Scay7. Use Delphi 7 (Enterprise or not).
    Now... About your question. Start like everyone started :P

    Create a folder. You are going to save your files in there.
    Open Delphi.

    The left window is Object inspector. There you can find a property named 'Caption' write this : 'Hi'.
    Now look at the menu, click the button icon and now click on the form. (You just created a button !)
    Double click the button and write:

    ShowMessage('Hello world');

    Now click the save button and then the play button.!!!

    Thats the way everybody started. :P
    Hope you find this usefull.
    LVL 5

    Assisted Solution

    I think for my self that D7 is da best cause its a good upgrade from D1-6 without the wierdness that 2005 2006 has never mind all the wierd things that come with it, but thats my opi.

    Heres my first program that i wrote...

    Open up delphi youll be presented with 4 main windows

    The one that starts with

    unit Unit1;



    is the coding window, where all code will be written

    The very big looking grey window that has lots of dots on it is called the FORM, this is where youll design how you program will look like

    The one on the LEFT of that is the Object inspector, where all quick settings are made to the thingy majigies

    The one on the TOP is the components, where all pre built program/functions/procedures are built into (button like) objects (very cool reason why i love delphi so much)

    K now on the top where those components are look for : STANDARD
    hover your mouse over the little pictures untill you see something called * Memo(stdctrls) *
    Click on that
    Now click on that grey window where all the dots are...
    You should see a white smalish window being placed

    Go back to that STANDARD and look for something called * button(stdctrls) *
    do the same thing as with the Memo
    and place it next to the white box(memo)

    Now add another button just underneath the first you that you placed doing the same thing as you did with the first one

    Its that big grey area you should have something looking like this

    |                                                                                |
    |                                _________________                  |
    |     ________            | memo1                 |                 |
    |    | button1 |           |                             |                 |
    |     -----------            |                             |                 |
    |    | button2 |           |                             |                 |
    |     -----------            |                             |                 |
    |                               |                             |                 |
    |                               |                             |                 |
    |                                ------------------------                  |
    |                                                                     ____     |
    |                                                                    ||/_/|    |
    |                                                                     -----     |

    K now on that same place where STANDARD is look for something called DIALOGS
    Then hover your mouse over the icons and look for something called * Opendialogs(Dialogs) *
    clck on that and place it anywhere on the grey part...


    this part i love... double click anywhere on the grey are where the dots are
    you should see something like this being created...

    procedure TForm1.FormCreate(Sender: TObject);
    opendialog1.Execute; //<-- starting a dialog to interact with you to select a file
    memo1.Lines.LoadFromFile(opendialog1.FileName)  //<-- and with the selected file opens/reads the contents to the    
                                                                               //      memo and pastes it...

    Well not the code that is inside that is, just copy the inside part of thise one and paste it into yours

    Now on the button1 double click it and this should have been created...

    procedure TForm1.Button1Click(Sender: TObject);
    done, lines : string;        //<-- declearing var's
    f : textfile;                      
    assignfile(f,opendialog1.FileName);  //<-- getting ready to open a file from that box that you selected
      while not eof(f) do
      readln(f,lines); //<-- reads the file 1 line at a time until there are no more line to read
      done := StringReplace(lines,' ','.',[rfReplaceAll]);  //<-- while reading those line searchs for " " (a space)
      memo1.Lines.Add(done)                                     //      and replaces it with a "." (dot)
    closefile(f);  //<-- always make sure you close the file once youre finished with it...

    Ye yours should look empty but just copy everything from Var to closefile(f); and insert it into yours

    Now double click the second button, and add the following...

    procedure TForm1.Button1Click(Sender: TObject);
    close;   //<--- so that we can close the program

    Well that was my first program, hope it helps you :PP in some strange way...

    Peace Scay7
    LVL 16

    Expert Comment

    :O ... You started with that ?

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now