Dialog/variable Problem since upgrade to 7.3.10

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
dbish
Junior Coder
Posts: 49
Joined: Wed Jan 08, 2003 8:38 am

Dialog/variable Problem since upgrade to 7.3.10

Post by dbish » Mon Feb 21, 2005 8:59 pm

Greetings everybody,

I have this problem on an existing script that only started to happen after I upgraded to 7.3.10. The script worked fine on 7.1.1 and version 5.xx.

Basically, the script creates a very large Dialog box (called PARAMETER) with hundreds of variables, checkboxes, and combo boxes. It loads a series of default values from a subroutine called INITIALIZE and then lets the user change any and all to create a custom stock price chart. A subroutine called CAPTURE then saves all the user inputs (whether changed or the initialization values) and then calls a webpage to create the chart. When the user closes the web page (with chart) another dialog box pops up and asks whether the user wants to create another chart or quit. If the answer is continue the main dialog box PARAMETER is once again displayed to start the process over. However, on the 2nd and subsequent cycles the last user-defined values are used to populate the variables in PARAMETER. The working script is 1100 lines long and I have probably 50 hours in creating it.

Now for the problem. With the latest release the process of INITIALIZING, allowing the user to modify parameters, and CAPTURING the variables works fine. I have tested this with MessageModal commands. However, on subsequent cycles, the settings for check boxes and Combo Boxes will retain the new, changed values but the settings for user inputted values will revert to the INITIALIZATION values. STRANGE.

I have cut my script down as much as possible to save posting space. I have left in only a couple of lines to test examples of various input methods. When the user changes inputs on Bar Interval or the check boxes to left of SMA (Simple Moving Average) or Stochastic Slow and Fast the changes will be remembered for subsequent cycles. Changes to Stock SYMBOL or the Numerical parameters for SMA or Stochastics will not stick.

