Adblock breaks this site

Basic delphi iteration.

Discussion in 'Archives' started by TDD, Apr 8, 2008.

  1. TDD

    TDD Web Design Expert
    Do Not Trade

    Joined:
    Nov 20, 2005
    Posts:
    3,191
    Referrals:
    2
    Sythe Gold:
    0
    Basic delphi iteration.

    Ok, so we're going to make a fun little loop, so open up Delphi (I'm using Delphi 7)

    now, you'll have your empty application, with all your options, etc.

    Double click the form to go to the formCreate area of the program.

    now, make a new line above the begin, and type the following:
    Code:
    var x: integer;
    this declares the variable 'x' as an integer, or whole number, so whenever we use 'x' in the program, it will assosiate it with this variable.

    now below the begin type this:

    Code:
    x := 0;
    while x < 1 do
    alert('Hello');
    what does this do?

    Code:
    x := 0;
    ^^This assigns the value 0 to 'x'

    Code:
    while x < 1 do
    ^^This is the condition used for our while do loop, it checks to see if x is a number less then 1, if it is, it does whatever is after the 'do'

    Code:
    alert('Hello');
    ^^This shows a popup on screen that says "Hello"

    NOTE: There is no ';' after the do, this is because delphi registers the first semicolon in the while do loop as the end of the loop.

    Now click the green play button in delphi to test your program, if it runs you did it right, congratulations! now have fun.

    It's only basic, but it gives you a little delphi fun.

    <3 TDD
     
  2. ki_am

    ki_am Guest

    Referrals:
    0
    Basic delphi iteration.

    Pretty cool thanks alot.
     
  3. Faskist

    Faskist Tuxhead
    Banned

    Joined:
    Apr 25, 2005
    Posts:
    1,869
    Referrals:
    0
    Sythe Gold:
    0
    Basic delphi iteration.

  4. ssj_ion

    ssj_ion Guest

    Referrals:
    0
    Basic delphi iteration.

    rofl thats cool
     
  5. Uber l33t

    Uber l33t Active Member
    Banned

    Joined:
    Jun 14, 2008
    Posts:
    208
    Referrals:
    0
    Sythe Gold:
    0
    Basic delphi iteration.

    Lol I like that
    Pretty cool :p
     
  6. joking

    joking Apprentice
    Do Not Trade

    Joined:
    Nov 9, 2007
    Posts:
    736
    Referrals:
    3
    Sythe Gold:
    0
    Basic delphi iteration.

    looks good and straight forward. i enjoyed reading this thx
     
  7. The 1337 Tank

    The 1337 Tank Forum Addict
    Banned

    Joined:
    Aug 5, 2008
    Posts:
    428
    Referrals:
    0
    Sythe Gold:
    0
    Basic delphi iteration.

    pretty tight :D
     
  8. Deacon Frost

    Deacon Frost Grand Master
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57
    Basic delphi iteration.

    Circular reasoning works because...circular reasoning works because...circular reasoning works because...
     
  9. Noob!

    Noob! Forum Addict
    Banned

    Joined:
    Aug 29, 2008
    Posts:
    322
    Referrals:
    0
    Sythe Gold:
    0
    Basic delphi iteration.

    Gnarly.. Do U Design For A Living?
     
  10. Bring Me The Horizon

    Bring Me The Horizon SCAMMER
    Banned

    Joined:
    Feb 16, 2009
    Posts:
    2,310
    Referrals:
    5
    Sythe Gold:
    0
    Basic delphi iteration.

    Can i ask.. what is Delphi used to code? Programs? Web Sites?
     
  11. DoorKnawb

    DoorKnawb Active Member

    Joined:
    Feb 10, 2009
    Posts:
    232
    Referrals:
    0
    Sythe Gold:
    0
    Basic delphi iteration.

    Nice guide, may help people getting into coding. Yeah for while statements!
     
  12. uhh omg rofl

    uhh omg rofl Newcomer
    Banned

    Joined:
    Feb 20, 2009
    Posts:
    22
    Referrals:
    0
    Sythe Gold:
    0
    Basic delphi iteration.

    awesome.
     
  13. Glummy

    Glummy Forum Addict
    Banned

    Joined:
    Apr 7, 2008
    Posts:
    467
    Referrals:
    1
    Sythe Gold:
    0
    Basic delphi iteration.

    Great guide, although I have no idea what/how to use this.
     
< Msn messenger help | Publishing Voicemail to Twitter. >


 
 
Adblock breaks this site