Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

rodneyldixon

Problems with Delphi Hello World

This topic is 6208 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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 )

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!