AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Variable in a variable

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Sat Jun 28, 2008 9:34 pm    Post subject: Variable in a variable Reply with quote

i think that would be cool. I could do alot more this way, more loops.
more loops = efficiancy
efficiancy = speed and more work done
=D

Example:

Code:
PSY=0
START:
IF PSY=%PSY%
    PSY +=1
Run Notepad.exe
Sleep 300
WinGet, ID%PSY%, ID, Untitled - Notepad
ControlSend,, <text>, ahk_id %ID%PSY%%
GOTO START
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 5890

PostPosted: Sat Jun 28, 2008 9:57 pm    Post subject: Reply with quote

Your code would work with following amendment:

Code:
ControlSend,, <text>, % "ahk_id " ID%PSY%


Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
Guest






PostPosted: Sun Jun 29, 2008 8:05 am    Post subject: Reply with quote

Oh so sorry.
Embarassed
Feel like an idiot.
Thanks though!
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 5890

PostPosted: Sun Jun 29, 2008 8:19 am    Post subject: Reply with quote

Anonymous wrote:
Feel like an idiot.


It took me 6 months, before I learnt this from one of Titan's post.
It would be helpful if this was someway documented.

Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
Oberon



Joined: 18 Feb 2008
Posts: 458

PostPosted: Sun Jun 29, 2008 10:16 am    Post subject: Reply with quote

It's briefly documented in the page about Arrays. I believe this is called double-dereferencing.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group