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 

array for the clipboard

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



Joined: 20 Apr 2005
Posts: 22
Location: Princeton NJ USA

PostPosted: Fri Apr 22, 2005 7:28 pm    Post subject: array for the clipboard Reply with quote

Hi...Thanks for the help I received on my previous questions. Here is my latest problem. I want to place a succession of strings on the clipboard.
I tried this loop, but it does not work. The clipboard stays empty. How do I get the clipboard to hold "a1" when i=1, "a2" when i=2, etc.? Thanks. playfullscientist
Code:
clipboard = %A_Space%
i=0
Loop 5
{
i=i+1
if i=1
   clipboard = a1
if i=2
   clipboard = a2
if i=3
   clipboard = a3
if i=4
   clipboard = a4
if i=5
   clipboard = a5
}

_________________
I am a playful scientist
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Jon



Joined: 28 Apr 2004
Posts: 373

PostPosted: Fri Apr 22, 2005 7:35 pm    Post subject: Reply with quote

You need to replace i=i+1 with

i:=i+1 or i+=1

otherwise it won't take i as being a variable. It will take as being a letter.
Back to top
View user's profile Send private message Send e-mail
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Fri Apr 22, 2005 7:45 pm    Post subject: Reply with quote

Or you could do:
Code:
clipboard = %A_Space%
Loop 5
  {
    var := a%A_Index%
    clipboard = %var%
  }
*not tested*
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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