Guest bGraHam-AhK Posted October 5, 2007 Share 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. Link to comment Share on other sites More sharing options...
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 account
Already have an account? Sign in here.Sign In Now