Problem Repeating Dialog

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
roo
Newbie
Posts: 15
Joined: Thu May 29, 2008 12:12 am
Location: Washington D.C.

Problem Repeating Dialog

Post by roo » Sun Jun 08, 2008 11:17 pm

I hope one of you is able to assist with this...

The problem is that I have to return to the initial welcome screen and if I re-click on the same option as the first time (IP Configuration), it will trigger an error when repeating Dialog>ModelSelection.

There was no error the first time around though!?!

Please let me know what I am missing here.

Thanks,
-roo


//Welcome Screen

Label>Welcome Screen
Dialog>Dialog1
Caption=Dialog1
Width=602
Height=385
Top=177
Left=314
Label=Welcome to the Capitol Office Solutions Automated Network Installation (A.N.I.),104,24,true
Label=This is a script that will install your copier on your network and provide you with some or all of the following capabilities:,16,48,true
Label=To successfully complete this installation you will need to have a fully completed Network Survey Form.,56,224,true
Label=Please start by configuring the IP address on the copier and then selecting an option from this page.,64,248,true
Button=Full Installation,216,288,161,25,7,,This option will perform a complete installation
Button=IP Configuration,408,288,137,25,8,,This option will instruct you on setting the ip address of the copier so that the A.N.I. may perform the install
Button=- Printing,48,80,497,25,3,,This option will install your choice of print driver on this PC
Button=- Scan to E-mail,48,128,497,25,4,,This option will configure the copier to scan to your e-mail inbox
Button=- Network Scanning,48,176,497,25,5,,This option will configure the copier to scan to a shared folder on your network
Button=Check Communications,48,288,139,25,6,,This option will verify communication with the copier
EndDialog>Dialog1
Label>exit

Label>Main Selection
Show>Dialog1,results
If>result=2,exit
//Printing
If>results=3,Model
//Scan to E-mail
If>results=4,Scan to E-mail
//Network Scanning
If>results=5,Network Scanning
//Check Communications
If>results=6,Check Communications
//Full Install
If>results=7,Full Install
//IP Configuration
If>results=8,IP Configuration
Label>exit

Label>IP Configuration
Gosub>IP Configuration
MessageModal>Please review or print (if a printer is available) the opened notepad file.
Goto>Main Selection
Label>exit



SRT>IP Configuration
Dialog>ModelSelection
Caption=ModelSelection
Width=474
Height=238
Top=250
Left=310
Label=Please select the model you are installing and click continue.,104,48,true
Label=The copier must be assigned an IP addres before being able to automate the installation.,24,16,true
Button=Continue,152,88,185,33,1
ListBox=Model,24,48,57,129,5665%CRLF%5665%CRLF%5665
EndDialog>ModelSelection
Label>exit

Label>Model
Show>ModelSelection,Model
If>ModelSelection.Model=5665,56 series IP Instructions
//If>ModelSelection.Model=7665,76 series IP Instructions
Endif
Label>exit

Label>56 series IP Instructions
Run>c:\windows\notepad.exe
WaitWindowOpen>Untitled - Notepad
Send>INSTRUCTIONS
Label>exit
End>IP Configuration

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

Post by JRL » Mon Jun 09, 2008 12:18 am

You can't repeat a dialog block definition for the same dialog name (Dialog>Name thru EndDialog>Name) Take the dialog blocks out of the loop. I usually put them at the top of the script then call them with a Show> later in the script.

Also, I don't know if its a problem or not but I'd be a little nervous about having a label and a subroutine with the same name

User avatar
roo
Newbie
Posts: 15
Joined: Thu May 29, 2008 12:12 am
Location: Washington D.C.

Post by roo » Mon Jun 09, 2008 2:49 am

Oh!...ok...I just did what you said and not only does it work but it actually makes since to me now.

Thanks for helping me out on this.

As for having a label and a subroutine with the same name; I will change that in order to avoid any complications but would love to hear from anyone who has encountered issues or who have done so without issues so that i know for sure.

Thanks again JRL.

-roo

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

Post by JRL » Mon Jun 09, 2008 4:33 am

Here is an example in which the script may not branch as you'd expect because a subroutine and label have the same name. Assuming I want to go to the subroutine when the If> statement tests true, I have a problem. It will always jump to the label.

Code: Select all

Let>name=Dick
If>name=Dick,JRL

SRT>JRL
  MDL>Sub
END>JRL

Label>JRL
MDL>label

User avatar
roo
Newbie
Posts: 15
Joined: Thu May 29, 2008 12:12 am
Location: Washington D.C.

Post by roo » Mon Jun 09, 2008 4:59 am

Got it.
I'm very new to all this and appreciate the insight.
Thanks.

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