Clayton, I am using a BCC to copy you directly, because I think that I really need to ask you about this. I am sending directly to the api list as a backup.

I do not want to complain too loudly, since I really like these Wiki pages, but...

I have seen errors in the documentation regarding the Case statement over the years. I think that some have been fixed (like in the help), but I found one on the Wiki today. I was making minor changes to the Wiki, but I really do not want to change this unless the Wiki is the master.

http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide/Branching

This incorrectly states :

Select Case Var
 ....
Case Var > 8 And Var < 11 ' ... Var is greater than 8 and less than 11
 .....

This is not correct. In fact, it is not even close. What it really does, is to evaluate (Var > 8 AND Var < 11), which returns a value of 0 (False) or -1 (True), and then compares Var to 0 or -1.

you can do something tricky like the following, but that is pretty slick, which makes me think that Bernard Marcelly came up with it, but I do not remember now:

Case Var XOR NOT(Var>8 AND Var< 11)

Better to use "To" if you can use equality rather than inequality.

Case 8 To 11

In my book, I have a creative IIF statement to deal with this as well.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to