What are the advantages of a string table?
-
Other than for repetitive strings. Whats the advantage of this...
CString Str; Str.LoadString(IDS_STRING1); MessageBox(Str);
Over this...MessageBox("This is a string.");
(BTW: IDS_STRING1 = "This is a string.") ??? I dont see the advantages. Maybe somebody else can shed some light on the subject. -
Other than for repetitive strings. Whats the advantage of this...
CString Str; Str.LoadString(IDS_STRING1); MessageBox(Str);
Over this...MessageBox("This is a string.");
(BTW: IDS_STRING1 = "This is a string.") ??? I dont see the advantages. Maybe somebody else can shed some light on the subject. -
Other than for repetitive strings. Whats the advantage of this...
CString Str; Str.LoadString(IDS_STRING1); MessageBox(Str);
Over this...MessageBox("This is a string.");
(BTW: IDS_STRING1 = "This is a string.") ??? I dont see the advantages. Maybe somebody else can shed some light on the subject.For some developers. They would like to pack their resource files into a DLL. This is to allow different language version to be shipped easily by just changing the DLL instead of recompile the entire source code after changing the const String in the code line by line. Some developers would like to have their const string to be placed into INI files instead. Just some alternatives of doing the work. Sonork 100.41263:Anthony_Yio
-
Other than for repetitive strings. Whats the advantage of this...
CString Str; Str.LoadString(IDS_STRING1); MessageBox(Str);
Over this...MessageBox("This is a string.");
(BTW: IDS_STRING1 = "This is a string.") ??? I dont see the advantages. Maybe somebody else can shed some light on the subject. -
Other than for repetitive strings. Whats the advantage of this...
CString Str; Str.LoadString(IDS_STRING1); MessageBox(Str);
Over this...MessageBox("This is a string.");
(BTW: IDS_STRING1 = "This is a string.") ??? I dont see the advantages. Maybe somebody else can shed some light on the subject.One word: translation. When you put all UI elements into resources, you can translate them without touching any of the C code. This is an incredibly meaningful fact since it reduces the amount of testing required on the translated version. If you touch any code, it has to be (or should be, at least) retested to make sure no typos happened while changing all the string literals. It also lets a non-programmer translate the app. All they need is a resource editor. If you never plan on translating, then... *shrug* --Mike-- Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Pinky, are you pondering what I'm pondering? I think so Brain, but if we shaved our heads, we'd look like weasels!
-
Other than for repetitive strings. Whats the advantage of this...
CString Str; Str.LoadString(IDS_STRING1); MessageBox(Str);
Over this...MessageBox("This is a string.");
(BTW: IDS_STRING1 = "This is a string.") ??? I dont see the advantages. Maybe somebody else can shed some light on the subject.Not to mention, if you ever have a need to change what a string says, it's easier to use the resource than search the code for the string definition. Every once in a while, I've wanted to modify a title or reword a message in one of my programs.
-
Other than for repetitive strings. Whats the advantage of this...
CString Str; Str.LoadString(IDS_STRING1); MessageBox(Str);
Over this...MessageBox("This is a string.");
(BTW: IDS_STRING1 = "This is a string.") ??? I dont see the advantages. Maybe somebody else can shed some light on the subject.As people have said, for "easy" Internationalization and Localization of your strings. It also makes it easier if you decide to support UNICODE. I never hard-code strings, but if you're just writing some POS app then, maybe you don't want to use a string table. The kindest thing you can do for a stupid person, and for the gene pool, is to let him expire of his own dumb choices. [Roger Wright on stupid people] We're like private member functions [John Theal on R&D] We're figuring out the parent thing as we go though. Kinda like setting up Linux for the first time ya' know... [Nitron]