473,387 Members | 1,575 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,387 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 1537
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...

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.