Simple Arrays for Dummies from a non-programmer

Helpful script writing tricks and HowTo's
User avatar
Joe Glines
Posts: 442
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Simple Arrays for Dummies from a non-programmer

30 Dec 2013, 22:11

While the forum is awesome at providing great information and there are a ton of people that have helped solve many of my problems, one of my few gripes is that I often get advice that is probably easy for a programmer to follow however, given I'm new to programming, I find it very hard to follow.

I'd been working with both Simple and Associative arrays lately and many examples I found in the forum as well as AutoHotKey help were difficult for me to follow.

Thus I decided to take a crack at writing a tutorial from the non-programmer perspective. I'm sure some of my terminology is not correct (and some of it might flat out be wrong) but the below script works in the way that I describe in the video which I hope some other non-programmers will find helpful.

Below is the script I use in this video. With any luck you will find it helpful in understanding how to use simple arrays in AutoHotKey.

Spoiler
Last edited by Joe Glines on 02 Feb 2016, 18:08, edited 1 time in total.
vahju
Posts: 24
Joined: 30 Sep 2013, 16:09

Re: Simple Arrays for Dummies from a non-programmer

01 Jan 2014, 16:02

Great video and script.
I haven't had a need to use arrays yet but thanks to this post may start using them.

Did you use skype to do the recording?
Last edited by vahju on 02 Jan 2014, 10:27, edited 2 times in total.
User avatar
budRich
Posts: 81
Joined: 29 Sep 2013, 16:52
Location: Wermland
Contact:

Re: Simple Arrays for Dummies from a non-programmer

01 Jan 2014, 21:17

Cool, nice work! This will surely help people getting started with arrays.
SnowPickle
Posts: 4
Joined: 10 Nov 2014, 14:51

Re: Simple Arrays for Dummies from a non-programmer

19 Nov 2014, 18:07

Thanks Great Video, very thorough and great examples.
kwibus
Posts: 9
Joined: 15 Feb 2016, 20:42

Re: Simple Arrays for Dummies from a non-programmer

17 Feb 2016, 08:42

@Joe Glines:
Thanks! I am also at the very start now. My first question is about these lines:

Code: [Select all] [Download] GeSHi © Codebox Plus

RAlt::
Browser_Forward::Reload
RControl::
Browser_Back::


What is there use? Are these necessary?
guest3456
Posts: 2022
Joined: 09 Oct 2013, 10:31

Re: Simple Arrays for Dummies from a non-programmer

17 Feb 2016, 08:45

kwibus wrote:@Joe Glines:
Thanks! I am also at the very start now. My first question is about these lines:

Code: [Select all] [Download] GeSHi © Codebox Plus

RAlt::
Browser_Forward::Reload
RControl::
Browser_Back::


What is there use? Are these necessary?


those are the start of hotkey definitions. anytime you see a keyname followed by the double colon, that indicates the start of a hotkey for that key
https://autohotkey.com/docs/Hotkeys.htm

in this case, if i had to guess, it looks like those don't belong in this script and are probably a mistake or left over from his testing

User avatar
Joe Glines
Posts: 442
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: Simple Arrays for Dummies from a non-programmer

17 Feb 2016, 09:29

Sorry- I've been slammed at work. Those are 4 hotkeys for two main commands. The first two (right alt and Browser_Forward) will reload the script. The second two (Right control and Browser_back) will "launch" the actions beneath.

I like tying everything to a hotkey so I can easily hit a button and have my action execute, then edit the code, hit the other hotkey to reload, then repeat. Just saves me a lot of time.
BoBo
Posts: 1209
Joined: 13 May 2014, 17:15

Re: Simple Arrays for Dummies from a non-programmer

01 Jul 2017, 12:33

I like tying everything to a hotkey so I can easily hit a button and have my action execute, then edit the code, hit the other hotkey to reload, then repeat. Just saves me a lot of time.
Exactly the way I've done it as well, what is fine as long as you don't want to #Include that file within another script were it will throw errors like "duplicate hotkeys" because you use your favourite hotkeys all over the place etc. :shifty: for that reason I've stolen Trubbleguy's test scenario :thumbup:
It's working this way (let's assume your editor allows to execute a script with its own build in keyboard shortcut) ...

Code: [Select all] [Download] GeSHi © Codebox Plus

If (A_Scriptname = "<the script name here>"){ ; that section will only get executed via its host file, while getting ignored if included and executed via another script
MsgBox % function("Hello World")
ExitApp
}

function(msg){
Return % msg
}

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 3 guests