Re: [fpc-pascal] Re: FPC programs in Android without JNI

2011-01-06 Thread Felipe Monteiro de Carvalho
On Tue, Dec 28, 2010 at 7:03 AM, Florian Klämpfl  wrote:
> What FPC did you use? Just a plain arm compiler with an eabi rtl?

Software floating point should be activated too, because most phones
have no FPU.

> I thought 2.3 support now native apps using the android user interface?

It is getting closer, but still, not really.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Supports() only checks declared interfaces?

2011-01-06 Thread Michalis Kamburelis
Hi,

Consider the attached source code. I have a base interface (IA) and a
descendant interface (IB). Class TB is declared as

  TB = class(TInterfacedObject, IB) end;

Now I would expect that both

  Supports(TB, IA)
  Supports(TB, IB)

return true. After all, TB is forced to implement methods of both IA and
IB, as IB descends from IA. But to my surprise, Supports(TB, IA) returns
false.

Changing the declaration to

  TB = class(TInterfacedObject, IA, IB) end;

workarounds the problem (Supports(TB, IA) returns true), but seems
strange in my opinion.

I haven't found any explanation for this e.g. in docs
(http://freepascal.org/docs-html/rtl/sysutils/supports.html ,
http://freepascal.org/docs-html/ref/refch7.html ).

Is this the expected behavior? Documented anywhere? Or is this a bug,
and I should submit it?

Thanks,
Michalis
{$mode objfpc}

uses SysUtils;

type
  IA = interface
  ['{5E3D46A0-71B5-4561-B6B4-43A5BE5896EF}']
  end;

  IB = interface(IA)
  ['{19D68914-F2BA-4CFA-90A1-F561DB264678}']
  end;

  TA = class(TInterfacedObject, IA) end;
  TB = class(TInterfacedObject, IB) end;

begin
  Writeln(Supports(TA, IA)); // true
  Writeln(Supports(TA, IB)); // false
  Writeln(Supports(TB, IA)); // should be true, but is false ??
  Writeln(Supports(TB, IB)); // true
end.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Supports() only checks declared interfaces?

2011-01-06 Thread Paul Ishenin

06.01.2011 20:14, Michalis Kamburelis wrote:

return true. After all, TB is forced to implement methods of both IA and
IB, as IB descends from IA. But to my surprise, Supports(TB, IA) returns
false.

Changing the declaration to

   TB = class(TInterfacedObject, IA, IB) end;

workarounds the problem (Supports(TB, IA) returns true), but seems
strange in my opinion.

I haven't found any explanation for this e.g. in docs
(http://freepascal.org/docs-html/rtl/sysutils/supports.html ,
http://freepascal.org/docs-html/ref/refch7.html ).

Is this the expected behavior? Documented anywhere? Or is this a bug,
and I should submit it?

This is expected behavior. It works the same way as in delphi.

Best regards,
Paul Ishenin
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: [Lazarus] complex ini like syntax parser

2011-01-06 Thread Gene Buckle

On Wed, 5 Jan 2011, leledumbo wrote:



If you want something fast, pyacc and plex distributed with fpc can be an
option. But I suggest writing your own since that way you'll have a full
control of its features.


Is there an fpc version of TIniFile?

g.

--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.simpits.org/geneb - The Me-109F/X Project

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://www.scarletdme.org - Get it _today_!

Political correctness is a doctrine, fostered by a delusional, illogical
minority, and rabidly promoted by an unscrupulous mainstream media, which
holds forth the proposition that it is entirely possible to pick up a turd
by the clean end.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: [Lazarus] complex ini like syntax parser

2011-01-06 Thread Howard Page-Clark

On 06/1/11 2:49, Gene Buckle wrote:

On Wed, 5 Jan 2011, leledumbo wrote:



If you want something fast, pyacc and plex distributed with fpc can be an
option. But I suggest writing your own since that way you'll have a full
control of its features.


Is there an fpc version of TIniFile?

g.


look in
..fpc\version_number\source\packages\fcl-base\src\inifiles.pp

H
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: [Lazarus] complex ini like syntax parser

2011-01-06 Thread Gene Buckle

On Thu, 6 Jan 2011, Howard Page-Clark wrote:


On 06/1/11 2:49, Gene Buckle wrote:

On Wed, 5 Jan 2011, leledumbo wrote:



If you want something fast, pyacc and plex distributed with fpc can be an
option. But I suggest writing your own since that way you'll have a full
control of its features.


Is there an fpc version of TIniFile?

g.


look in
..fpc\version_number\source\packages\fcl-base\src\inifiles.pp

Thanks.  I suspect this might work for the person that was looking for 
something like this. :)


g.
--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.simpits.org/geneb - The Me-109F/X Project

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://www.scarletdme.org - Get it _today_!

Political correctness is a doctrine, fostered by a delusional, illogical
minority, and rabidly promoted by an unscrupulous mainstream media, which
holds forth the proposition that it is entirely possible to pick up a turd
by the clean end.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Supports() only checks declared interfaces?

2011-01-06 Thread Michalis Kamburelis
Paul Ishenin wrote:
> 06.01.2011 20:14, Michalis Kamburelis wrote:
>> return true. After all, TB is forced to implement methods of both IA and
>> IB, as IB descends from IA. But to my surprise, Supports(TB, IA) returns
>> false.

> This is expected behavior. It works the same way as in delphi.
> 

Thank you.

So, the natural next question: is there some construct similar to the
Supports() function, that avoids this problem? That is, something that
detects that class TB supports both IA and IB interfaces, even though
it's declared only as "TB = class(TInterfacedObject, IB)" ?

Or is my only choice to just declare "TB = class(TInterfacedObject, IA,
IB)" ?

Michalis
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Supports() only checks declared interfaces?

2011-01-06 Thread Paul Ishenin

06.01.2011 23:25, Michalis Kamburelis wrote:

So, the natural next question: is there some construct similar to the
Supports() function, that avoids this problem? That is, something that

No.

detects that class TB supports both IA and IB interfaces, even though
it's declared only as "TB = class(TInterfacedObject, IB)" ?

TB is declared as it only implements IB.

Or is my only choice to just declare "TB = class(TInterfacedObject, IA,
IB)" ?

Yes.

Best regards,
Paul Ishenin
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal