Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
phil294 committed Dec 30, 2023
1 parent 5839992 commit 6f65a74
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ Besides the [Legacy Syntax](https://www.autohotkey.com/docs/v1/Language.htm#lega
result += %add_second%
Return
```
- `my_array := ["one", "two", "three"]` ->
- ```ahk
my_array := ["one", "two", "three"]
index = 1
MsgBox, % my_array[index]
```
->
```ahk
my_array1 = one
my_array2 = two
my_array3 = three
; (For Looping, see below)
index = 1
; Use any command that has an "InputVar" argument. StringTrimLeft is a nice choice because it doesn't do anything to the received value if the "Count" argument is 0 as below. Yes, it's weird, AHK_X11 has no actual arrays. In fact, in AHK v1.0, it used to be the same and the official docs also used StringTrimLeft a lot
StringTrimLeft, my_value, my_array%index%, 0
MsgBox, %my_value%
```
- ```ahk
colors := "red,green,blue"
Expand Down

0 comments on commit 6f65a74

Please sign in to comment.