ResetDialogAction not updating Dialog

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

ResetDialogAction not updating Dialog

Post by kpassaur » Wed Mar 07, 2007 10:31 am

I know this is me, but I just cannot seem to get it. I have a list that I want to take items from and add to another list. There are some similar examples on this forum that I could not get to work either so I am sort of stuck.

In my code below, when it comes to the message dialog, the list is updated, the next command being ResetDialogAction>Dialog1 I thought would update the list but it dosn't. I know it is somthing very simple, but I am missing it.

Code: Select all





Let>Staticlist=C:\temp\docTypes.txt
Let>Variablelist=C:\temp\CDfilelist.txt

Gosub>Sub1
Gosub>Sub2

SRT>Sub1
Let>list1=
Let>Staticlisttxt=
Let>k=1
Label>start1
ReadLn>%Staticlist%,k,list1
If>list1=##EOF##,finish1
ConCat>%list1%,%CRLF%
Let>Staticlisttxt=%Staticlisttxt%%list1%
Let>k=k+1
Goto>start1
Label>finish1
END>Sub1


SRT>Sub2
Let>z=1
Let>Variablelisttxt=
Label>start2
ReadLn>%Variablelist%,z,list2
If>list2=##EOF##,finish2
ConCat>%list2%,%CRLF%
Let>Variablelisttxt=%Variablelisttxt%%list2%
Let>z=z+1
Goto>start2
Label>finish2
END>Sub2


Dialog>Dialog1
   Caption=Dialog1
   Width=468
   Height=460
   Top=185
   Left=407
   ListBox=msListBox1,64,80,121,185,%Staticlisttxt%
   ListBox=msListBox2,248,80,121,185,%Variablelisttxt%
   Button=Exit,192,344,75,25,2
   Button=>,200,96,41,25,1
   Button=<200>Dialog1

Show>Dialog1
Label>Dialog1loop
GetDialogAction>Dialog1,result
If>result=2,Donewithit
If>result=1,Addtolist
If>result=10,EOF
Goto>Dialog1loop

SRT>Addtolist
WriteLn>%Variablelist%,result,%Dialog1.msListBox1%
GoSub>Sub2
MDL>%Variablelisttxt%
ResetDialogAction>Dialog1
END>Addtolist


SRT>Donewithit
CloseDialog>Dialog1
Let>result=10
END>Donewithit


Label>EOF


User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Mar 07, 2007 10:39 am

You need to do this:

Let>Dialog1.msListBox1.Items.Text=Staticlisttxt
Let>Dialog1.msListBox2.Items.Text=Variablelisttxt
ResetDialogAction>Dialog1
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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