Yes it's me again and I still trying to learn how to work with the new
dialog options. I can't figure out why the "Let>varLoadPort..." command
will not return any values.
I've verified the %LPort% is getting the correct value.
But the varLoadPort message just returns %varLoadPort%
I tried moving the AddDialogHandler command, that did't help either.
[code]
BolDialog code
.....
AddDialogHandler>BoLDialog,DischargePort,OnExit,subLoadPort
Show>BoLDialog,r
SRT>subLoadPort
GetDialogProperty>BolDialog,LoadPort,Text,LPort
If %LPort% = "CHARLESTON, SC"
Let>varLoadPort = 1601
EndIf
Else
If %LPort% = "JACKSONVILLE, FL"
Let>varLoadPort = 1803
EndIf
Else
If %LPort% = "MIAMI, FL"
Let>varLoadPort = 5201
EndIf
Else
If %LPort% = "SAVANNAH, GA"
Let>varLoadPort = 1703
EndIf
Wait>2
Message>%LPort%
Wait>2
Message>%varLoadPort%
END>subLoadPort
[/code]
Thanks for any and all suggestions
Gil
Sub routine now working
Moderators: JRL, Dorian (MJT support)
-
- Pro Scripter
- Posts: 132
- Joined: Mon Dec 22, 2008 4:56 pm
- Location: St Augustine FL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Remove the spaces. Or use IGNORESPACES. Look up the IGNORESPACES help file topic for an explanation.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
ALSO
Make sure you have a "greater than symbol" > following any and all Macro Scheduler functions.
Without the ">" after "If" the "If" line will be ignored as if it were a remark and the lines inside the If/EndIf block will always be resolved. That means in your posted code, the variable "varLoadPort" will always equal 1703
In other words:
If %LPort% = "CHARLESTON, SC"
Let>varLoadPort = 1601
EndIf
Will become:
If>%LPort%="CHARLESTON, SC"
Let>varLoadPort=1601
EndIf
Additionally, as your code is written, you also do not need any of the "Else" lines. All of your "Else" lines can be deleted. Look up help for "If'.
Make sure you have a "greater than symbol" > following any and all Macro Scheduler functions.
Without the ">" after "If" the "If" line will be ignored as if it were a remark and the lines inside the If/EndIf block will always be resolved. That means in your posted code, the variable "varLoadPort" will always equal 1703
In other words:
If %LPort% = "CHARLESTON, SC"
Let>varLoadPort = 1601
EndIf
Will become:
If>%LPort%="CHARLESTON, SC"
Let>varLoadPort=1601
EndIf
Additionally, as your code is written, you also do not need any of the "Else" lines. All of your "Else" lines can be deleted. Look up help for "If'.
-
- Pro Scripter
- Posts: 132
- Joined: Mon Dec 22, 2008 4:56 pm
- Location: St Augustine FL
Sub routine now working
[quote]Remove the spaces. Or use IGNORESPACES. Look up the IGNORESPACES help file topic for an explanation.[/quote]
Yes, I have the system variable Let>IGNORESPACES=1 set at the beginning of my script. I learned about that one the hard way. Thanks
[quote]Make sure you have a "greater than symbol" > following any and all Macro Scheduler functions. [/quote]
I really feel dumb for not seeing that I was missing the > symbol! in my code.
I guess I got it confused with some vba coding I'm doing or at least thats my excuse and I'm sticking with it.
Thanks for pointing it out.
Gil
Yes, I have the system variable Let>IGNORESPACES=1 set at the beginning of my script. I learned about that one the hard way. Thanks
[quote]Make sure you have a "greater than symbol" > following any and all Macro Scheduler functions. [/quote]
I really feel dumb for not seeing that I was missing the > symbol! in my code.
I guess I got it confused with some vba coding I'm doing or at least thats my excuse and I'm sticking with it.
Thanks for pointing it out.
Gil
-
- Pro Scripter
- Posts: 132
- Joined: Mon Dec 22, 2008 4:56 pm
- Location: St Augustine FL
Sub routine now working
Ok I cleaned up my code making sure there are no spaces along with the system variable
Let>IGNORESPACES=1.
When subLoadPort is called The LPort variable continues to return the correct value.
I confirmed this with the message command. But now the varLoadPort only returns
the 1703 value no matter which LPort I choose. Again confirmed with a message command.
What could cause the if statement to fail, knowing that the variable has the correct value?
As always thanks for you feedback
Gil
Let>IGNORESPACES=1.
When subLoadPort is called The LPort variable continues to return the correct value.
I confirmed this with the message command. But now the varLoadPort only returns
the 1703 value no matter which LPort I choose. Again confirmed with a message command.
What could cause the if statement to fail, knowing that the variable has the correct value?
Code: Select all
SRT>subLoadPort
GetDialogProperty>BolDialog,LoadPort,Text,LPort
If>%LPort%="CHARLESTON, SC"
Let>varLoadPort=1601
EndIf
If>%LPort%="JACKSONVILLE, FL"
Let>varLoadPort=1803
EndIf
If>%LPort%="MIAMI, FL"
Let>varLoadPort=5201
EndIf
If>%LPort%="SAVANNAH, GA"
Let>varLoadPort=1703
EndIf
Wait>2
Message>%LPort%
Wait>2
Message>%varLoadPort%
END>subLoadPort
Gil
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
I think you want:
Code: Select all
If>LPort={"CHARLESTON, SC"}
Let>varLoadPort=1601
EndIf
If>LPort={"JACKSONVILLE, FL"}
Let>varLoadPort=1803
EndIf
If>LPort={"MIAMI, FL"}
Let>varLoadPort=5201
EndIf
If>LPort={"SAVANNAH, GA"}
Let>varLoadPort=1703
EndIf
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 132
- Joined: Mon Dec 22, 2008 4:56 pm
- Location: St Augustine FL
Sub routine now working
That did the trick!
Thanks again Marcus
Gil
Thanks again Marcus
Gil