| View previous topic :: View next topic |
| Author |
Message |
mstorey20
Joined: 21 Sep 2009 Posts: 10
|
Posted: Wed Oct 28, 2009 12:58 pm Post subject: Send %variable% not working like Send text |
|
|
| 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
Last edited by mstorey20 on Wed Oct 28, 2009 1:03 pm; edited 1 time in total |
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Wed Oct 28, 2009 1:02 pm Post subject: |
|
|
You're not declaring schedX as global variables inside your function.
You could also add them as parameters. _________________ "Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried."
Antonio França
My stuff: Google Profile |
|
| Back to top |
|
 |
mstorey20
Joined: 21 Sep 2009 Posts: 10
|
Posted: Wed Oct 28, 2009 1:14 pm Post subject: |
|
|
Blah....
Yes. Thanks. If there was only a smart compiler that knew what I wanted and would write and edit the code for me, it would be soooo much easier.  _________________ StoreyQuickNotes - An AutoHotkey Project for Radiation Oncology |
|
| Back to top |
|
 |
|