[fpc-pascal]inherited keyword

2003-12-21 Thread Mattias Gaertner

Can someone explain the semantic difference between *1 and *2 please?

procedure A(p: Type1);
begin
  inherited; // *1
  inherited A(p); // *2
end;

?


Mattias

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]inherited keyword

2003-12-21 Thread Florian Klaempfl
Mattias Gaertner wrote:

Can someone explain the semantic difference between *1 and *2 please?

procedure A(p: Type1);
begin
  inherited; // *1
  inherited A(p); // *2
end;
?
1: supporting a delphi bug
2: as you expect
Well, the comment to 1 isn't completly true: In method handlers 
(declared with message XXX), a simply inherited should pass the message 
to the parent message handle while in usual methods it does nothing.

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]inherited keyword

2003-12-21 Thread Thomas Schatzl
Hello,


> > Can someone explain the semantic difference between *1 and *2 please?
> >
> > procedure A(p: Type1);
> > begin
> >   inherited; // *1
> >   inherited A(p); // *2
> > end;
> >
> > ?
>
> 1: supporting a delphi bug
> 2: as you expect
>
> Well, the comment to 1 isn't completly true: In method handlers
> (declared with message XXX), a simply inherited should pass the message
> to the parent message handle while in usual methods it does nothing.

According to the D7 docs both types of syntaxes (sp?) are completely legal
and defined such that both terms are semantically equal.

 snip from D7 docs:

The reserved word inherited plays a special role in implementing polymorphic
behavior. It can occur in method definitions, with or without an identifier
after it.

If inherited is followed by the name of a member, it represents a normal
method call or reference to a property or field--except that the search for
the referenced member begins with the immediate ancestor of the enclosing
method's class. [Type 2]

[...example omitted...]

When inherited has no identifier after it, it refers to the inherited method
with the same name as the enclosing method or, if the enclosing method is a
message handler, to the inherited message handler for the same message. In
this case, inherited takes no explicit parameters, but passes to the
inherited method the same parameters with which the enclosing method was
called. [Type 1]

[...example omitted...]

--- snip end

Or am I misinterpreting these few lines?

Probably they [the Borland guys] adapted the docs for buggy behaviour of
earlier Delphi versions... =)

Regards,
  Thomas


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]inherited keyword

2003-12-21 Thread Mattias Gaertner
On Sun, 21 Dec 2003 17:36:00 +0100  Florian Klaempfl
<[EMAIL PROTECTED]> wrote:

> Mattias Gaertner wrote:
> 
> > Can someone explain the semantic difference between *1 and *2 please?
> > 
> > procedure A(p: Type1);
> > begin
> >   inherited; // *1
> >   inherited A(p); // *2
> > end;
> > 
> > ?
> 
> 1: supporting a delphi bug
> 2: as you expect
> 
> Well, the comment to 1 isn't completly true: In method handlers 
> (declared with message XXX), a simply inherited should pass the message 
> to the parent message handle while in usual methods it does nothing.

What do you mean with "it does nothing"? It calls the ancestor method, does
it not?

Back to my initial question: It is indeed about a message method.
I have got a message method where "inherited;" and "inherited
MethodName(Param);" is not always the same. The strange thing is: It depends
on how the objects are created. 
Is this a bug?


Mattias

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]How to load a png image

2003-12-21 Thread Karim
Hello 

I want to know, how to load a png image with freepascal ?
There is a png libpng package shipped with FreePascal, but I cannot find
any examples or docs. 
Or are there any onther simple image formats that can be loaded into a
freepascal program ?
Some suggestions would be nice. 
Thanks  
Karim
-- 
  Karim
  [EMAIL PROTECTED]

-- 
http://www.fastmail.fm - Same, same, but differentÂ…

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]How to load a png image

2003-12-21 Thread Michalis Kamburelis
Karim wrote:
Hello 

I want to know, how to load a png image with freepascal ?
There is a png libpng package shipped with FreePascal, but I cannot find
any examples or docs. 
Pascal unit Libpng is just a wrapper that calls functions from 
libpng.so. Documentation for libpng is available at the official page of 
libpng, http://www.libpng.org, you will most likely be interested in 
this document:
  http://www.libpng.org/pub/png/libpng-1.2.5-manual.html

Or are there any onther simple image formats that can be loaded into a
freepascal program ?
Well, everything can be loaded into a Pascal program...

The simplest possible image format is ppm (it is just a small header + 
array of RGB values for each pixel) - if you are on UNIX-like system and 
have installed proper documentation then
  man ppm
should give you a simple specification of ppm format. You may also take 
a look at it's cousins, pbm, pgm and the most general one, pnm.

Regards,
Michalis
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal