[Lazarus] AutoCommit

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
Error code “Project ****** raised exception class ‘EReadError with unknown property ‘AutoCommit’

Sent from my iPhone
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
This is only when I try to compile on Lazarus 2.0.6 on Windows. The project works fine on 2.0.10 on Linux. Any ideas?

Sent from my iPhone

> On Nov 13, 2020, at 10:58, Larry Dalton <[hidden email]> wrote:
>
> Error code “Project ****** raised exception class ‘EReadError with unknown property ‘AutoCommit’
>
> Sent from my iPhone
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
I forgot to add that it compiles correctly, but then I get the runtime error  

Sent from my iPhone

> On Nov 13, 2020, at 11:02, Larry Dalton <[hidden email]> wrote:
>
> This is only when I try to compile on Lazarus 2.0.6 on Windows. The project works fine on 2.0.10 on Linux. Any ideas?
>
> Sent from my iPhone
>
>> On Nov 13, 2020, at 10:58, Larry Dalton <[hidden email]> wrote:
>>
>> Error code “Project ****** raised exception class ‘EReadError with unknown property ‘AutoCommit’
>>
>> Sent from my iPhone
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list

Your .lfm file contains a property "autocommit" that exists in 2.0.10 but not in 2.0.6.
I think 2.0.10 is based on FPC 3.2.0 and 2.0.6 was still based on 3.0.4.

A lot of new properties appeared between 3.0.4 and 3.2.0.

Michael.

On Fri, 13 Nov 2020, Larry Dalton via lazarus wrote:

> I forgot to add that it compiles correctly, but then I get the runtime error
>
> Sent from my iPhone
>
>> On Nov 13, 2020, at 11:02, Larry Dalton <[hidden email]> wrote:
>>
>> This is only when I try to compile on Lazarus 2.0.6 on Windows. The project works fine on 2.0.10 on Linux. Any ideas?
>>
>> Sent from my iPhone
>>
>>> On Nov 13, 2020, at 10:58, Larry Dalton <[hidden email]> wrote:
>>>
>>> Error code “Project ****** raised exception class ‘EReadError with unknown property ‘AutoCommit’
>>>
>>> Sent from my iPhone
> --
> _______________________________________________
> lazarus mailing list
> [hidden email]
> https://lists.lazarus-ide.org/listinfo/lazarus
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
So we lose some backwards portability?

Sent from my iPhone

> On Nov 13, 2020, at 11:06, Michael Van Canneyt <[hidden email]> wrote:
>
> 
> Your .lfm file contains a property "autocommit" that exists in 2.0.10 but not in 2.0.6.
> I think 2.0.10 is based on FPC 3.2.0 and 2.0.6 was still based on 3.0.4.
>
> A lot of new properties appeared between 3.0.4 and 3.2.0.
>
> Michael.
>
>> On Fri, 13 Nov 2020, Larry Dalton via lazarus wrote:
>>
>> I forgot to add that it compiles correctly, but then I get the runtime error
>> Sent from my iPhone
>>
>>>> On Nov 13, 2020, at 11:02, Larry Dalton <[hidden email]> wrote:
>>> This is only when I try to compile on Lazarus 2.0.6 on Windows. The project works fine on 2.0.10 on Linux. Any ideas?
>>> Sent from my iPhone
>>>> On Nov 13, 2020, at 10:58, Larry Dalton <[hidden email]> wrote:
>>>> Error code “Project ****** raised exception class ‘EReadError with unknown property ‘AutoCommit’
>>>> Sent from my iPhone
>> --
>> _______________________________________________
>> lazarus mailing list
>> [hidden email]
>> https://lists.lazarus-ide.org/listinfo/lazarus
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
This problem was brought to light when I couldn’t get 2.0.10 apps to hook up to MySQL on Windows. I have no problem on my Linux box.

Sent from my iPhone