(Note: The chart that does come up is just a static chart and will not reflect any user changes - that part is working and by using a static chart I could cut out a lot of code for this post.

I have left some of the MessageModal debug lines in.

Anybody have any thoughts why the latest version would cause this part of Msched to change behavior?

Thanks

Dave


CODE:
Dialog>PARAMETER
Caption=STARTUP OPTIONS
Top=20
Width=1000
Left=20
Height=700
Label========================= PRICE INDICATORS ======================== SYMBOL:,20,80
Edit=SYMBOL,555,97,80,%var_SYMBOL%
Label=BAR INTERVAL:,140,15
ComboBox=BarInterval,140,37,80,Daily%CRLF%1 minute%CRLF%5 minutes%CRLF%10 minutes%CRLF%15 minutes%CRLF%30 minutes%CRLF%60 minutes%CRLF%weekly
CheckBox=chkboxSMA,SMA,20,97,50,%var_chkboxSMA%
Edit=SMA1,80,97,30,%var_SMA1%
Edit=SMA2,115,97,30,%var_SMA2%
Edit=SMA3,150,97,30,%var_SMA3%
Edit=SMA4,185,97,30,%var_SMA4%
Edit=SMA5,220,97,30,%var_SMA5%
Edit=SMA6,255,97,30,%var_SMA6%
Edit=SMA7,297,97,30,%var_SMA7%
Edit=SMA8,325,97,30,%var_SMA8%
Edit=SMA9,360,97,30,%var_SMA9%
Edit=SMA10,395,97,30,%var_SMA10%
CheckBox=chkboxSTOslow,STOCHASTIC Slow,20,343,125,%var_chkboxSTOslow%
CheckBox=chkboxSTOslowU,,150,343,15,%var_chkboxSTOslowU%
CheckBox=chkboxSTOslowL,,165,343,15,%var_chkboxSTOslowL%
Edit=STOslow1,185,343,30,%var_STOslow1%
Edit=STOslow2,220,343,30,%var_STOslow2%
CheckBox=chkboxSTOfast,STOCHASTIC Fast,20,373,125,%var_chkboxSTOfast%
CheckBox=chkboxSTOfastU,,150,373,15,%var_chkboxSTOfastU%
CheckBox=chkboxSTOfastL,,165,373,15,%var_chkboxSTOfastL%
Edit=STOfast1,185,373,30,%var_STOfast1%
Edit=STOfast2,220,373,30,%var_STOfast2%
Button=SYMBOL LOOKUP,645,410,150,25,3
Button=OKAY,320,610,75,25,1
Button=CANCEL,645,610,75,25,2
EndDialog>PARAMETER

Dialog>CONTINUE
Caption=ANOTHER CHART?
Top=300
Width=300
Left=300
Height=100
Remark>Label=ANOTHER CHART OR QUIT?,35,15
Button=ANOTHER CHART,20,30,125,25,1
Button=QUIT,170,30,100,25,2
EndDialog>CONTINUE

GoSub>INITIALIZE

Remark>Subsequent cycles with Captured data come in here - below Initialize subroutine
Label>SHOWDIALOG
SHOW>PARAMETER,RESULT
If>RESULT=2,ENDPOINT
If>RESULT=3,SYMBOLLOOKUP
Gosub>CAPTURE
MessageModal>Interim (nonworking) Parameters captured after User presses OKAY:%CRLF%%CRLF%var_SYMBOL= %var_SYMBOL%%CRLF%var_SMA1= %var_SMA1% var_SMA2= %var_SMA2% var_SMA3= %var_SMA3%%CRLF%var_STOslow1= %var_STOslow1% var_STOslow2= %var_STOslow2%%CRLF%var_STOfast1= %var_STOfast1% var_STOfast2= %var_STOfast2%

Remark>========= BUILD URL =======
Let>URL1=http://www.stockcharts.com/def/servlet/ ... SYMBOL%,uu[950,600]daclynay[dd][pc20!c50!c200]
Run Program>"C:\Program Files\Internet Explorer\IEXPLORE.EXE" "about:blank"
WaitWindowOpen>about:blank*
Wait>1
PutClipBoard>%URL1%
SetFocus>about:blank*
GoSub>ADDRESSPASTE
WaitWindowOpen>stockcharts.com*
WaitWindowClosed>stockcharts.com*
SHOW>CONTINUE,RESULT2
If>RESULT2=2,ENDPOINT
Goto>SHOWDIALOG

Remark>====== DUMMY ROUTINE for SYMBOL LOOKUP =========
Label>SYMBOLLOOKUP
Goto>SHOWDIALOG

Label>ENDPOINT


Remark> ================== SUBROUTINES ============
SRT>INITIALIZE
Let>var_SYMBOL=IBM
Let>var_BarInterval=0
Let>var_chkboxSMA=False
Let>var_SMA1=20
Let>var_SMA2=50
Let>var_SMA3=200
Let>var_SMA4=
Let>var_SMA5=
Let>var_SMA6=
Let>var_SMA7=
Let>var_SMA8=
Let>var_SMA9=
Let>var_SMA10=
Let>var_chkboxSTOslow=
Let>var_chkboxSTOslowU=True
Let>var_chkboxSTOslowL=False
Let>var_STOslow1=21
Let>var_STOslow2=14
Let>var_chkboxSTOfast=False
Let>var_chkboxSTOfastU=True
Let>var_chkboxSTOfastL=False
Let>var_STOfast1=21
Let>var_STOfast2=14
END>INITIALIZE

SRT>CAPTURE
Let>var_SYMBOL=PARAMETER.SYMBOL
Let>var_BarInterval=PARAMETER.BarInterval.ItemIndex
Let>var_chkboxSMA=PARAMETER.chkboxSMA
Let>var_SMA1=PARAMETER.SMA1
Let>var_SMA2=PARAMETER.SMA2
Let>var_SMA3=PARAMETER.SMA3
Let>var_SMA4=PARAMETER.SMA4
Let>var_SMA5=PARAMETER.SMA5
Let>var_SMA6=PARAMETER.SMA6
Let>var_SMA7=PARAMETER.SMA7
Let>var_SMA8=PARAMETER.SMA8
Let>var_SMA9=PARAMETER.SMA9
Let>var_SMA10=PARAMETER.SMA10
Let>var_chkboxSTOslow=PARAMETER.chkboxSTOslow
Let>var_chkboxSTOslowU=PARAMETER.chkboxSTOslowU
Let>var_chkboxSTOslowL=PARAMETER.chkboxSTOslowL
Let>var_STOslow1=PARAMETER.STOslow1
Let>var_STOslow2=PARAMETER.STOslow2
Let>var_chkboxSTOfast=PARAMETER.chkboxSTOfast
Let>var_chkboxSTOfastU=PARAMETER.chkboxSTOfastU
Let>var_chkboxSTOfastL=PARAMETER.chkboxSTOfastL
Let>var_STOfast1=PARAMETER.STOfast1
Let>var_STOfast2=PARAMETER.STOfast2
END>CAPTURE


SRT>ADDRESSPASTE
Press ALT
Send Character/Text>D
Release ALT
Wait>.5
Press CTRL
Send Character/Text>V
Release CTRL
Wait>.5
Press Enter
END>ADDRESSPASTE

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

Post by support » Mon Feb 21, 2005 9:56 pm

Add the following line at the end of your loop, before your Goto>SHOWDIALOG command:

ResetDialogAction>PARAMETER

This will set the object's values to what the user entered on the next show.
MJT Net Support
[email protected]

dbish
Junior Coder
Posts: 49
Joined: Wed Jan 08, 2003 8:38 am

Post by dbish » Mon Feb 21, 2005 11:13 pm

Thanks Marcus. It worked great. Is this command new? Does it mean I don't need to fool around with the entire capture routine - all items are automatically captured? - or is it my capture routine still needed?

Thanks again.

Dave

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