Text constant definitions in Navision

Ever since I first saw one defined in a program, I’ve wondered why text constants are defined in their own special place instead of as regular variables or as quoted strings in right the code?

And why are they given names (e.g., TEXT001) that provide no clue about what they are or where they’re used?

I find it irritating to have to look back and forth between the code window and the globals list to figure out what’s being generated. It seems much more straightforward to just build output strings in code.

Other than “That’s the way it has always been done.”, is there some good reason that I’m missing?

Geof

I can’t say anything about the reason for the weird names, I agree it is a bit annoying. Text constants are nice because they have multilanguage capabilities.

Put your cursor on the text constant, and the content of the text constant will show in the bottom left hand corner. No need to open the globals list.

Maybe I’ve been too sheltered here in the (nearly) English-only U.S.

Thanks for the tip about the cursor.

Hi Geo,

as you say is really annoying, above all if you’re looking for a particular code using debugger. Anyway I think this could be solved putting different reference names but not using text directly in code.

Maybe on NAV 2009, be patience xD

Just working on a global rollout of some add-ons and having the multi-language text vars is great.

We are using French, German, Chinese and Russian for now but can add other languages as we need them.

Try doing that with ‘hard coded’ text strings.