A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

What does "--" do?



 
 
Thread Tools Display Modes
  #1  
Old May 3rd, 2004, 03:11 PM
Peter
external usenet poster
 
Posts: n/a
Default What does "--" do?

Good day everyone.

What does the "--" do or mean?

Thank you in advance.
  #2  
Old May 3rd, 2004, 04:08 PM
Chip Pearson
external usenet poster
 
Posts: n/a
Default 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  
Old May 3rd, 2004, 04:56 PM
Peter
external usenet poster
 
Posts: n/a
Default What does "--" do?

Thank you very much Chip!
  #4  
Old May 4th, 2004, 06:23 AM
firefytr
external usenet poster
 
Posts: n/a
Default 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  
Old May 4th, 2004, 07:10 AM
R.VENKATARAMAN
external usenet poster
 
Posts: n/a
Default 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  
Old May 4th, 2004, 01:39 PM
Bob Umlas
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.