DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a VIEW area dialogue box whilst a script is running.

Solved!
Go to solution

Hello,

 

I need some help finding the best way to allow a user to update data using a dialogue box whist a script is running. I have an existing script which goes like this:

 

  • User starts relevant script
  • A set of default polynomial approximations are applied to a series of XY channel pairs
  • A For..Next loop is entered which will show a series of VIEW sheets in turn, with each sheet showing one of the XY channel pairs and the associated approximation
  • The user is shown the first sheet along with a message box with OK and Cancel buttons. If they press OK the message box disappears and the loop continues by showing the next sheet and the message box. If they press Cancel the script is stopped and they get the chance to manually modify the approximation and then restart the script.

What I would like is the following:

 

  • User starts relevant script
  • A set of default polynomial approximations are applied to a series of XY channel pairs
  • A For..Next loop is entered which will show a series of VIEW sheets in turn, with each sheet showing one of the XY channel pairs and the associated approximation
  • The user is shown the first sheet and can make updates to the approximation by using checkboxes in a dialogue box to add coefficients to the approximation, which is then updated after pressing an update button. Once happy the user then has some way of telling the For..Next loop to move on to the next sheet.

I think a relatively easy way to implement this process is to show a standard modal dialogue box instead of the message box, on which are some checkboxes representing alternative approximation coefficients. Once the user OKs the box, the script evaluates the checkboxes, updates the approximation and reshows the VIEW sheet and dialogue box. A slight challenge here is how the user tells the script he's is happy with the approximation and to move on to the next sheet.

 

However, I think there maybe neater and less clunky alternatives, either with a non-modal dialogue box or with a dialogue box within an area on each sheet. I've investigated the latter and have it partially working with checkboxes and a button to update the approximation. The problem I have is with the For..Next loop as I can't get it to stop/pause whilst the user makes any updates to the approximation on the current sheet. Could I use the interaction button to stop the script? This would need to allow the code associated with the VIEW area dialogue box to run. If not, what alternatives do I have to pause the script whilst the user uses a dialogue box of some sort to update the approximation before then returning to the For..Next loop?

 

Regards,

 

Simon.

0 Kudos
Message 1 of 3
(465 Views)
Solution
Accepted by topic author Simon_Aldworth

Hello Simon,

 

I have created a small example and attached it. Are you looking for something like this?

 

Greetings

Walter

0 Kudos
Message 2 of 3
(437 Views)

Hi Walter,

 

Thanks for creating that for me. Yes, it does do what I want.

 

I managed to get a View area dialogue working well by using the InteractionOn to pause the For..Next loop. I had not appreciated that you could still run dialogue control event code even after InteractionOn was set.

 

I will set your reply as the solution.

 

Regards,

 

Simon.

0 Kudos
Message 3 of 3
(431 Views)