Create global variable with loop Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
magicshow
Posts: 67
Joined: 14 Oct 2022, 11:38

Create global variable with loop

Post by magicshow » 04 Feb 2023, 02:49

Code: Select all


loop 10
{
 global aim%a_index%
}

I got some set of variables like aim1 , aim2 , aim3 that the function needed.
The question is how to put them there by using a loop, thks

User avatar
boiler
Posts: 16705
Joined: 21 Dec 2014, 02:44

Re: Create global variable with loop  Topic is solved

Post by boiler » 04 Feb 2023, 04:59

You can’t declare global variables like that. You would have to list them all individually separated by commas or each on their own line. It would be better to use a real object-based array instead of a pseudo array anyway.

Post Reply

Return to “Ask for Help (v1)”