Filebrowse & Edit Dialog Problems

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
jwm0vmh
Newbie
Posts: 9
Joined: Sun Jul 06, 2003 3:44 pm

Filebrowse & Edit Dialog Problems

Post by jwm0vmh » Fri Aug 26, 2005 7:49 pm

I have set up a script file (see below) to retrieve two files and allow the user to determine the period in years over which to execute the script. When I click the "Get Finance Extract File" button or the "Get CWIP Diffs File" button they will not always retrieve the file selected. It may take 3 - 5 attempts to select a file and place it in the respective edit box. The second problem is when the user tries to modify the "End Year" edit field. The user may need to try 5 or more times to enter a year. My operating system is XP Pro. Any thoughts?


Thanks,
JM


Dialog>Dialog1
Caption=Dialog1
Top=137
Width=951
Left=43
Height=252
Label=Start Year,96,72
Label=End Year,312,72
Button=Get Finance Extract File,8,8,153,25,0
Button=Get CWIP Diffs File,8,40,153,25,0
Edit=msEdit1,176,8,753,
Edit=msEdit2,176,40,753,
Button=Run,112,152,75,25,1
Button=Exit,200,152,75,25,2
Edit=sy,176,72,121,2005
Edit=ly,368,72,121,2010
FileBrowse=Get Finance Extract File,msEdit1
FileBrowse=Get CWIP Diffs File,msEdit2
EndDialog>Dialog1

Show>Dialog1

Label>ActionLoop
GetDialogAction>Dialog1,r
if>r=1,getout
if>r=2,close
let>Dialog1.msEdit1=%Dialog1.msEdit1%
let>Dialog1.msEdit2=%Dialog1.msEdit2%
let>Dialog1.sy=%Dialog1.sy%
let>Dialog1.ly=%Dialog1.ly%
resetdialogaction>Dialog1
Goto>ActionLoop

label>getout
CloseDialog>Dialog1
let>fdata=%Dialog1.msEdit1%
let>fdiffs=%Dialog1.msEdit2%

SRT>close
CloseDialog>Dialog1
Let>r=2
END>close


User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Aug 26, 2005 8:50 pm

Can't quite see the point of assigning variables to their own values. Like Let>x=x ... pointless no? Also no need to ResetDialogAction as you aren't changing any values on the dialog. Here's my version of your script. Works fine. Have added a message in getout just to show that it is getting values correctly:

Dialog>Dialog1
Caption=Dialog1
Top=137
Width=951
Left=43
Height=252
Label=Start Year,96,72
Label=End Year,312,72
Button=Get Finance Extract File,8,8,153,25,0
Button=Get CWIP Diffs File,8,40,153,25,0
Edit=msEdit1,176,8,753,
Edit=msEdit2,176,40,753,
Button=Run,112,152,75,25,1
Button=Exit,200,152,75,25,2
Edit=sy,176,72,121,2005
Edit=ly,368,72,121,2010
FileBrowse=Get Finance Extract File,msEdit1
FileBrowse=Get CWIP Diffs File,msEdit2
EndDialog>Dialog1
Show>Dialog1
Label>ActionLoop
GetDialogAction>Dialog1,r
if>r=1,getout
if>r=2,close
Goto>ActionLoop

label>getout
let>fdata=Dialog1.msEdit1
let>fdiffs=Dialog1.msEdit2
let>sy=Dialog1.sy
let>ly=Dialog1.ly
CloseDialog>Dialog1
MessageModal>%fdata% %fdiffs% %sy% %ly%

SRT>close
CloseDialog>Dialog1
Let>r=2
END>close
MJT Net Support
[email protected]

jwm0vmh
Newbie
Posts: 9
Joined: Sun Jul 06, 2003 3:44 pm

File Browse & Edit in Dialog

Post by jwm0vmh » Fri Aug 26, 2005 9:24 pm

Thanks for the quick response it works great. I was following the example in MS Help for non-modal dialogs. I thought I had to re-assign dialog variables to diaog to reflect the users selection on each iteration of the loop.

Does resetDialog only reset the dialog result to zero?

JWM

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Re: File Browse & Edit in Dialog

Post by support » Fri Aug 26, 2005 9:44 pm

jwm0vmh wrote: Does resetDialog only reset the dialog result to zero?
Yes, and it allows you to change any captions, texts etc on the dialog.

Anything the user changes is retrieved in GetDialogAction. Which you call in each loop iteration.
MJT Net Support
[email protected]

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