Re: [fpc-pascal] New User

2020-12-02 Thread greim--- via fpc-pascal
Fantastic, a real good introduction for us old Pascalians !! We should send a link to Niklaus Wirth ;-) Markus Greim --- original message --- On November 30, 2020, 12:09 PM GMT+1 fpc-pascal@lists.freepascal.org wrote: On Mon, Nov 30, 2020 at 4:43 AM Derek Stewart via fpc-pascal wrote: >>

Re: [fpc-pascal] How to get the current translation of a resource string?

2020-12-02 Thread Michael Van Canneyt via fpc-pascal
On Tue, 1 Dec 2020, Luca Olivetti via fpc-pascal wrote: Since I want to treat a specific exception that cannot be distinguished by the class alone but only by the class and message, I need to find the current translation of the resource string used to create the exception. The

Re: [fpc-pascal] How to get the current translation of a resource string?

2020-12-02 Thread Mattias Gaertner via fpc-pascal
On Wed, 2 Dec 2020 13:48:35 +0100 (CET) Michael Van Canneyt via fpc-pascal wrote: > On Wed, 2 Dec 2020, Mattias Gaertner via fpc-pascal wrote: >[...] > > What about the simple explanation, that there are two > > resourcestrings with the same name in RTLConsts and LCLStrConsts and > > Luca is

Re: [fpc-pascal] How to get the current translation of a resource string?

2020-12-02 Thread Michael Van Canneyt via fpc-pascal
On Wed, 2 Dec 2020, Mattias Gaertner via fpc-pascal wrote: On Wed, 2 Dec 2020 13:30:13 +0100 (CET) Michael Van Canneyt via fpc-pascal wrote: On Wed, 2 Dec 2020, Luca Olivetti via fpc-pascal wrote: [...] > but it doesn't work (sCannotFocus holds the original, not the > translated,

Re: [fpc-pascal] Initialization of constant record member of pointer type

2020-12-02 Thread LacaK via fpc-pascal
Dňa 2.12.2020 o 13:55 Tomas Hajny via fpc-pascal napísal(a): On 2020-12-01 11:39, Ladislav Karrach via fpc-pascal wrote: Because MyConst1 is not an *untyped* constant. Only untyped constants can be used in constant expressions (a pointer to something can be considered an untyped constant).

Re: [fpc-pascal] Initialization of constant record member of pointer type

2020-12-02 Thread Tomas Hajny via fpc-pascal
On 2020-12-02 16:01, LacaK via fpc-pascal wrote: Dňa 2.12.2020 o 13:55 Tomas Hajny via fpc-pascal napísal(a): On 2020-12-01 11:39, Ladislav Karrach via fpc-pascal wrote: Because MyConst1 is not an *untyped* constant. Only untyped constants can be used in constant expressions (a pointer to

Re: [fpc-pascal] Initialization of constant record member of pointer type

2020-12-02 Thread Tomas Hajny via fpc-pascal
On 2020-12-01 11:39, Ladislav Karrach via fpc-pascal wrote: Because MyConst1 is not an *untyped* constant. Only untyped constants can be used in constant expressions (a pointer to something can be considered an untyped constant). The following might work though I did not test it: === code

Re: [fpc-pascal] How to get the current translation of a resource string?

2020-12-02 Thread Michael Van Canneyt via fpc-pascal
On Wed, 2 Dec 2020, Luca Olivetti via fpc-pascal wrote: But the 'current translation' is simply the value of the resourcestring, so you should not need to look it up ? How? I'm trying to detect this specific exception raise EInvalidOperation.Create(sCannotFocus); (where

Re: [fpc-pascal] How to get the current translation of a resource string?

2020-12-02 Thread Luca Olivetti via fpc-pascal
El 2/12/20 a les 11:49, Michael Van Canneyt via fpc-pascal ha escrit: On Tue, 1 Dec 2020, Luca Olivetti via fpc-pascal wrote: Since I want to treat a specific exception that cannot be distinguished by the class alone but only by the class and message, I need to find the current translation

Re: [fpc-pascal] How to get the current translation of a resource string?

2020-12-02 Thread Mattias Gaertner via fpc-pascal
On Wed, 2 Dec 2020 13:30:13 +0100 (CET) Michael Van Canneyt via fpc-pascal wrote: > On Wed, 2 Dec 2020, Luca Olivetti via fpc-pascal wrote: > >[...] > > but it doesn't work (sCannotFocus holds the original, not the > > translated, string). > > Seems like Lazarus is not using the regular

Re: [fpc-pascal] How to get the current translation of a resource string?

2020-12-02 Thread Luca Olivetti via fpc-pascal
El 2/12/20 a les 13:30, Michael Van Canneyt via fpc-pascal ha escrit: On Wed, 2 Dec 2020, Luca Olivetti via fpc-pascal wrote: But the 'current translation' is simply the value of the resourcestring, so you should not need to look it up ? How? I'm trying to detect this specific exception