The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,679 other followers

(Old style Pascal objects): Could you please remind me if Objects support polymorphism? For instance, I…

Posted by jpluimers on 2014/07/17

I observe an increase of people not asking questions on Stack Overflow any more…

Today, two interesting questions caught my eye.

The first one was by Martijn Coppoolse about Is it possible to figure out whether a type’s property has a ‘stored’ flag or not, preferably without having to create an instance of that type? (note: emphasis is mine)

Then the most interesting one (note this is about old Turbo Pascal style object syntax that is still available in Delphi, yes polymorphism with the object keyword): Could you please remind me if Objects support polymorphism? by Roman Yankovsky.

–jeroen

PS: Martijn posted the solution he used:

So I tried looking at the StoredProc pointer, and I can differentiate between three states:
  1. nil, which means stored False;
  2. Pointer(1), which means that no stored flag was specified;
  3. an actual pointer, which means that a method was specified; and the pointer seems to point at the relevant method’s CodeAddress. However, we always use private methods for that, and those don’t seem to be enumerated by GetMethods.

Still, those three states are basically what I needed: don’t include an element when StoredProc = nil; when StoredProc = Pointer(1) make it compulsory, and make it optional otherwise when it’s a pointer.
Thanks a lot to all who helped! +Qing-Shan Xiao +Jeroen Wiert Pluimers +Asbjørn Heid

–jeroen

3 Responses to “(Old style Pascal objects): Could you please remind me if Objects support polymorphism? For instance, I…”

  1. EMB said

    More of time one will want not only a answer, but a discussion about the subject, like a conversation with a fellow company developer. For that, StackOverflow is not suitable. Once you learn that, you will use it less.

  2. Rich Shealer said

    Regarding the amount of questions on Stackoverflow. I’ve asked a few, but most of what I need has already been asked and answered.

  3. vor0nwe said

    The main reasons for posting in the Google+ Delphi community and not (immediately) on StackOverflow are that the responses are usually quite good anyway, and also that G+ notifies me of a reply however I want — on all Google websites, via e-mail, or in a phone notification — whereas StackOverflow only notifies me when I’m actually using their site or app.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: