Guest bGraHam-AhK Posted October 5, 2007 Posted October 5, 2007 Last Tutorial i showed one of the most basic AhK scripts i could think of.So this time im showing an expanded version of that, variables.We will learn 2 things::adding two individal strings:adding two individual numbers together~~~~~~~~~~~~~~~~~~~~~~~~~~Adding Two Seperate Strings:~~~~~~~~~~~~~~~~~~~~~~~~~~Open a new txt document and type in the following code:firststring := "Hello"secondstring := "World"afteradding = %firststring% %secondstring%MsgBox, %firststring%+%secondstring% = %afteradding%!The Breakdown:"firststring" if you were to write this out alone, you would get an errorbut when you use a "=" or ":=" it will become a variable."=/:=" these two do different things= can hold anything, as can := but the difference is, "=" cant do mathematic equationsand ":=" cant put two variables cleanly (see *1) together!*1. e.g: := %variable1% %variable2% will show exactly that, not the variables themselves.%any variable or built in location ids%: anything between %% will point towards something elsee.g. %A_WorkingDir% should set whatever you use %A_WorkingDir% in to your current scripts location.luckily the makers of AutoHotKey weere nice enough to make message boxes show variables cleanly.Well that should be enough for tonight.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now