> On Nov 13, 2020, at 11:34, Michał Gawrycki <[hidden email]> wrote:
>
> Remove this property from lfm file and set it by code if needed (maybe along with ifdef).
>
> Michał.
>
> W dniu 2020-11-13 o 17:19, Larry Dalton via lazarus pisze:
>> So we lose some backwards portability?
>> Sent from my iPhone
>>>> On Nov 13, 2020, at 11:06, Michael Van Canneyt <[hidden email]> wrote:
>>>
>>> 
>>> Your .lfm file contains a property "autocommit" that exists in 2.0.10 but not in 2.0.6.
>>> I think 2.0.10 is based on FPC 3.2.0 and 2.0.6 was still based on 3.0.4.
>>>
>>> A lot of new properties appeared between 3.0.4 and 3.2.0.
>>>
>>> Michael.
>>>
>>>> On Fri, 13 Nov 2020, Larry Dalton via lazarus wrote:
>>>>
>>>> I forgot to add that it compiles correctly, but then I get the runtime error
>>>> Sent from my iPhone
>>>>
>>>>>> On Nov 13, 2020, at 11:02, Larry Dalton <[hidden email]> wrote:
>>>>> This is only when I try to compile on Lazarus 2.0.6 on Windows. The project works fine on 2.0.10 on Linux. Any ideas?
>>>>> Sent from my iPhone
>>>>>> On Nov 13, 2020, at 10:58, Larry Dalton <[hidden email]> wrote:
>>>>>> Error code “Project ****** raised exception class ‘EReadError with unknown property ‘AutoCommit’
>>>>>> Sent from my iPhone
>>>> --
>>>> _______________________________________________
>>>> lazarus mailing list
>>>> [hidden email]
>>>> https://lists.lazarus-ide.org/listinfo/lazarus
>
> --
>
>
> GM Systems
> ul. K.Marksa 9
> 58-260 Bielawa
> tel. +48 694 178 276
> http://www.gmsystems.pl/
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list

Yes, but that's always so when properties are added to components.

Michael.

On Fri, 13 Nov 2020, Larry Dalton wrote:

> So we lose some backwards portability?
>
> Sent from my iPhone
>
>> On Nov 13, 2020, at 11:06, Michael Van Canneyt <[hidden email]> wrote:
>>
>> 
>> Your .lfm file contains a property "autocommit" that exists in 2.0.10 but not in 2.0.6.
>> I think 2.0.10 is based on FPC 3.2.0 and 2.0.6 was still based on 3.0.4.
>>
>> A lot of new properties appeared between 3.0.4 and 3.2.0.
>>
>> Michael.
>>
>>> On Fri, 13 Nov 2020, Larry Dalton via lazarus wrote:
>>>
>>> I forgot to add that it compiles correctly, but then I get the runtime error
>>> Sent from my iPhone
>>>
>>>>> On Nov 13, 2020, at 11:02, Larry Dalton <[hidden email]> wrote:
>>>> This is only when I try to compile on Lazarus 2.0.6 on Windows. The project works fine on 2.0.10 on Linux. Any ideas?
>>>> Sent from my iPhone
>>>>> On Nov 13, 2020, at 10:58, Larry Dalton <[hidden email]> wrote:
>>>>> Error code “Project ****** raised exception class ‘EReadError with unknown property ‘AutoCommit’
>>>>> Sent from my iPhone
>>> --
>>> _______________________________________________
>>> lazarus mailing list
>>> [hidden email]
>>> https://lists.lazarus-ide.org/listinfo/lazarus
>
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
Usually we try to use the "default" feature of the newly added properties so that they are streamed only when really set and used. When they are not used, the LFM can still be loaded in a legacy version of Lazarus because the new properties are not streamed.

Ondrej


On 13.11.2020 17:47, Michael Van Canneyt via lazarus wrote:

Yes, but that's always so when properties are added to components.

Michael.

On Fri, 13 Nov 2020, Larry Dalton wrote:

So we lose some backwards portability?

Sent from my iPhone

On Nov 13, 2020, at 11:06, Michael Van Canneyt [hidden email] wrote:


Your .lfm file contains a property "autocommit" that exists in 2.0.10 but not in 2.0.6.
I think 2.0.10 is based on FPC 3.2.0 and 2.0.6 was still based on 3.0.4.

A lot of new properties appeared between 3.0.4 and 3.2.0.

Michael.

On Fri, 13 Nov 2020, Larry Dalton via lazarus wrote:

