Wrox Programmer Forums
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 27th, 2005, 05:53 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Interesting....

There are even more approaches. One is the IsSet method where you declare an additional isSet bool to determine whether a variable has been set:

get {
_isSingle = value;
isSingeIsSet = true;
}

Another alternative is to create a custom class or enum. The thing with tri-state variables is that's it's likely that a fourth state is needed tomorrow (for example, what is null? "Unknown because you never asked", or "Unknown because it can no longer be determined" or "Unknown because they won't tell".

This may not be useful in all situation, but these situation do come up. In that case, an enum like IsSingle.True, IsSingle.False, IsSingle.WontTell might be a better option...

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Korean Bodega by Fun Lovin' Criminals (Track 4 from the album: 100% Colombian) What's This?
 
Old January 28th, 2005, 09:43 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

yes,they were very good ideas for me,thanks a bunch.:)

_____________________________
Mehdi.
software engineering student.
Looking for a good job for summer 2005.





Similar Threads
Thread Thread Starter Forum Replies Last Post
datetime MathLearner Beginning VB 6 0 November 15th, 2007 07:12 AM
DateTime pzmrcd C# 3 July 26th, 2007 06:35 AM
How to set Not Null constraint to Null Columns arasu Oracle 1 August 22nd, 2005 10:09 AM
UTC DateTime to Local DateTime r_ganesh76 SQL Server 2000 1 April 4th, 2005 08:21 AM
DateTime DARSIN General .NET 1 December 1st, 2004 06:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.