Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

How to use Send to send an expression?


  • Please log in to reply
3 replies to this topic
Herasil
  • Guests
  • Last active:
  • Joined: --
What I am trying to do is save something to a variable, like:

var := {Space}

Then later in my script, I want to use the Send command to send what was in my variable, so it would look like

Send %var%

However autohotkey doesn't like the way I'm doing it, it doesn't like there being { and } in an expression and apparently my % don't work in my Send. How do I do it properly?

flyingDman
  • Spam Officer
  • 2186 posts
  • Last active: Nov 07 2015 08:15 AM
  • Joined: 27 Feb 2009
try:

var := "{Space}"
Send %var%

Marine Corps Gen. Joseph Dunford told senators at his Joint Chiefs of Staff confirmation hearing : “If you want to talk about a nation that could pose an existential threat to the United States, I'd have to point to Russia. And if you look at their behavior, it's nothing short of alarming.”


MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
Read carefully: <!-- m -->http://www.autohotke...s/Variables.htm<!-- m -->

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


randallf
  • Members
  • 711 posts
  • Last active: Jan 07 2014 11:45 PM
  • Joined: 06 Jul 2009
If you're used to speaking another language....

Var = This is a string
var := This is invalid
Var := "this is a string"

Var2 := concatenated
Var := "This is a " . var2 . "string"

Var3 = 4
Var := 2 + Var3 ;expression

as you can see you can use = or the assignment operator := to assign a string, there are no declarations in AHK - it will convert to what it needs to perform math, etc...

Help file is great here :)