I forgot to add that it compiles correctly, but then I get the runtime error
Sent from my iPhone

On Nov 13, 2020, at 11:02, Larry Dalton [hidden email] wrote:
This is only when I try to compile on Lazarus 2.0.6 on Windows. The project works fine on 2.0.10 on Linux. Any ideas?
Sent from my iPhone
On Nov 13, 2020, at 10:58, Larry Dalton [hidden email] wrote:
Error code “Project ****** raised exception class ‘EReadError with unknown property ‘AutoCommit’
Sent from my iPhone
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus




--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Fri, Nov 13, 2020 at 6:19 PM Larry Dalton via lazarus <[hidden email]> wrote:
So we lose some backwards portability?

IIRC it has been called "forward compatibility" as opposed to "backward compatibility".
Backward compatibility means your old code works in new versions of FPC/LCL/Lazarus.
The other direction is not guaranteed. New code cannot always be used in old versions.

Juha


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list


On Fri, 13 Nov 2020, Ondrej Pokorny via lazarus wrote:

> Usually we try to use the "default" feature of the newly added properties so
> that they are streamed only when really set and used. When they are not used,
> the LFM can still be loaded in a legacy version of Lazarus because the new
> properties are not streamed.

I set defaults on all boolean properties of sqlscript, rev. 47412

Strange, I thought that boolean properties were not streamed if they had
value 'false'.

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
Michael Van Canneyt via lazarus <[hidden email]> schrieb am Fr., 13. Nov. 2020, 22:37:


On Fri, 13 Nov 2020, Ondrej Pokorny via lazarus wrote:

> Usually we try to use the "default" feature of the newly added properties so
> that they are streamed only when really set and used. When they are not used,
> the LFM can still be loaded in a legacy version of Lazarus because the new
> properties are not streamed.

I set defaults on all boolean properties of sqlscript, rev. 47412

Strange, I thought that boolean properties were not streamed if they had
value 'false'.

No, cause their intended default value could be True. Thus no special handling for them. 

Regards, 
Sven 

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 13.11.2020 22:37, Michael Van Canneyt via lazarus wrote:
On Fri, 13 Nov 2020, Ondrej Pokorny via lazarus wrote:
Usually we try to use the "default" feature of the newly added properties so that they are streamed only when really set and used. When they are not used, the LFM can still be loaded in a legacy version of Lazarus because the new properties are not streamed.

I set defaults on all boolean properties of sqlscript, rev. 47412

Strange, I thought that boolean properties were not streamed if they had value 'false'.
The FPC documentation is spot on about the stored/default modifiers: https://www.freepascal.org/docs-html/ref/refsu38.html

Only "String, floating-point and pointer properties have implicit default value of empty string, 0 or nil, respectively. Ordinal and set properties have no implicit default value."

I polished the docs section in r1777 a little bit.

Then I saw the next chapter "Overriding properties". It wrongly described redeclaring of properties as overriding. I fixed that as well in r1778.

Ondrej


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 13.11.2020 21:23, Juha Manninen via lazarus wrote:
On Fri, Nov 13, 2020 at 6:19 PM Larry Dalton via lazarus <[hidden email]> wrote:
So we lose some backwards portability?

IIRC it has been called "forward compatibility" as opposed to "backward compatibility".
Backward compatibility means your old code works in new versions of FPC/LCL/Lazarus.
The other direction is not guaranteed. New code cannot always be used in old versions.

Exactly.

Although in case of LFM streaming we usually try to help with default property values as we discussed before. And yes, I usually forget to add the default values as well :)

Ondrej


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list


On Sat, 14 Nov 2020, Ondrej Pokorny wrote:

> On 13.11.2020 22:37, Michael Van Canneyt via lazarus wrote:
>> On Fri, 13 Nov 2020, Ondrej Pokorny via lazarus wrote:
>>> Usually we try to use the "default" feature of the newly added properties
>>> so that they are streamed only when really set and used. When they are not
>>> used, the LFM can still be loaded in a legacy version of Lazarus because
>>> the new properties are not streamed.
>>
>> I set defaults on all boolean properties of sqlscript, rev. 47412
>>
>> Strange, I thought that boolean properties were not streamed if they had
>> value 'false'.
> The FPC documentation is spot on about the stored/default modifiers:
> https://www.freepascal.org/docs-html/ref/refsu38.html
>
> Only "/String, floating-point and pointer properties have
> implicit////default//value of empty string, 0 or nil, respectively. Ordinal
> and set properties have no implicit//default//value./"

