03-13-2012 02:35 AM
I want to give a break statement at the output of a one button dialog block so that, if the user presses ok, then the program will again start from the previous loop. I have attached the image of the part of the program. I have denoted a red arrow where I want to put the break statement and I have given a blue arrow where I want to bring back the program counter after the execution of break statement. How to do it?
03-13-2012 03:20 AM - edited 03-13-2012 03:21 AM
Hi LSG,
1) NEVER ATTACH BMP PICTURES! There's a reason why it's not allowed! Renaming them to *.jpg doesn't change their format nor their extraordinary filesize! (As demonstrated by my attachment.)
2) Why do you separate Date and Time controls?
3) Why do you compare times with timestamp datatype while dates are compared using strings (which may fail easily)?
4) When you want to "go back" you need a loop.
5) Forwarding values to next iteration of a loop is a task for shift registers!
6) OneButtonDialog always gives "TRUE" regardless of clicking the OK button or the WindowClose-button. You will not be able to differentiate those two events...
03-13-2012 03:51 AM
It's very difficult to answer your question because it is clear from the way that you stated it you are still thinking in another language (and by that I mean another computer language, C?) The most basic answer to your question as stated is that due to the fact that LV implements case statements properly it has no equivalent of a "break" statement -- nor does it need one, When a case is selected that case and only that case are executed.
However, there are bigger issues: The screen shot you posted is apparently one small piece of a much larger block diagram. You have some very fundamental architectural rework that needs to be done before you can even begin to get to how accomplish the "break" function that you want. The good news is that we can help you with this rework, but we will need to be able to see all of your code - not just a small window into it.
Mike...
03-13-2012 05:02 AM
Thanks a lot GerdW for your information about the bmp and jpg files. Actually I need the day string also in another purpose, so I have used string for date.
Also thanks to mikeporter for your reply. Yes, I am understanding that this has become very much complicated to sort out from that portion of the program. And if I try to give detail expected outcome from my program, then also it will be very much complicated as this program is dependent on many other programs. so, in brief I am telling the main problem.
I am giving two timestamp control from where user will give a time duration. The label of one is FROM TIME and another is TO TIME. User has to give the times to two different controls and then has to press a button. In between that button, I am checking whether the FROM TIME is less than TO TIME or not. If FROM TIME is greater than TO TIME then a message will be shown stating FROM TIME should be less than TO TIME. In this case I need that when the user will press OK to the message button, the program will again start to execute before the button. So, when again the user will give the times and press the button, it will again check for the same stated above. Hope it is clear now.
03-13-2012 05:06 AM