08-12-2021 11:23 AM
Hi, I need help. Im trying to make a login page, and I am using an array to stock the user emails and passwords, and using this inside of a for loop, so, I need to compare that array with the user insertions, but I have a problem because, the software show me this error:
"You have connected two terminals of different types, the type of the source is 1D array of boolean(TRUE or FALSE), the type of the sink is boolean(TRUE or FALSE)". Here is a image:
What can I do?
08-12-2021 11:56 AM - edited 08-12-2021 11:57 AM
Hi Jhonatan,
you are testing two items of "Correos" for being equal to "Usuario": what should happen when
are same?
Once you answer this question you can decide to use an AND or OR function to reduce the array of booleans to a scalar boolean…
Btw. you might learn about autoindexing at loop borders to simplify your VI!
08-12-2021 12:31 PM - edited 08-12-2021 12:33 PM
I assume that the array has two elements and cannot change during the loop execution. Similarly, the scalar cotrnol os also loop invariant. Thus both controls belong before the loop.
The entire loop can be replaced by a "search array" function. You get -1, 0, or 1 as possible output, depending if none, he first or the second element is equal.
NOTE: you'll get much better help if you would attach your actual VI. Many things cannot be determined from a picture (e.g. the size of the string array, the default values for the controls, etc.)
08-12-2021 12:44 PM
@altenbach wrote:
The entire loop can be replaced by a "search array" function.
Here's how that could look like. See if you can recreate it: