Navigating between dialog screens and refreshing data

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
D_S
Junior Coder
Posts: 32
Joined: Sun Apr 24, 2005 6:43 pm

Navigating between dialog screens and refreshing data

Post by D_S » Sat Apr 30, 2005 6:05 pm

I'm working on script that will allow the user to preset some common information using the first dialog screen which is then presented to them on the second screen. To display the static info to the user first I tried labels and then used memo fields just for the look of it.

The user then inputs the dynamic information that will be later combined with the static and processed. I'm also giving the option, button, to return back to the first dialog to change the static information to then cycle back to the 2nd dialog, a second session. So far so good.

When they return back to dialog 2 all of the static information is as it was from the original entires. I added code to send the variables to an ini file to see if it was changing and it is but apparently I'm missing something that will allow the return to dialog2 to refresh with new data. Anybody see what I'm missing? Thanks in advance.

I'll attach the code below...some of the drop downs are feed by external files....this info will be dynamically updated to the user from another external server. Since I'm fairly new some of the code may seen unnecessary or reduntant but I'm still cutting my teeth.



readfile>c:\scrap\dept,Dept
readfile>c:\scrap\name,Name
readfile>c:\scrap\boss,Boss

Let>PickDept=
Let>PickTicket=
Let>Blank=

Dialog>ScrapType
Caption= ========== Setup Scrap Ticket ==========
Top=105
Width=603
Left=16
Height=523
Label=Choose the Scrap Ticket Type,8,8
Label=Pick Your Department,8,56
Label=Your Name,8,104
Label=Your Supervisor,8,152
ComboBox=GetTick,8,24,321,%Blank%%CRLF%Inventory Scrap Report T 103 Stores (yellow)%CRLF%Inventory Scrap Report T 113 WIP (yellow)%CRLF%Production Scrap Report T 378 (white)
ComboBox=GetName,8,120,145,%Blank%%CRLF%%Name%
ComboBox=GetDept,8,72,121,%Blank%%CRLF%%Dept%
Button=Enter,16,248,75,25,5
Button=Exit,152,248,75,25,6
ComboBox=GetBoss,8,176,145,%Blank%%CRLF%%Boss%
EndDialog>ScrapType

Dialog>EnterScrap
Caption= ========== Enter Your Scrap ==========
Top=105
Width=603
Left=16
Height=523
Label=Choose the Part #,8,200
Label=Enter the Quantity,8,248
Label=Choose the Reason Code,8,296
ComboBox=GetPart,8,216,577,%Blank%%CRLF%Inventory Scrap Report T 103 Stores (yellow)%CRLF%Inventory Scrap Report T 113 WIP (yellow)%CRLF%Production Scrap Report T 378 (white)
ComboBox=Reason,8,312,145,%Blank%%CRLF%%Name%
Button=Submit,16,456,75,25,5
Button=Quit,480,456,75,25,6
Memo=Qty,8,264,97,17,
Button=Go Back,224,456,75,25,8
Memo=msMemo1,8,8,249,17,%ScrapType.GetTick%
Memo=msMemo2,392,8,193,17,%ScrapType.GetDept%
Memo=msMemo3,8,72,113,17,Date
Memo=msMemo4,8,40,185,17,%ScrapType.GetName%
Memo=msMemo5,392,40,193,17,%ScrapType.GetBoss%
Memo=msMemo6,392,72,193,17,SN
EndDialog>EnterScrap




Label>First

Show>ScrapType

Label>ActionLoop
GetDialogAction>ScrapType,r
if>r=5,Update
if>r=6,Close
if>r=2,exit
if>r=1,NextDialog

Goto>ActionLoop

SRT>Update
*Let>GotDept=%ScrapType.GetDept%
*Let>GotTick=%ScrapType.GetTick%

EditIniFile>c:\scrap\scrap.ini,settings,1,%ScrapType.GetTick%
EditIniFile>c:\scrap\scrap.ini,settings,2,%ScrapType.GetDept%
EditIniFile>c:\scrap\scrap.ini,settings,3,%ScrapType.GetName%
EditIniFile>c:\scrap\scrap.ini,settings,4,%ScrapType.GetBoss%

CloseDialog>ScrapType
Let>r=1
END>Update

SRT>Close
CloseDialog>ScrapType
Let>r=2
END>Close



Label>NextDialog
let>r=

Show>EnterScrap

Label>ActionLoop2
GetDialogAction>EnterScrap,r
if>r=5,Update
if>r=6,Close
if>r=2,exit
if>r=8,GoBack
if>r=9,First
Goto>ActionLoop2

SRT>Update
*EditIniFile>c:\scrap\scrap.ini,settings,1,%ScrapType.GetTick%
*EditIniFile>c:\scrap\scrap.ini,settings,2,%ScrapType.GetDept%
*EditIniFile>c:\scrap\scrap.ini,settings,3,%ScrapType.GetName%
*EditIniFile>c:\scrap\scrap.ini,settings,4,%ScrapType.GetBoss%
CloseDialog>ScrapType
Let>r=1
END>Update

SRT>GoBack
CloseDialog>ScrapType
CloseDialog>EnterScrap
Let>Scraptype.Boss=
Let>"EnterScrap.msMemo1"=
Let>EnterScrap.msMemo2=
Let>EnterScrap.msMemo3=
Let>EnterScrap.msMemo4=
Let>EnterScrap.msMemo5=
Let>EnterScrap.msMemo6=

Let>r=9
END>GoBack

SRT>Close
CloseDialog>ScrapType
Let>r=2
END>Close



Label>exit

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

Post by support » Tue May 03, 2005 2:56 pm

The solution is to put the following lines just after the line Show>EnterScrap

//set values from ScrapType
GetDialogAction>EnterScrap,r
Let>EnterScrap.msMemo1=ScrapType.GetTick
Let>EnterScrap.msMemo2=ScrapType.GetDept
Let>EnterScrap.msMemo4=ScrapType.GetName
Let>EnterScrap.msMemo5=ScrapType.GetBoss
ResetDialogAction>EnterScrap
MJT Net Support
[email protected]

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