Board index » delphi » Re: Care to test your Delphi knowledge?

Re: Care to test your Delphi knowledge?


2006-11-30 05:36:10 AM
delphi127
Zarko Gajic writes:
Quote
delphi.about.com/b/a/257675.htm
You should also do one when it is a class and not a record.
--
Compact Framework for Delphi 2006: www.jed-software.com/cf.htm
QualityCentral Windows Client: www.jed-software.com/qc.htm
Visual Forms IDE Add In: www.jed-software.com/vf.htm
 
 

Re: Care to test your Delphi knowledge?

Hi (this is a repost from borland.public.delphi.students, thread "Record as
a Property in a Delphi Class"),
Take a look at the following class declarations and code, then answer the
poll question...
delphi.about.com/b/a/257675.htm
p.s.
I'm reposting it here .. as most of the votes/answers are wrong!?
~Zarko Gajic
 

Re: Care to test your Delphi knowledge?

Rick Carter writes:
Quote
Wouldn't you do better to correct the situation where visitors to your
site are most likely to assume the answer with the most votes is the
correct one? After all, as far as I can tell, there's no obvious
place people can go to find out what you consider the correct answer,
and why.
I'm sure Zarko will post a follow up to the poll and give the correct
answer and the "why".
--
Compact Framework for Delphi 2006: www.jed-software.com/cf.htm
QualityCentral Windows Client: www.jed-software.com/qc.htm
Visual Forms IDE Add In: www.jed-software.com/vf.htm
 

Re: Care to test your Delphi knowledge?

Quote
I'm reposting it here .. as most of the votes/answers are wrong!?
This is really funny ;). Also, tells us about how honest
Delphi developers are, cause they obviously didn't try
it before answering ;)).
Michael
 

Re: Care to test your Delphi knowledge?

"Zarko Gajic" <XXXX@XXXXX.COM>wrote
Quote
delphi.about.com/b/a/257675.htm
It is about object class properties referring to records.
Which reminds me that one of my useful constructs is
to let properties refer to fields within object fields. Like
tStr3 = string[3];
tMyFileHdr = packed record
RecType: tStr3;
RecSize: LongInt;
end;
tMyObject = class
private
fFileHdr: tMyFileHdr;
procedure SetRecSize(const Value: LongInt);
public
property RecType: tStr3 read fFileHdr.RecType;
property RecSize: LongInt read fFileHdr.RecSize write
SetRecSize;
end;
--JohnH
 

Re: Care to test your Delphi knowledge?

Rick Carter writes:
Quote
After all, as far as I can tell, there's no obvious
place people can go to find out what you consider the correct answer,
Huh?? Type the code in and try it!
--
Wayne Niddery - Winwright, Inc (www.winwright.ca)
"The purpose of morality is to teach you, not to suffer and die, but to
enjoy yourself and live." - Ayn Rand
 

Re: Care to test your Delphi knowledge?

I have to say I am surprised that there was so many wrong answers,
especially as one class is obvious, another class is logical, leaving
only one of the options as difficult to reason out.
I would probably have got it wrong, had I not "been there, done that".
(If I am vague - it is to not put a spoiler here).
"Zarko Gajic" <XXXX@XXXXX.COM>writes:
Quote
delphi.about.com/b/a/257675.htm
I'm reposting it here .. as most of the votes/answers are wrong!?
--
Lars Fosdal
lars(q)fosdal.com
www.fosdal.com
 

Re: Care to test your Delphi knowledge?

Zarko Gajic writes:
Quote
delphi.about.com/b/a/257675.htm

p.s.
I'm reposting it here .. as most of the votes/answers are wrong!?
Oh, my! So, you're hoping to get more correct answers from this forum,
and thus "correct" the votes?
Wouldn't you do better to correct the situation where visitors to your
site are most likely to assume the answer with the most votes is the
correct one? After all, as far as I can tell, there's no obvious place
people can go to find out what you consider the correct answer, and why.
Rick Carter
XXXX@XXXXX.COM
Chair, Delphi/Paradox SIG, Cincinnati PC Users Group
--- posted by geoForum on delphi.newswhat.com
 

Re: Care to test your Delphi knowledge?

Rick Carter writes:
Quote
Zarko Gajic writes:
>delphi.about.com/b/a/257675.htm
>
>p.s.
>I'm reposting it here .. as most of the votes/answers are wrong!?