Indeed.

>
> I polished the docs section in r1777 a little bit.

Well done, thank you !

>
> Then I saw the next chapter "Overriding properties". It wrongly described
> redeclaring of properties as overriding. I fixed that as well in r1778.

I think the difference is rather artificial, but if you think this is
better: great.

Thank you for your efforts !

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
On 14.11.2020 11:26, Michael Van Canneyt wrote:
On Sat, 14 Nov 2020, Ondrej Pokorny wrote:
Then I saw the next chapter "Overriding properties". It wrongly described redeclaring of properties as overriding. I fixed that as well in r1778.

I think the difference is rather artificial, but if you think this is better: great.

You are right. I didn't know one can override also read/write specifiers (I thought one must redeclare the property in that case):

  TAncestor = class(TComponent)
  private
    fPropName: string;
  published
    property PropName: string read fPropName write fPropName;
  end;
  TOverride = class(TAncestor)
  private
    fPropName2: string;
  published
    property PropName read fPropName2 write fPropName2; // no type declaration
  end;

But anyway as stated in the Delphi docs http://docwiki.embarcadero.com/RADStudio/Sydney/en/Properties_(Delphi)#Property_Overrides_and_Redeclarations :

Whether a property is hidden or overridden in a derived class, property look-up is always static.

So you are right - there is no real difference in property override/reintroduce like there is override/overload/reintroduce difference in object methods.

I'll make that more clear in FPC docs.

Ondrej


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list


On Sat, 14 Nov 2020, Sven Barth via lazarus wrote:

> Michael Van Canneyt via lazarus <[hidden email]> schrieb am
> Fr., 13. Nov. 2020, 22:37:
>
>>
>>
>> On Fri, 13 Nov 2020, Ondrej Pokorny via lazarus wrote:
>>
>>> Usually we try to use the "default" feature of the newly added
>> properties so
>>> that they are streamed only when really set and used. When they are not
>> used,
>>> the LFM can still be loaded in a legacy version of Lazarus because the
>> new
>>> properties are not streamed.
>>
>> I set defaults on all boolean properties of sqlscript, rev. 47412
>>
>> Strange, I thought that boolean properties were not streamed if they had
>> value 'false'.
>>
>
> No, cause their intended default value could be True. Thus no special
> handling for them.

You can of course say the same for all other types for which an implicit 'default'
is implemented. The more so because a class is initialized with 0 in which
case every enumerated and boolean will be ord(0) unless otherwise
initialized in the constructor.

So I don't see why this rule is not applied to all properties, I don't think
it is logical.

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] AutoCommit

Free Pascal - Lazarus mailing list
On 14.11.2020 18:02, Michael Van Canneyt via lazarus wrote:

> On Sat, 14 Nov 2020, Sven Barth via lazarus wrote:
>> No, cause their intended default value could be True. Thus no special
>> handling for them.
>
> You can of course say the same for all other types for which an
> implicit 'default'
> is implemented. The more so because a class is initialized with 0 in
> which
> case every enumerated and boolean will be ord(0) unless otherwise
> initialized in the constructor.
>
> So I don't see why this rule is not applied to all properties, I don't
> think
> it is logical.

I agree. One would not expect the implicit default values for
string/real/pointer properties.

And then people wonder why their empty string properties are not streamed:

TMyClass = class
published
   property MyString: string read FString write FString stored
IsMyStringStored;
end;

constructor TMyClass.Create;
begin
   FMyString := 'abc';
end;

function TMyClass.IsMyStringStored: Boolean;
begin
   Result := FMyString<>'abc';
end;

What's wrong?
-> The nodefault is missing in order the empty string be streamed:
   property MyString: string read FString write FString stored
IsMyStringStored nodefault;

Not logical, not intuitive, but that is how it works and is documented :/

Ondrej

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus