• Log in or sign up for an account here: https://www.sythe.org/login

Basic delphi iteration.

TDD

Web Design Expert

Do Not Trade
Joined
Nov 20, 2005
Sythe Gold
0
Messages
3,191
Age
121
Location
Brisbane, Australia
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
 
looks good and straight forward. i enjoyed reading this thx
 
Great guide, although I have no idea what/how to use this.
 
Runescape Gamblingrunescape gambling
Back
Top