PDA

View Full Version : Delphi



Ninjabear
20-04-2005, 03:29 AM
I was just wondering if anybody is familiar with delphi and could provide me with some tutorial on msn messenger?

Doing a programming fundamental paper.Sometimes I do not understand something like writing out loops etc.

I was wondering if anybody have spare time and could provide me for some help?

Thanks

drcspy
20-04-2005, 08:58 AM
i know a little delphi but I doubt i can help you unfortunately...I did teach myself to write some simple programs in delphi three or four years ago... what I can say is ....do a web search and you'll find a LOT of help out there..

Prescott
20-04-2005, 08:18 PM
pcworld did a coloumn about delphi last year or so..... even gave out free full copies of delphi on the pc world cd.

Ninjabear
21-04-2005, 03:31 AM
Hi

Do u find anything wrong with this code?I've just typed it up for my assignment


procedure TForm1.Button1Click(Sender: TObject);

var
payratedollars : integer;
hoursperweek : integer;
payrateamount : integer;
line : string
begin
hoursperweek :=5
line:= '';

for payratedollars 5 to 10 do
begin
payRateAmount:= payratedollars * payrateamount
line:= line + 'Your Pay will be ' + intToStr(payrateamount);
end
memo1.lines.add(line);


I made a memo box and also a button and put the code in the butto.Display the answer in the memo box

When I click run it says expected but BEGIN not found.Any ideas?

I've been looking everywhere and can't form a loop inside a loop

We are calculating how much $$ earn for number of hours per hour multiply by number of hours per week

The number of dollars per hours going across

The number of hours per week going down

I am trying think of a loop that can do that.I have completely no idea how to form it?Beenr eading all the text books.No help

----------------5,6,7,8,9,10

10/hrs per week
11/hrs per week
12/hrs per week

etc

So the first answer would be $50 as 5 multiply by 10 is $50

I have found the formula which I have typed at the top to calculate the $$ earn but am having problem telling the program to calculate the next row down.I am struggling.Anybody can help me?

Thanks

Prescott
21-04-2005, 01:28 PM
i wouldnt have a clue with delphi, i dont know anything about it. im learning JAVA at the moment...
hopefully someone here will be able to help you.

Graham L
21-04-2005, 05:15 PM
This is Pascal, so it's very fussy about punctuation. ;)

Semicolons are not optional most of the time. They terminate statements. You've missed some. (It's best to always use the ";" ... ocassionally it produces a null statement. That doesn't do any harm.)

You have to assign the starting value of the for loop.

Nested loops? What's the problem?
Indentation is a great help to understanding.
I always use comments in the end line of blocks. (Two of the semicolons after "end"s could be omitted. It's much easier to put them in. ;)
I suppose Delphi allows the "{" and "}" comment delimiters ...



procedure loopy;
var
joe, fred, him :integer;
begin
for joe := 1 to 100 do
begin
{ other code in this block }
for fred := 1 to 40 do
begin
{ more code in this block }
him := joe*fred;
{ or more mocde still }
end { fred loop };
end { joe loop };
end { loopy };

Ninjabear
22-04-2005, 04:21 AM
Can't find anything up at google.Can delphi 5 open delphi 7 projects and the other way round?

Prescott
22-04-2005, 09:43 AM
maybe it would be better if you posted on a delphi programming help fourm