Oh, my! So, you're hoping to get more correct answers from this
forum, and thus "correct" the votes?

Wouldn't you do better to correct the situation where visitors to your
site are most likely to assume the answer with the most votes is the
correct one? After all, as far as I can tell, there's no obvious
place people can go to find out what you consider the correct answer,
and why.

Rick Carter
XXXX@XXXXX.COM
Chair, Delphi/Paradox SIG, Cincinnati PC Users Group

--- posted by geoForum on delphi.newswhat.com
Just put the code in Delphi and try it...
--
 

Re: Care to test your Delphi knowledge?

"Rick Carter" <XXXX@XXXXX.COM>writes
Quote
Oh, my! So, you're hoping to get more correct answers from this forum,
and thus "correct" the votes?

Wouldn't you do better to correct the situation where visitors to your
site are most likely to assume the answer with the most votes is the
correct one? After all, as far as I can tell, there's no obvious place
people can go to find out what you consider the correct answer, and why.
Rick, (why the angry tone?)
"Correct the votes"- yes as it sounds strange that there are so many wrong
ones.
Of course I will expose the correct answer, as anybody can do. "Copy" the
code and hit Ctrl+F9 :)
But the question that many will ask after Ctrl+F9 (I guess from the votes)
is "why" is there a compile error.
~Zarko
 

Re: Care to test your Delphi knowledge?

Hi,
Michael Baytalsky writes:
Quote
>I'm reposting it here .. as most of the votes/answers are wrong!?
This is really funny ;). Also, tells us about how honest
Delphi developers are, cause they obviously didn't try
it before answering ;)).
IMHO that is the whole point. I thought about copying the code and trying to
compile it but decided against it because that would not have tested my
knowledge but only my ability to correctly copy and paste. And of course I
already know that I can copy and paste.
Now, I still don't know for sure whether my answer was correct, so now I am
going to do some copy and paste to find out...
MfG
twm
 

Re: Care to test your Delphi knowledge?

Hi,
Thomas Mueller writes:
Quote
>>I'm reposting it here .. as most of the votes/answers are wrong!?
>This is really funny ;). Also, tells us about how honest
>Delphi developers are, cause they obviously didn't try
>it before answering ;)).
IMHO that is the whole point. I thought about copying the code and trying
to compile it but decided against it because that would not have tested my
knowledge but only my ability to correctly copy and paste. And of course I
already know that I can copy and paste.
Now, I still don't know for sure whether my answer was correct, so now I
am going to do some copy and paste to find out...
Argl! I still haven't tried it but already found that I was wrong :-(
And I should have known because I stumbled over exactly that issue a few
days ago but had forgotten until I looked at the examples the second time.
MfG
twm
 

Re: Care to test your Delphi knowledge?

Michael Baytalsky writes:
Quote
You can copy and paste into Delphi to see the correct answer and
why... ;).
I know the answer and don't need to copy it into Delphi to try it.
--
Compact Framework for Delphi 2006: www.jed-software.com/cf.htm
QualityCentral Windows Client: www.jed-software.com/qc.htm
Visual Forms IDE Add In: www.jed-software.com/vf.htm
 

Re: Care to test your Delphi knowledge?

Quote
>Wouldn't you do better to correct the situation where visitors to your
>site are most likely to assume the answer with the most votes is the
>correct one? After all, as far as I can tell, there's no obvious
>place people can go to find out what you consider the correct answer,
>and why.

I'm sure Zarko will post a follow up to the poll and give the correct
answer and the "why".
You can copy and paste into Delphi to see the correct answer and why... ;).
Michael
 

Re: Care to test your Delphi knowledge?

Michael Baytalsky writes:
Quote
Good for you ;). My point was, there's no reason for Zarko to ever
post a follow up with the answer for the reason I mentioned above ;).
Your post wasn't clear and I was confused as to why you said "You can".
Typing that into the editor doesn't really give you the WHY though,
especially if someone answered it incorrectly in the first place.
--
Compact Framework for Delphi 2006: www.jed-software.com/cf.htm
QualityCentral Windows Client: www.jed-software.com/qc.htm
Visual Forms IDE Add In: www.jed-software.com/vf.htm