 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
doyle
Joined: 14 Nov 2007 Posts: 20 Location: London, England
|
Posted: Thu Jan 10, 2008 5:43 pm Post subject: Probably so easy you'll laugh. |
|
|
Hey guys,
I have this code that appears loads of times in my script, and rather than have it clog up the page, id like to have it once, and then reference it multiple times.
| Code: | WinWait, Information,
WinActivate, Information,
Sleep, 200
Send, {ENTER}
WinWait, Information,
WinActivate, Information,
Sleep, 200
Send, {ENTER}
WinActivate, Create Document: Basic Data
SendInput, {ENTER 5}
return |
So i'd like that at the start, or end, and to be able to insert a shortened name in the code.
GoSub?
Or is there a way to store it like a a variable?
Cheers guys |
|
| Back to top |
|
 |
POINTS
Joined: 18 Jan 2006 Posts: 284
|
|
| Back to top |
|
 |
Conquer
Joined: 27 Jun 2006 Posts: 383 Location: Canada
|
Posted: Fri Jan 11, 2008 3:25 am Post subject: |
|
|
Why function? Labels are easier for beginners.
| Code: |
gosub TheLabel ; use this line of code whenever you want the label triggered.
; ...
; ...
return
TheLabel: ; Feel free to change ;)
WinWait, Information,
WinActivate, Information,
Sleep, 200
Send, {ENTER}
WinWait, Information,
WinActivate, Information,
Sleep, 200
Send, {ENTER}
WinActivate, Create Document: Basic Data
SendInput, {ENTER 5}
return |
_________________
 |
|
| Back to top |
|
 |
doyle
Joined: 14 Nov 2007 Posts: 20 Location: London, England
|
Posted: Fri Jan 11, 2008 3:02 pm Post subject: |
|
|
Thanks very much Conquer!
Thats really helped streamline my code.  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|