BeeHay Posted August 27, 2008 Share Posted August 27, 2008 Hello again Just noticed a few errors within DF... Now I'm not sure if it is my setup, or if it is inside DF. I noticed that when I click a button set to open a pop-up window, I cannot have a "Change Page" button within the pop-up...If you do, the page underneath the pop-up will change, and not the page within the pop-up... Also, lets say I have a variable using the "Set To" action, and the user clicks the variable and then changes his mind about clicking it. When he presses the cancel button, the value is still added to the variable.... Any info about those two items would be great.... Also would love to share some code and have it evaluated by the master!! Depth - // (code edited per poster request) while(1) ... if(Kelly < 1) break endif endwhile Am I using the break properly? Does that make the whole sequence start over, or just that if()? Am I correctly making the Array1 remove the 1st value and shift up? Drillrate - global DRate while (1) ... if (Feetdown1 != FeetDown2) DRate = ... else Drate = Drate endif delay(4) endwhile Thanks!!! Oh yea, when is DF 6.0 coming? Link to comment Share on other sites More sharing options...
AzeoTech Posted August 28, 2008 Share Posted August 28, 2008 1) No, you can't change a popup's page. It has to do with how popups work. This isn't really an error. 2) I'm not seeing the Set To action issue you describe. If I hit cancel, it does not change the value. Perhaps you can post a sample showing this. 3) In your first code chunk: a) you have: if (count = 0) when you mean: if (count == 0) You have to use == for comparison. See the blog on entry on why it is done this way. I don't know if you are using the break correctly because I don't know what you are trying to do. In this case, when Kelly goes below 1, the loop will stop and whatever line (if any) that is after the endwhile will execute. What you have shows a good point though. You can do it two ways: Your way: while (1) ... if (Kelly < 1) break endif endwhile and: while(Kelly >= 1) ... endwhile The difference is subtle. In your version, the loop will execute once no matter what Kelly is to start, even if it is less than 1. In the second version, if Kelly is < 1 when the loop starts, the loop will immediately end. c) that will shift Array1, though I don't see where you defined ArrayEnd. Truthfully, you can just put in an arbitrarily large value: Array1 = Array1[1,100000] if you are using a non-Express version of DAQFactory, the variable also has a function called RemoveAt(): Array1.RemoveAt(0) which will do the same thing, but will execute faster because it doesn't have to make a copy of the entire array. d) finally, you don't have a delay() anywhere in the loop. This means it will run as fast as possible. If it will take a long time, and has the default sequence priority 5, it will likely hang the user interface portion of DAQFactory while it finishes. You may want to set the sequence priority to 0 so it runs in the background. 4) your second code snippet looks fine, except the line: DRate = DRate doesn't do anything. Also, this loop will never end, as you have while(1) and no break anywhere. Link to comment Share on other sites More sharing options...
BeeHay Posted August 28, 2008 Author Share Posted August 28, 2008 I don't know if you are using the break correctly because I don't know what you are trying to do. I'm trying to get my whole Depth sequence to start over when Kelly < 1. If you are using a non-Express version of DAQFactory, the variable also has a function called RemoveAt() Great! I'll try that one out. Also, this loop will never end, as you have while(1) and no break anywhere. I was thinking of using while(Kelly < 35) in my DRate sequence...that will be fine, correct? Thanks again! Link to comment Share on other sites More sharing options...
AzeoTech Posted August 28, 2008 Share Posted August 28, 2008 If you want the whole sequence to restart, you'll have to use a second while loop: while (1) ... while(1) ... if (Kelly < 1) break endif endwhile endwhile This again assumes you want the interior loop to execute once even if Kelly < 1 when it starts. As for your second question, yes it'd be fine, but I don't know what you want to do. Changing it to while (Kelly < 35) will cause the loop to stop when kelly goes above 35. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.