Am 29.04.2021 um 20:14 schrieb Ryan Joseph via fpc-pascal:
Is this a bug in properties and I should be getting an error?
type
TPixel = record
components: array[0..3] of byte;
property R: byte read components[10] write components[10];
end;
Well, there should *a
On 29/04/2021 13:04, LacaK via fpc-pascal wrote:
> In regular virtual method, I expect, that Self resolves to runtime class
> type, thust calling CP1 should resolve to runtime type class method.
It works the same for class methods and non-class methods: no virtual =
no dynamic resolution when call
Thanks everyone for the help. I have it working now
I did some more searching and found out I can get "Try" to work with {$Mode TP}
If I add {$Modeswitch exceptions} and appearantly {$R+} to make sure range
checking is on.
So I have it working in my {$Mode TP} Unit.
_
Is this a bug in properties and I should be getting an error?
type
TPixel = record
components: array[0..3] of byte;
property R: byte read components[10] write components[10];
end;
Regards,
Ryan Joseph
___
fpc
> On Apr 29, 2021, at 12:01 AM, Sven Barth wrote:
>
> To be precise there are two more: function/procedure variables (no special
> designator) and method variables ("of object"). Depending on what a anonymous
> function captures (or for the sake of it a nested function) it would be
> possibl
On Thu, 29 Apr 2021, James Richters via fpc-pascal wrote:
Best add SysUtils and Classes.
Thanks, that worked. But now I'm getting "cannot read or write variables of this
type" for Writeln(Exception) is there an easy way to find out what the exception is?
On E : Exception do
Writeln(
>Best add SysUtils and Classes.
Thanks, that worked. But now I'm getting "cannot read or write variables of
this type" for Writeln(Exception) is there an easy way to find out what the
exception is?
James
___
fpc-pascal maillist - fpc-pascal@list
On Thu, 29 Apr 2021, LacaK via fpc-pascal wrote:
Dňa 29.4.2021 o 9:26 Michael Van Canneyt via fpc-pascal napísal(a):
On Thu, 29 Apr 2021, LacaK via fpc-pascal wrote:
Hi *,
consider the following example
T1 = class
class procedure CP1;
procedure P1; virtual;
end;
T2 = class(T1)
c
On Thu, 29 Apr 2021, James Richters via fpc-pascal wrote:
I’m trying to put the Ini file stuff all in it’s own unit.
My unit is {$Mode OBJFPC}
and Uses IniFiles;
“Try” is compiling, but I’m getting Error: Identifier not found “EFOpenError”
And also Syntax error “Do” expected but “)” found
Dňa 29.4.2021 o 9:26 Michael Van Canneyt via fpc-pascal napísal(a):
On Thu, 29 Apr 2021, LacaK via fpc-pascal wrote:
Hi *,
consider the following example
T1 = class
class procedure CP1;
procedure P1; virtual;
end;
T2 = class(T1)
class procedure CP1;
end;
procedure T1.P1;
begin
CP
I’m trying to put the Ini file stuff all in it’s own unit.
My unit is {$Mode OBJFPC}
and Uses IniFiles;
“Try” is compiling, but I’m getting Error: Identifier not found “EFOpenError”
And also Syntax error “Do” expected but “)” found
I have:
try
Log_ini := TIniFile.Create('myini.ini');
e
James Richters schrieb am Do.,
29. Apr. 2021, 10:33:
> I get Error: Identifier not found “Try”
>
> Because my unit must be compiled with {$MODE TP}
>
You can try to use {$modeswitch exceptions}, I think.
Otherwise quite a few procedures and functions won’t even compile that only
> work in Turbo
On 2021-04-29 09:00, Mattias Gaertner via fpc-pascal wrote:
On Thu, 29 Apr 2021 07:52:19 +0200
Sven Barth via fpc-pascal wrote:
[...]
You completely ignored my first point, which in this case is the much
more significant one: Pascal does not support type inference.
FPC does not.
Delphi does:
I get Error: Identifier not found “Try”
Because my unit must be compiled with {$MODE TP}
Otherwise quite a few procedures and functions won’t even compile that only
work in Turbo Pascal mode.
I guess I can put it in another unit and make a call to that… then I can use Try
Thanks for the inform
On 29/04/2021 8:00 am, Mattias Gaertner via fpc-pascal wrote:
> FPC does not.
> Delphi does:
If only FPC would have strived to be Delphi Compatible. ;-) :-P
Regards,
Graeme
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.fre
On Thu, 29 Apr 2021, LacaK via fpc-pascal wrote:
Hi *,
consider the following example
T1 = class
class procedure CP1;
procedure P1; virtual;
end;
T2 = class(T1)
class procedure CP1;
end;
procedure T1.P1;
begin
CP1; // here is called allways T1.CP1, right?
// if I want call T2.CP1
On Thu, 29 Apr 2021 07:52:19 +0200
Sven Barth via fpc-pascal wrote:
>[...]
> You completely ignored my first point, which in this case is the much
> more significant one: Pascal does not support type inference.
FPC does not.
Delphi does:
http://docwiki.embarcadero.com/RADStudio/Sydney/en/Inline_
17 matches
Mail list logo