Problems with Delphi Hello World

Started by
17 comments, last by rodneyldixon 22 years, 10 months ago
Ok I went and bought this book on Delphi Programming, and its showing how to write a Hello World by putting a button on the form, and typing in the code for it. And I do this by putting a standard button on the form, and then I look in the Object Inspector and I click Events, it then shows me whenclickedon, and I double click in the box on the right side of it, and this is where I type in the code: Label1.Caption := 'Hello World'; I'm using Borland Delphi 5.0 Enterprise Edition IDE. And when I click run, it gives me a bunch of errors. Why?, And how do I fix them? Edited by - rodneyldixon on June 20, 2001 1:29:59 PM
Advertisement
I don''t know delphi, so i cannot help you, but here is some advice:

If you want people to help you, you should post more details about your problem, especially which errors you are recieving.

People are hesitant to help someone who asks only vague questions.
This is my signature. There are many like it, but this one is mine. My signature is my best friend. It is my life. I must master it as I must master my life. My signature, without me, is useless. Without my signature, I am useless.
What errors are shown?.
RPG game programming and tutorials - Playable demo in Progress!
http://www.rrc2soft.com
Hmm i dunno delphi but did you make that label called label1?
Hmm i dunno delphi but did you make that label called label1?
hehe,

where did you get that label from....

Dunno, should work. Try compiling samples shipped with borland.
If they also don''t work, then you probably have to reinstall orso...

Sounds more like you missing some part of Delphi (the labels duhhh.. )

Gr,
BoRReL
OK rodney, you gotta Delphi programmer here, and based on what you''re putting up here, Mulder''s bet is best: you probably didn''t drop the label on the form.

The first question is, of course, what kind of errors you got on compile. After that, make sure you''ve got a label on there named Label1 (which it will name itself by default). It will default to a Caption of ''Label1'' when you run it.

You know what the coolest things about Delphi are? Strings are a datatype and not a class (can''t call string.length() anymore)! Strings have an initial subscript of 1 and not 0!!

And remember, when in doubt, Ctrl+F2 in the IDE resets the program, and is your most special friend!


---------------
-WarMage
...may the happiness hit ya where the good lord split ya...
Ok, let me put it in a way that everyone can understand. I''m using Borland Delphi 5.0 Enterprise Edition.

Step 1: I put a button on the form
Step 2: I click it, and then click the Events tab
Step 3: I double click on whenclickedon
Step 4: It brings it up where I can type code for that button
Step 5: I type: Label1.Caption := ''Hello World'';
Step 6: I click run and it gives me the following errors :

Unit.pas(28): Undeclared indentifier: ''Label1''
Unit.pas(33): Declaration expected but end of file found
Project1.dpr(5): Could not compile used unit ''Unit1.pas''

But I can run all the samples that came with it. So how do I fix this problem?
like i said
you haven''t defined label1 so you have to drag and drop a label there and call it label1 after that run it and it should work i think (me don''t know delphi )
Don´t expect him to listen to you....
-------------Ban KalvinB !

This topic is closed to new replies.

Advertisement