Re: [fpc-pascal] resourcestring and const arrays

2011-06-25 Thread Craig Peterson
On 6/25/2011 7:55 AM, Marco van de Voort wrote: Well, then explain why Delphi + XE has exactly the same problem. Delphi + gettext does, yes, but Delphi + resourcestring + resource dll does not. Resourcestring is a language feature; gettext is a third-party library. I'd expect them to have

Re: [fpc-pascal] resourcestring and const arrays

2011-06-25 Thread Marco van de Voort
In our previous episode, Craig Peterson said: > On 6/24/2011 4:14 PM, Marco van de Voort wrote: > > No, this is a problem of gettext. > > It's a problem with FPC's resourcestring implementation, rather than > something specific to gettext. Well, then explain why Delphi + XE has exactly the same p

Re: [fpc-pascal] resourcestring and const arrays

2011-06-24 Thread Craig Peterson
On 6/24/2011 4:52 PM, Krzysztof wrote: I had similar problem, I think that this is because consts are "filled" when compiling and there is no way to change them at runtime. Try this trick with pointers: Thanks Krzysztof. That looks like the least invasive approach, so if I can't get them work

Re: [fpc-pascal] resourcestring and const arrays

2011-06-24 Thread Craig Peterson
On 6/24/2011 4:14 PM, Marco van de Voort wrote: No, this is a problem of gettext. It's a problem with FPC's resourcestring implementation, rather than something specific to gettext. I could use SetResourceStrings directly (objpas.pp) and it will have the same issue. For this to work you real

Re: [fpc-pascal] resourcestring and const arrays

2011-06-24 Thread Krzysztof
Hi, I had similar problem, I think that this is because consts are "filled" when compiling and there is no way to change them at runtime. Try this trick with pointers: resourcestring SSunday = "Sunday"; const SWeek: array[0..0] of PString = (@SSunday); begin WriteLn(SWeek[0]^); end; Regards

Re: [fpc-pascal] resourcestring and const arrays

2011-06-24 Thread Marco van de Voort
In our previous episode, Craig Peterson said: > In Delphi I can use resource strings with const arrays and everything > works correctly. For example, if I have a resource DLL with translated > strings and this will work: > > resourcestring >SSunday = "Sunday"; > > const >SWeek: array[0

[fpc-pascal] resourcestring and const arrays

2011-06-24 Thread Craig Peterson
In Delphi I can use resource strings with const arrays and everything works correctly. For example, if I have a resource DLL with translated strings and this will work: resourcestring SSunday = "Sunday"; const SWeek: array[0..0] of string = (SSunday); begin WriteLn(SWeek[0]); end; I'v