Recalling a Dialog box

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
atapper
Newbie
Posts: 18
Joined: Wed Dec 17, 2008 2:10 pm
Location: Minnesota,USA

Recalling a Dialog box

Post by atapper » Fri Apr 17, 2009 4:21 pm

Is there a problem or trick in recalling the same Dialog command?

The code below is basically checking the data in one CSV file against another CSV file for valid entries. If this check fails for a particular line, I use a Dialog for the operator to enter the proper data and then I continue checking the data. This works until it finds another invalid data and tries to launch the Dialog again.

I get error messages like "Warning. Error Trying to create dialog: Dialog1" for the line "Dialog>Dialog1".

If I click the OK button, I get the error message "Warning. Specified Window "Close=1" Not Present. Any Subsequent Sends in Script May Cause Exceptions."

Then if I ignore that, I get the message "Information. Ini file in EditInFile does not exist."

Finally I get the Dialog box to appear, but the data doesn't seem to have refreshed since the first time the Dialog command was called.

Anyone have any ideas?

Again this used to work in a previous version (refer to Separate to an Array topic), so maybe something got fixed. I am not trying to be snippy, just need to make the code work again.

Thanks.

Code: Select all

Repeat>s
            If>Chart_%s%_1=col_%x%_2,Out
            Let>s=s+1
Until>s=ch_row_count
//No ValidChart found, parse data and open Dialog for correct number
Let>missingAC=col_%x%_2
Let>missingAM=col_%x%_5
Let>missingEM=col_%x%_8
Dialog>Dialog1
   Caption=Invalid Account Number Found
   Width=396
   Height=208
   Top=CENTER
   Left=CENTER
   Max=0
   Min=0
   Close=1
   Resize=0
   Edit=msEdit1,14,106,355,
   Button=OK,16,144,153,25,1
   Button=Cancel,208,144,161,25,3
   Memo=msMemo1,13,4,356,89,
EndDialog>Dialog1

Show>Dialog1
Let>Dialog1.msMemo1=Account     Amount      Employee%CRLF%%missingAC%       %missingAM%     %missingEM%%CRLF%%CRLF%Enter Valid Account ##-######-###.
ResetDialogAction>dialog1
Label>DiaLoop
  GetDialogAction>dialog1,result
  If>result=1,DiaDone
  If>result=2,End
  If>result=3,End
Goto>DiaLoop
Label>DiaDone
CloseDialog>Dialog1
let>fixed=%Dialog1.msEdit1%
If>fixed>0
Let>Account_%x%=fixed
Goto>Skip
Else
Goto>End
Endif
Label>Out
Let>Account_%x%=Chart_%s%_2
Let>Temp=Account_%x%
Label>Skip
Let>x=x+1
Until>x=rw_count
Label>Fin
Let>x=x-1

Andrew Tapper
Engineering Manager
Forward Technology
Cokato, MN

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Apr 17, 2009 10:03 pm

Remove the Dialog block from your loop. The dialog block is the lines starting with Dialog>Dialog1 and ending with EndDialog>Dialog1. A particular dialog, in this case "Dialog1" can only be created once in a specific script. the suggested practice is to place the Dialog block at the top of the script. If you make it the first lines, it can't accidentally be called again.

atapper
Newbie
Posts: 18
Joined: Wed Dec 17, 2008 2:10 pm
Location: Minnesota,USA

Post by atapper » Mon Apr 20, 2009 1:04 pm

Thank you sir, that did the trick! :D
Andrew Tapper
Engineering Manager
Forward Technology
Cokato, MN

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts