Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[Solved] Calling the Names of the Variables but with EnvAdd



  • Please log in to reply
2 replies to this topic
Pinkfloydd
  • Members
  • 75 posts
  • Last active: May 31 2019 02:43 AM
  • Joined: 01 Jul 2012
Hi!
And sorry for the title of the topic. I really dont know how to correctly describe what i want to to..

but here Im having the following problem:
-I want to call for example firstly the variable U1 with F2
-Then I press F1 to EnvAdd 1, And call U2 With F2
-Another Time I press F1 to EnvAdd another 1, and call U3 With F2

; Global Variables
U1 = Orange
U2 = Apple
U3 = Banana
Envadd, var1, 1  ; Start with 1

F1::
Envadd, var1, 1  ; Adding 1
return

F2::
Sendinput, [color=#FF0000]%U%[color=#400000]+[/color]%Var1%[/color]

And I was trying something like you can see in red, but didnt work.
The real problem is that I dont have just 3 variables (U1, U2, U3)... I have like 80 and I wanted to use the method of EnvAdd..

Thanks!!

Coco
  • Members
  • 697 posts
  • Last active: Oct 31 2015 07:26 PM
  • Joined: 27 Jul 2012
✓  Best Answer
Try This:

; Global Variables
U1 = Orange
U2 = Apple
U3 = Banana
var1 := 1

F1::
var1 += 1
return

F2::
MsgBox, % U%var1%
return

Just change MsgBox to SendInput. Thanks!

Pinkfloydd
  • Members
  • 75 posts
  • Last active: May 31 2019 02:43 AM
  • Joined: 01 Jul 2012
Thank u Very much! :)