Hello.
I have a quick and "simple" question that will probably boil down to opinion
more than anything else. I need a FieldType property for a class I am
writing. As such an Enum would be the perfect solution for this property. In
C# I can write
Public Enum FieldType
Integer = 0
Float
Double
String
Date
ObjectId
End Enum
And everything works like a charm. I have been requested to rewrite this in
VB.NET. However, VB.NET is not case sensitive so that structure does not
work because Interger, Double, String and Date are reserved types regardless
of case. Is there a defined recommended alternative for this? Prefix or
Suffix? What do you think about?
Public Enum FieldType
enumInteger = 0
enumFloat
enumDouble
enumString
enumDate
enumObjectId
End Enum
or
Public Enum FieldType
_Integer = 0
_Float
_Double
_String
_Date
_ObjectId
End Enum 6 1891
"Ryan Taylor" <rt*****@stgeorgeconsulting.com> schrieb: I need a FieldType property for a class I am writing. As such an Enum would be the perfect solution for this property. In C# I can write
Public Enum FieldType Integer = 0 Float Double String Date ObjectId End Enum
And everything works like a charm. I have been requested to rewrite this in VB.NET. However, VB.NET is not case sensitive so that structure does not work because Interger, Double, String and Date are reserved types regardless of case.
Put the keywords between square brackets to escape them:
\\\
Public Enum FieldType
[Integer] = 0
Float
[Double]
...
End Enum
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
"Ryan Taylor" <rt*****@stgeorgeconsulting.com> schrieb: I need a FieldType property for a class I am writing. As such an Enum would be the perfect solution for this property. In C# I can write
Public Enum FieldType Integer = 0 Float Double String Date ObjectId End Enum
And everything works like a charm. I have been requested to rewrite this in VB.NET. However, VB.NET is not case sensitive so that structure does not work because Interger, Double, String and Date are reserved types regardless of case.
Put the keywords between square brackets to escape them:
\\\
Public Enum FieldType
[Integer] = 0
Float
[Double]
...
End Enum
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
You can use parenthesis and it will work:
Public Enum FieldType
[Integer] = 0
[Float]
....
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers: http://www.mztools.com
"Ryan Taylor" <rt*****@stgeorgeconsulting.com> escribió en el mensaje
news:uq**************@TK2MSFTNGP15.phx.gbl... Hello.
I have a quick and "simple" question that will probably boil down to opinion more than anything else. I need a FieldType property for a class I am writing. As such an Enum would be the perfect solution for this property. In C# I can write
Public Enum FieldType Integer = 0 Float Double String Date ObjectId End Enum
And everything works like a charm. I have been requested to rewrite this in VB.NET. However, VB.NET is not case sensitive so that structure does not work because Interger, Double, String and Date are reserved types regardless of case. Is there a defined recommended alternative for this? Prefix or Suffix? What do you think about?
Public Enum FieldType enumInteger = 0 enumFloat enumDouble enumString enumDate enumObjectId End Enum
or
Public Enum FieldType _Integer = 0 _Float _Double _String _Date _ObjectId End Enum
You can use parenthesis and it will work:
Public Enum FieldType
[Integer] = 0
[Float]
....
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers: http://www.mztools.com
"Ryan Taylor" <rt*****@stgeorgeconsulting.com> escribió en el mensaje
news:uq**************@TK2MSFTNGP15.phx.gbl... Hello.
I have a quick and "simple" question that will probably boil down to opinion more than anything else. I need a FieldType property for a class I am writing. As such an Enum would be the perfect solution for this property. In C# I can write
Public Enum FieldType Integer = 0 Float Double String Date ObjectId End Enum
And everything works like a charm. I have been requested to rewrite this in VB.NET. However, VB.NET is not case sensitive so that structure does not work because Interger, Double, String and Date are reserved types regardless of case. Is there a defined recommended alternative for this? Prefix or Suffix? What do you think about?
Public Enum FieldType enumInteger = 0 enumFloat enumDouble enumString enumDate enumObjectId End Enum
or
Public Enum FieldType _Integer = 0 _Float _Double _String _Date _ObjectId End Enum This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Alexander Grigoriev |
last post by:
Not quite new version of GCC that I have to use, craps with the following
code:
enum E;
enum E { e };
That is, it doesn't accept forward declaration of enum. C++ standard text
doesn't...
|
by: Vaclav Haisman |
last post by:
Motivation:
I have been working on some project recently that uses lots of enums with
disjunctive intervals of values because it is rather convenient way to
define series of constants with...
|
by: Nebula |
last post by:
Consider
enum Side {Back,Front,Top,Bottom};
enum Side a;
Now, why is
a = 124;
legal (well it really is an integer, but still,
checking could be performed..) ?
Wouldn't enums be more useful if...
|
by: Michael C |
last post by:
If a class inherits from another class, say Form inherits from control, then
I can assign the Form to a variable of type Control without needing an
explicit conversion, eg
Form1 f = new Form1();...
|
by: Martin Pritchard |
last post by:
Hi,
I'm working on a project that historically contains around 40 enums. In the
database various fields refer to the int values of these enums, but of
course ref integrity is not enofrced and...
| |
by: Ryan Taylor |
last post by:
Hello.
I have a quick and "simple" question that will probably boil down to opinion
more than anything else. I need a FieldType property for a class I am
writing. As such an Enum would be the...
|
by: VK |
last post by:
Just to realease my frustration:
innocent "enum" is a reserved word in JScript!
!@#$%^&*
I occasionally discovered it just before I got ready to smash my
computer over my head (some people...
|
by: Steven Nagy |
last post by:
So I was needing some extra power from my enums and implemented the
typesafe enum pattern.
And it got me to thinking... why should I EVER use standard enums?
There's now a nice little code...
|
by: Cmtk Software |
last post by:
I'm trying to define an enum which will be used from unmanaged c++, C++/CLI
managed c++ and from C#.
I defined the following enum in a VS dll project set to be compiled with the
/clr switch:
...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
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...
|
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...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |