473,320 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

when to use ENUM and when to use Public Const

Can anyone tell me when to use ENUM and when to use Public Const?

TIA

- Nicolaas
Nov 13 '05 #1
2 1666
On Sat, 26 Jun 2004 09:45:48 +1200, "WindAndWaves" <ac****@ngaru.com>
wrote:

Rather than using:
global const CUSTOMER_TYPE_LEAD = 1
global const CUSTOMER_TYPE_CLIENT = 2
global const CUSTOMER_TYPE_OUTOFBUSINESS = 3

you can use:
enum enumCustomerType
Lead=1
Client=2
OutOfBusiness=3
end enum

So you use it for related information. Addl advantage is better
intellisense, e.g. if you have a function that takes an
enumCustomerType as an argument.

Const still preferred for unrelated info:
global const APPNAME = "MyApplication"
global const FILES_DEFAULT_FOLDER = "c:\program files\my
application\data"

-Tom.
Can anyone tell me when to use ENUM and when to use Public Const?

TIA

- Nicolaas


Nov 13 '05 #2
thank you Tom....

PS
ik hoop dat je net zoveel van het EK geniet als ik.
Nov 13 '05 #3

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

Similar topics

2
by: BillyO | last post by:
I need a general mechanism for passing parameters to an API function I am designing, call it foo. Foo processes data, the operation used to process the data and the parameters for that operation...
9
by: AngleWyrm | last post by:
"The C++ Programming Language" by Bjarne Stroustrup, copyright 1997 by AT&T, section 4.8 (pp 77): "A value of integral type may be explicitly converted to an enumeration type. The result of such a...
12
by: Steven T. Hatton | last post by:
Any opinions or comments on the following? I don't say it below, but I came out on the side of using enumerations over static constants. /* I'm trying to figure out the pros and cons of using...
2
by: lallous | last post by:
Hello I sometimes convert lots of numeric defines to enum, as: #define XYZ 0x12345 to enum some_consts {
3
by: Sanjay Pais | last post by:
I know that string/char enum is not possible in c# (.NET2.0) I need to create the equivalent of this: public enum HOW_GOOD { AWESOME = "A", GREAT= "G", NOT_TOO_BAD = "N", TERRIBLE="T" }
2
by: guoqi zheng | last post by:
We can enum to represent a interger using a string. But how can we use enum to represent string below is what I want to achieve. Public Enum country Netherlands = "nl" America = "US" France...
3
by: shapper | last post by:
Hello, I need to set predefined values. So I am using an enum: ' Level Public Enum Level Basico1Ciclo Secundario Superior End Enum
10
by: =?Utf-8?B?TWF0dA==?= | last post by:
I am using the following code to connect to and download files from an ftp server, but the Symantec anti-virus software on some of my customers machines tells them that their computers are...
3
by: AliR \(VC++ MVP\) | last post by:
Hi Everyone, I have writing a class that represents a object on a screen. The object has normal things like X,Y, Width, Height, ZOrder, and it also has drawing attributes and flags. It has...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.