If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
What does "--" do?
Good day everyone.
What does the "--" do or mean? Thank you in advance. |
#2
|
|||
|
|||
What does "--" do?
Peter,
One uses the double negation operators -- to change a boolean value of TRUE or FALSE to its numeric equivalent of 1 or 0. The first - changes TRUE to -1 and FALSE to 0, and the second change the -1 to +1 and the 0 to 0. The sign is always preserved because the negative of a negative is the same number. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter" wrote in message ... Good day everyone. What does the "--" do or mean? Thank you in advance. |
#3
|
|||
|
|||
What does "--" do?
Thank you very much Chip!
|
#4
|
|||
|
|||
What does "--" do?
fwiw, you can get the same 'coercion' by doing any of the following ...
-- +0 *1 of course, they are in order of ease, and the -- should be commonplace for every excel user. plus i think it's just flat easier to understand when evaluating computations. hth --- Message posted from http://www.ExcelForum.com/ |
#5
|
|||
|
|||
What does "--" do?
still I need some clarification from VBE Guru Mr. Pearson; on double
negative for e.g. in the "find" method the example code is If Not c Is Nothing Then etc etc. why not "if c is ----------- then etc. etc." thanks and regards Chip Pearson wrote in message ... Peter, One uses the double negation operators -- to change a boolean value of TRUE or FALSE to its numeric equivalent of 1 or 0. The first - changes TRUE to -1 and FALSE to 0, and the second change the -1 to +1 and the 0 to 0. The sign is always preserved because the negative of a negative is the same number. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter" wrote in message ... Good day everyone. What does the "--" do or mean? Thank you in advance. |
#6
|
|||
|
|||
What does "--" do?
Because there is no "If c is Something Then..."
If c is not set to anything then it is Nothing. You COULD use If c is Nothing then Else 'your 'found' code here End If Bob Umlas Excel MVP "R.VENKATARAMAN" wrote in message ... still I need some clarification from VBE Guru Mr. Pearson; on double negative for e.g. in the "find" method the example code is If Not c Is Nothing Then etc etc. why not "if c is ----------- then etc. etc." thanks and regards Chip Pearson wrote in message ... Peter, One uses the double negation operators -- to change a boolean value of TRUE or FALSE to its numeric equivalent of 1 or 0. The first - changes TRUE to -1 and FALSE to 0, and the second change the -1 to +1 and the 0 to 0. The sign is always preserved because the negative of a negative is the same number. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter" wrote in message ... Good day everyone. What does the "--" do or mean? Thank you in advance. |
Thread Tools | |
Display Modes | |
|
|