472,981 Members | 1,406 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Namespace of Interesting/Important Constants ?

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
3 1515
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: William Payne | last post by:
Hello, I am starting to steer away from the practice of using "using namespace std;" in my code. Instead I am qualifying each name in the source when I use them, for example: std::cout << "Hello";...
3
by: balor | last post by:
Sometimes it is useful to assign class names to types that are primitives even if they add no more functionality, at the very least to be able to determine which constants apply to a type: ...
5
by: Dave Slinn | last post by:
Any advice on how to organize my core class library project into sub-namespaces? What are the general rules of thumb regarding cross-namespace references? Can I have a class in namespace A have a...
16
by: makko | last post by:
Hello, anyone know how to writre a program that take a commandline formula and prints the calculated result? example; $program 1+(2x3(3/2))-8 reagrds; Makkko
29
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using...
6
by: Chris Lane | last post by:
Hi, I have been searching for a possible list that shows what methods or properties in the System Names replace the ones in the Visual Basic Namespace so I can stop using the Visual Basic...
32
by: toolmaster | last post by:
Since many of the modern computer languages have built-in namespace features, I can't understand why not add this feature into standard C. I've heard many people complain of the lacking of...
13
by: toton | last post by:
Hi, I have some enum (enumeration ) defined in some namespace, not inside class. How to use the enum constant's in some other namespace without using the whole namespace. To say in little...
6
by: PC | last post by:
Gentlesofts, Forgive me. I'm an abject newbie in your world, using VB 2005 with the dot-Net wonderfulness. So, I'm writing a wonderful class or two to interface with a solemnly ancient...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.