| View previous topic :: View next topic |
| Author |
Message |
playfullscientist
Joined: 20 Apr 2005 Posts: 22 Location: Princeton NJ USA
|
Posted: Fri Apr 22, 2005 7:28 pm Post subject: array for the clipboard |
|
|
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 |
|
 |
Jon
Joined: 28 Apr 2004 Posts: 373
|
Posted: Fri Apr 22, 2005 7:35 pm Post subject: |
|
|
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 |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Fri Apr 22, 2005 7:45 pm Post subject: |
|
|
Or you could do: | Code: | clipboard = %A_Space%
Loop 5
{
var := a%A_Index%
clipboard = %var%
}
| *not tested* _________________ Ciao
toralf  |
|
| Back to top |
|
 |
|