07-17-2009 10:13 AM
I was wondering how to control an case structure if the condition is false . I was trying to set if the entered string matches perform the multiplication or else if the string entered doesnt matches just retain the previous value. In directly to say take no action if the string entered is not matching.
-lucky.
Solved! Go to Solution.
07-17-2009 10:20 AM
07-17-2009 10:28 AM
Hello RTSLVU,
we dont want to display the x value if the entered string is unmatched it should holds its previuos value what was there in indicator. Say for the first time if the entered string matches with the string constant in the code and the value of 'x' is 5 and value of 'y' is 20 the o/p in indicator is displayed as 100. For the second time if the entered string doesnt matches it should still display as 100 i.e the previous vale itself.
07-17-2009 10:43 AM
07-17-2009 10:49 AM
07-17-2009 10:51 AM
This is what exactly Iam looking for. But Cant we use this with out the help of while loop. Because I want to insert this piece of code some where in a big part of code so adding a control to the while loop is messing up my code. .
07-17-2009 10:59 AM
Thank you very much the local variable has solved my probelm..
-lucky
07-17-2009 11:01 AM
07-17-2009 11:09 AM
Dennis,
The piece of code(case structure) which i posted is actually inside a for loop and i want to record the data outside the for loop. so I cant move the indicator into the case statement. Will there be any problem if I use the local variable? or is there any other better way to handle this case.
07-17-2009 11:16 AM
Then put the shift register on the edge of the for loop.
The problem with local variables is that they are easy to misuse and it's better to learn how to avoid them. Later, when you have more programming experience, you will understand when and how they can be used.