By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,699 Members | 1,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,699 IT Pros & Developers. It's quick & easy.

Namespace of Interesting/Important Constants ?

P: n/a
Is there a namespace of interesting and important constants such as
maximum length of a filename, maximum length of a path, maximum and
minimum values which can be held by a Long (and other data types of
course), etc., etc.?

In C there is a header file (I forget its name at the moment) with
things like MAX_PATH. Most useful.

I know where to find the values I am looking for. I am just trying to
avoid the typos I sometimes make when typing all the digits in, e.g.,
the maximum value which can be stuffed into a Long.

Thanks, Bob
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Bob,
No there is no header file or namespace per se.

Instead the Framework took an OO approach (encapsulation) in that
interesting & important constants are associated with interesting &
important types.

For example, the min value of a Long is Long.MinValue, the max value of a
Long is Long.MaxValue, likewise for Byte, Char, DateTime, Double, Single,
Short, Integer, TimeSpan and others...

For details see System.Int64.MinValue, remember that Long is simply an alias
for System.Int64.
I don't know of a MAX_PATH type constant, all the System.IO types use
System.String, which is variable length, so I'm not sure of its (MAX_PATH)
importance, unlike C where you need to allocate a buffer explicitly for the
values...

Hope this helps
Jay

"eBob.com" <eB******@totallyfakeisp.com> wrote in message
news:3m********************************@4ax.com...
Is there a namespace of interesting and important constants such as
maximum length of a filename, maximum length of a path, maximum and
minimum values which can be held by a Long (and other data types of
course), etc., etc.?

In C there is a header file (I forget its name at the moment) with
things like MAX_PATH. Most useful.

I know where to find the values I am looking for. I am just trying to
avoid the typos I sometimes make when typing all the digits in, e.g.,
the maximum value which can be stuffed into a Long.

Thanks, Bob

Nov 21 '05 #2

P: n/a
Bob,

When you use VBNet with the IDE, there is a background compiler busy all the
time, he warns mostly when you make trappable errors. You do not have to set
it because it is already set.

I hope this helps?

Cor
Nov 21 '05 #3

P: n/a
Thank you Jay and Cor. I think that I like the .Net approach. I haven't
actually needed MAX_PATH for exactly the reason Jay points out. But I have
needed it so often in C programming that I put it in my list.

Thanks, Bob

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:uB*************@TK2MSFTNGP15.phx.gbl...
Bob,
No there is no header file or namespace per se.

Instead the Framework took an OO approach (encapsulation) in that
interesting & important constants are associated with interesting &
important types.

For example, the min value of a Long is Long.MinValue, the max value of a
Long is Long.MaxValue, likewise for Byte, Char, DateTime, Double, Single,
Short, Integer, TimeSpan and others...

For details see System.Int64.MinValue, remember that Long is simply an alias for System.Int64.
I don't know of a MAX_PATH type constant, all the System.IO types use
System.String, which is variable length, so I'm not sure of its (MAX_PATH)
importance, unlike C where you need to allocate a buffer explicitly for the values...

Hope this helps
Jay

"eBob.com" <eB******@totallyfakeisp.com> wrote in message
news:3m********************************@4ax.com...
Is there a namespace of interesting and important constants such as
maximum length of a filename, maximum length of a path, maximum and
minimum values which can be held by a Long (and other data types of
course), etc., etc.?

In C there is a header file (I forget its name at the moment) with
things like MAX_PATH. Most useful.

I know where to find the values I am looking for. I am just trying to
avoid the typos I sometimes make when typing all the digits in, e.g.,
the maximum value which can be stuffed into a Long.

Thanks, Bob


Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.