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 3 1562
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.Mi nValue, 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******@total lyfakeisp.com> wrote in message
news:3m******** *************** *********@4ax.c om... 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
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
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******** *****@TK2MSFTNG P15.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.Mi nValue, 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******@total lyfakeisp.com> wrote in message news:3m******** *************** *********@4ax.c om... 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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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";
Now to my question. Depending upon the status of my program, I return either
EXIT_SUCCESS or EXIT_FAILURE from main(). Thinking that these constants live
in the std namespace, I tried:
return std::EXIT_FAILURE; but my compiler said:...
|
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:
typedef int Address;
void test(Address address) { ... }
const Address ADDRESS1 = 0xff, ADDRESS2 = 0x3f;
Of course, this method is type unsafe since any int can be passed in
but to the reader it is at least clear that ADDRESS1 and ADDRESS2 are
|
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
function or a property that returns a class from a different namespace?
For example, lets say I have a root namespace called ACME for my class
library project. Under the root namespace are classes such as Individual,
Address, etc. I also...
|
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
|
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 System.Text.RegularExpressions;
using System.Web;
using System.Web.Caching;
| |
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 Namespace on new projects. Thus far I
have been unable to find this information, please inform me.
For example in the Visual Basic Namespace there are Control Characters like
Tab and Back and so on. Where are the equivalents in the System Namespace?
|
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 namespace in C. Of
course, namespace doesn't eliminate name polution, but it helps more
than just to put some prefix before a function name. Is it because
adding namespace will make C more complex or some other reasons?
|
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 detail, the enum is declared as,
namespace test{
enum MyEnum{
VALUE1,VALUE2
};
|
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 database. In times recently past, I would have done this with
Borland Delphi. So, that's my perspective and I have my old Delphi
code to crib from. That seems good.
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |