Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Boolean Logic Problem


Message #1 by jstmehr4u3@a... on Sun, 23 Feb 2003 15:35:58 +0000
I have a class module that has a Property called ISActive with a boolean 
datatype. I also have a Create Function that takes the ISActive variable 
optionally as a boolean datatype. This will allow the developer to either 
define the ISActive property by itself like : Class.Isactive = TRUE or in the 
create routine Class.Create(TRUE).

Now, in the function how do I determine which way the variable was defined?
When you use a Class Property you are declaring a private variable to hold the 
value of the property. In my instance that would be prvIsActive. In the Create 
Function I have this statement: Function Create(lIsActive as boolean). 
(lIsActive = local isActive)
I then go on to compare them
if prvISActive <> lIsActive then

but this is where the problem lies. The default value for a boolean datatype is 
FALSE, So if the person did not pass IsActive to the function directly, the 
lIsActive variable would be false.

How would I know if the person set the variable definition with the 
Class.IsActive = TRUE statement or KNOW if the person sent the Value as a 
parameter to the function?

**NOTE: While writing this I figure I can declare another private variable and 
put it in the Property Let statement for the IsActive Property but is there a 
way to do this without the additional memory cost? **

TIA
M.S.

  Return to Index