Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-04

localization of constant strings

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff

Hi again,

this does work:

<--->
resourcestring
	zet = 'Z';
	why = 'Y';
const
	z: ansistring = '-z-';
	y: ansistring = why;
</--->

and this variant doesn't (Error: Illegal expression):

<--->
resourcestring

	zet = 'Z';
	why = 'Y';

const

	columncount = 2;
	titles : ARRAY[0..columncount-1] OF  pgchar = (
				zet,
				why
			);

</--->

My problem is I'm using arrays of constant chars a lot in my program. How can I use them without losing the benefit of resourcestrings?

TIA,
Marc

Reply by email

Michael Van Canneyt
to Marc Santhoff
Marc Santhoff wrote 29 lines
Hi again, this does work: <---> resourcestring zet = 'Z'; why = 'Y'; const z: ansistring = '-z-'; y: ansistring = why; </---> and this variant doesn't (Error: Illegal expression): <---> resourcestring zet = 'Z'; why = 'Y'; const columncount = 2; titles : ARRAY[0..columncount-1] OF pgchar = ( zet, why ); </---> My problem is I'm using arrays of constant chars a lot in my program. How can I use them without losing the benefit of resourcestrings?

You cannot. A resource string is not a constant...

Michael.

Reply by email

Marc Santhoff
to Michael Van Canneyt
Show quoted text 33 lines
On Wed, 6 Apr 2005, Marc Santhoff wrote: > Hi again, > > this does work: > > <---> > resourcestring > zet = 'Z'; > why = 'Y'; > const > z: ansistring = '-z-'; > y: ansistring = why; > </---> > > and this variant doesn't (Error: Illegal expression): > > <---> > resourcestring > zet = 'Z'; > why = 'Y'; > const > columncount = 2; > titles : ARRAY[0..columncount-1] OF pgchar = ( > zet, > why > ); > </---> > > My problem is I'm using arrays of constant chars a lot in my program. > How can I use them without losing the benefit of resourcestrings? You cannot. A resource string is not a constant...

Okay, I'll bite the bullet and make all variables of it.

Thank you anyways,
Marc

Reply by email