Code:
; ***************************
; Toggle Schedule - shared
; ***************************
ToggleSchedule(state)
{
if (state<0)
state=2
else if (state>2)
state=0
if (!state)
{
Send {tab 9}
Send 21a-nlr
Sleep 50
Send {tab}
}
else if (state=1)
{
Send {tab 9}
Send nlr-nurses station
Send {tab}
}
else if (state=2)
{
Send {tab 9}
Send nlr-simulation
Send {tab}
}
return state
}
This works (Above)
Code:
; ***************************************************************************
; TOGGLE SCHEDULE DETAILS
; ***************************************************************************
sched1=21a-nlr
sched2=nlr-nurses station
sched3=nlr-simulation
; ***************************
; Toggle Schedule - shared
; ***************************
ToggleSchedule(state)
{
if (state<0)
state=2
else if (state>2)
state=0
if (!state)
{
Send {tab 9}
Send %sched1%
Sleep 50
Send {tab}
}
else if (state=1)
{
Send {tab 9}
Send %sched2%
Send {tab}
}
else if (state=2)
{
Send {tab 9}
Send %sched3%
Send {tab}
}
return state
}
This does not. (Above)
Current Version with: SendMode Input at the top of script.
I can do simple exchanges like this on short test pieces of code for Notepad with no trouble.
But, when I roll it into my larger project, I'm running the code over to a Citrix client and honestly it is a bit fussy. Notice the odd Sleep 50 command in the working example that is clearly inconsistent but required (trust me) based on testing.
Am I missing anything (like hopefully a space or simple typo) or does this just look like something where the network and lag is mucking things up when I try to roll the send command into a variable? Any other ideas on things that I can try to pull those sends into configurable pieces of code?
Thanks in advance.
_________________
StoreyQuickNotes - An AutoHotkey Project for Radiation Oncology