Jamez, it's not too confusing, you just have to learn the langauge is all... Just like if you were to look at something in russian you wouldn't understand it, but if you learned it you would think it's easy! I used to thing C++ was crazy and impossible to understand, but I just cracked open a book and did a bit of it, and now it's easier to understand... I haven't had the time to fully learn a lot of the stuff in C++ but I've learned enough to be able to look through code and understand the syntax
Putting the laughter into manslaughter
17 years ago
Putting the laughter into manslaughter
Level 10
Yep, what Aikepah said - it looks confusing now. You just need more exposure to it ;)
It's your first OOP language, so you can expect a learning curve, but you'll catch on quickly.
And yes, other languages tell you when you aren't returning a value from a function
C++, VB, C# .. just not javascript, but that's because it's got loose type safety
Putting the laughter into manslaughter
17 years ago
Mon Feb 26 2007, 11:29pm
Putting the laughter into manslaughter
Level 10
I'd probably have picked java as well
But Delphi isn't bad at all, really. Just not as well used nowadays.
Well, nothing stops you from dabbling in it after hours ;)
Or something even more useful, like C# or Flash or C++
You're doing well so far. Just keep at it and enjoy !
I still love programming, after all these years. I can't imagine not coding in some form or another.
17 years ago
Sun Apr 08 2007, 10:21pm
@ Hawk, thats Grade 11 Delphi, I only have one word, holy [censored]. I'm in matric and I never did functions and procedures like you are doing, using a constructor to create them, like WTF?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.
Thats a blank unit for me, no constructor in there.
I declare functions like so:
Function Function Name ( Variable Parameters : Data Type; ... ) : Result Data Type;
Then procedures I do like so:
Procedure Procedure Name ( Value Parameters : Data Type; var Reference Parameters : Data Type);
See no create there.
I'm scared! ;) I started a BSC this year and will be cracking on with Delphi sometime this week. Haven't looked at it yet tho, I'm supremely lazy! haha
We have our final project due in one month. For some reason (still unclear to me) I decided to program a game of monopoly in Java. I've got some basic planning down but the main application is still looking VERY daunting as I'm still not sure how to actually move the pieces round the board !frown
17 years ago
Mon Apr 09 2007, 12:27pm
Lolz I also have a Delphi project due, all I can say is I hate records, arrays, record arrays and databases. Its a pain.
Functions are easy to create, because they only return one value, whereas procedures can return none, one or more than one value.
Just tell me what the function must do, and what variables it must receive and I will see what I can help with.