LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Zekasa

Equal -1 function to be added to the Comparison pallet

Status: Declined
The situation this is proposed for has other single-node solutions.

Hi,

 

I do not know if this ides posted before,

I am suggesting to add an "Equal -1" function to the comparison functions pallet same as the equal 0 function, this helps when using some search functions which return -1.

 

Untitled-1.png      1.png

 

 

4 Comments
Knight of NI

Why would we need this function? Can you provide a use case for it? What about equal to 1? Or equal to 2? How is this different than checking if the value is less than zero? Presumably you're referring to checking the output of some functions, like Match Pattern, which output a -1 if the value is not found. In this case, checking if the value is less than zero does that, so there is no need for an extra function.

Zekasa
Member

Yes you are right, the less than zero function does the job, sorry, but it did not come to my mind to use this function, I used to use the equal function with a -1 constant after the search function.

MaryH
Member
Status changed to: Declined
The situation this is proposed for has other single-node solutions.
TheQ
Active Participant
If you use case is to use it with a case structure the you could wire the -1 right into it. Then have a -1 case and a Default case. Case structures can also have ranges as cases. For example ..-1 is the same as -Inf to -1. Or 0.. is 0 to +Inf. You can bound ranges too, 5..10 would be numbers between 5 and 10 inclusive. The caveat is that if you don't cover from -Inf to +Inf in your ranges you have to include a default case.
Quentin "Q" Alldredge

Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner