473,700 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Any way to do this function?

a
I have a class named country and have following properites

string EngName
string ChiName

How to do if user request EngName, then it can return EngName, if user
request ChiName, if can return ChiName
but i do not want to using if-then-else since it maybe have KrName, ThaiName
in the furture.

Thanks

m(_ _)m
Jan 27 '06 #1
2 1029
If EngName and ChiName are properties then you already have the behavior you
are asking for: If you request the value of a property, that's what you'll
get.

I suspect there must be more to your question. Can you provide more
information?
--
Dale Preston
MCAD C#
MCSE, MCDBA
"ºa¤Ö" wrote:
I have a class named country and have following properites

string EngName
string ChiName

How to do if user request EngName, then it can return EngName, if user
request ChiName, if can return ChiName
but i do not want to using if-then-else since it maybe have KrName, ThaiName
in the furture.

Thanks

m(_ _)m

Jan 27 '06 #2
a wrote:
I have a class named country and have following properites

string EngName
string ChiName

How to do if user request EngName, then it can return EngName, if user
request ChiName, if can return ChiName
but i do not want to using if-then-else since it maybe have KrName, ThaiName
in the furture.

Thanks

m(_ _)m


That's not how localization is usually done. You'd want something more like

string CountryName

which is looked up from a resource file depending on the user's locale
automatically.. . I'm sure if you look into any localization article
you'll find tons of such infos.
Jan 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3631
by: joe | last post by:
hi, after reading some articles and faq, i want to clarify myself what's correct(conform to standard) and what's not? or what should be correct but it isn't simply because compilers don't support. (first i compiled them with g++3.x. ERR means compiler will bark, otherwise it does accept it. Then the Comeau C/C++ 4.3.3 comes)
3
1667
by: Bryan Parkoff | last post by:
Do C/C++ Compiler allow function to contain more than 8 parameters? I checked MS Visual C++ 6.0 that it can only limit 8 parameters, but most C/C++ Compiler can limit maximum 256 parameters. Can you please verify for me? Usually, I write function that is about 100 lines. I would need 20 parameters which they are all reference to global variable inside struct. For best optimization, it does not require to create stack frame because...
1
3341
by: jimfortune | last post by:
From: http://groups-beta.google.com/group/comp.databases.ms-access/msg/769e67e3d0f97a90?hl=en& Errata: 19 solar years = 2939.6018 days should be 19 solar years = 6939.6018 days Easter Function explanation Part II
3
1757
by: HopfZ | last post by:
How can I create a function nF such that for example var sum = nF('a','b','return a+b'); and var sum = new Function('a','b','return a+b'); do the same? function nF(){ return new Function(arguments); } // won't work. because Function expects first argument to be a string, not an agruments list.
6
23875
by: =?iso-8859-1?B?QW5kcuk=?= | last post by:
Hi all, Let's say I have the following code: typedef struct { void (*function)(); } TYPE; void function()
6
11525
kiss07
by: kiss07 | last post by:
Dear debas and friends, 1)what is the use of NOCOPY parameter? 2)function overloading ------------------------------- which are the correct function overloading: 1) function f1(c in number)
11
1335
by: noddy | last post by:
I have come across this code in a js file. It uses the function constructor in a way I have never seen. Can someone explain what is happening here? Thanks (function(){ ...lines of code... } ) ();
6
2161
by: jmDesktop | last post by:
In a function that takes another function (function pointer) as a argument, or the callback function, which is the one that "calls back"? I'm having a hard time understanding the language. Am I right that if function A is: function A(*function pointer to B aka callback func, other arguments) { call (B); //calls }
12
3928
by: viza | last post by:
Hi I have program1.c: typedef int (*fn_t)(int); int fn( int f ){ return f; }
3
475
by: lancer6238 | last post by:
Hi, I was looking at an open-source program and saw a function header defined as: int Function(int value1, int value2, (int *A)(void *A1, int *A2, void *A3), void *A3) and the function is called by
0
9059
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6556
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4650
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2379
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2021
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.