LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is CLAD or even CLD possibly in just two months?


wiebe@CARYA wrote:

 


@alexderjuengere wrote:
I believe to remember, I learned from CLAD, that the selector of a case structures accepts ranges e.g. "0","1..10","11"...

This is very tricky though.

 

1..5 matches [1, 5], so 1, 2, 3, 4, 5

 

"1".."5" matches ["1", "5"), so "1", "2", "3", "4"


Well, "1".."5" doesn't just match "1", "2", "3", "4".

 

It also matches "1...", "2...",, "3...", "4..." with ... being ANY 0 or more characters.

 

And yes this example might be misleading, making people believe that it has anything to do with the number, but it is simply using the actual ASCII code, so "a".."z" will match any string that starts with a lower case letter too, except strings starting with z. If you want to include strings starting with z in the range too, you would have to write "a".."{". Not exactly intuitive, but the alternative would have been simply ill-defined.

 

Since string ranges are not an exact match anymore but simply indicate the starting character sequence, the last element in the range is non-inclusive. Otherwise you couldn't specify a range for any string starting with "a" without including also "b". So you can be sure that there has been quite a bit of discussion, deliberation and fighting going on when this feature was defined!

 

 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 11 of 11
(28 Views)