Re: Comparing Empty Value types

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 11/17/04


Date: Wed, 17 Nov 2004 10:52:17 -0600

Cor,
> It was just an alternative, this one is not real very important for me,

Obviously I know its an alternative, Hopefully you noticed that I stated
last night it was an alternative & again just now.

Thanks for noticing.
Jay

"Cor Ligthert" <notmyfirstname@planet.nl> wrote in message
news:%23IeiyJMzEHA.2624@TK2MSFTNGP11.phx.gbl...
> Jay,
>
> It was just an alternative, this one is not real very important for me,
> however I like more evaluating for equality using the = operator than
> evaluating using a methode and with the color that is possible.
>
> But the "Is" in this functions tells it very good, therefore it is not
> really that important for me.
>
> However as I said, just an alternative.
>
> Cor
>
> "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com>
>
>> Cor (& Herfried),
>> As I stated in my initial reply:
>>
>>> See the Color.Equals function in the online help for some important
>>> remarks about using Color.Equals and when you may want to use
>>> Color.ToArgb to compare two colors.
>>
>> If I want to compare what is visible seen I will use Color.ToArgb in
>> other words to compare the Alpha, Red, Green & Blue values.
>>
>> If I want to compare what is literally used I will use Color.Equals or
>> Color.op_Equality, in other words to compare the names of the color or
>> the values for unnamed colors.
>>
>> For example:
>>
>> Dim color1 As Color = Color.Black
>> Dim color2 As Color = Color.FromArgb(0,0,0)
>>
>> Both are visibly Black, however they are not logically the same value. In
>> other words:
>>
>> If color1.Equals(color2) Then
>> ' color1 is the same named color as color2
>> End If
>>
>> If color1.ToArgb() = color2.ToArgb() Then
>> ' color1 & color2 have the same Alpha, Red, Green & Blue values
>> End If
>>
>> Just a thought
>> Jay
>>
>>
>> "Cor Ligthert" <notmyfirstname@planet.nl> wrote in message
>> news:ulhANFIzEHA.2568@TK2MSFTNGP11.phx.gbl...
>>> Dennis,
>>>
>>> As alternative
>>> If mycolor.ToArgb = mycolor.Empty.ToArgb
>>>
>>> End if
>>>
>>> Cor
>>>
>>> "Dennis" <Dennis@discussions.microsoft.com>:
>>>>
>>>> public mycolor as color = color.Empty
>>>>
>>>> I want to check to see if the user has specified a color like;
>>>>
>>>> if mycolor = Color.Empty then.....
>>>> or
>>>> if mycolor is Color.Empty then .......
>>>>
>>>> I get errors saying that = can be used for colors and is can't be used
>>>> with
>>>> value types. I give up...how do I do this. Thanks.
>>>> --
>>>> Dennis in Houston
>>>
>>>
>>
>>
>
>



Relevant Pages

  • Re: Search all the characters then get range for some of them
    ... Yes, Jay, those are a few of the features we can do with our document ... document, and compare another document ... position of each word to gray out later, ... array, but loading an array with the list of words that you need to search ...
    (microsoft.public.word.vba.general)
  • Re: Detecting Brute-Force and Dictionary attacks
    ... usually modern systems doesn't compare the password you ... password attempt with the saved hash of your current password. ... It is my personal opinion that evaluating the passwords so closely, such as mentioned in the previous email to Greg's, would open yourself up to a far more complicated world than you might be thinking. ... In the past, when I've had people attempting to attack my systems, the easiest way to tell is the number of login attempts against the frequency of the attempts. ...
    (Focus-Linux)
  • Re: Comparing Empty Value types
    ... Cor, ... > however I like more evaluating for equality using the = operator than ... compare colors, it will give you the same result as Color.Equals & ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Leno should not bump Conan
    ... It was canceled because the ratings sucked. ... He was "making" it better than Jay was. ... but Jay had the affiliates ready to revolt. ... Compare those to Jay's at the same time after he took over. ...
    (rec.arts.tv)
  • Re: Comparing Empty Value types
    ... however I like more evaluating for equality using the = operator than ... evaluating using a methode and with the color that is possible. ... Cor ... >> Color.ToArgb to compare two colors. ...
    (microsoft.public.dotnet.languages.vb)