11-24-2008 08:52 PM
I have a program for my project but i need logic in it the logic i need is as follows:
* If a person enters a number greater than 8 it needs to display "please input a number 1 to 8"
*If a person enters in more than one 8 I would like it to display "please only put one 8"
*If the person does not put in an 8 than i would like it to display "please select a fear that is ranked 8"
here is the program i have so far if you can help it would be greatly apprecianted
Solved! Go to Solution.
11-24-2008 09:05 PM
I don't know how that snapshot of code you posted relates to your question. Your code just searches for an 8 and return a villain that has it. Where does your logic fit into that bit of code you posted?
To keep someone from entering a number greater than 8, use the date entry limits of the numeric control properties to prevent a number greater than 8 being entered.
To count the number of 8's, I would just use a For loop with autoindexing to step through the array. If a number is equal to 8, than add one to a counter your store in a shift register. When the loop is done, use a case structure where 0 gives your last message. 1 does not give a message, and 2 or default gives the message about not putting in more than one 8.
11-24-2008 09:16 PM
I am kinda new to arrays in labview what would that look like?
thank you
11-24-2008 09:45 PM
If you're new to arrays, I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
See attached.