1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604
|
<Keys and buttons>^j</Keys and buttons><Symbol>::</Symbol><Normal Text> </Normal Text><Comment>; hotkey label</Comment><br/>
<Symbol>::</Symbol><Normal Text>ftw</Normal Text><Symbol>::</Symbol><Normal Text>Free the whales </Normal Text><Comment>; hotstring label abbreviation</Comment><br/>
<Symbol>::</Symbol><Normal Text>btw</Normal Text><Symbol>::</Symbol><Normal Text> </Normal Text><Comment>; hotstring label action</Comment><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> You typed btw.</Normal Text><br/>
<Commands>Run</Commands><Symbol>,</Symbol><Normal Text> notepad.exe </Normal Text><Comment>; Run Notepad when you press CTRL+N.</Comment><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> Wow</Normal Text><Keys and buttons>!</Keys and buttons><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> There are</Normal Text><br/>
<Commands>Run</Commands><Symbol>,</Symbol><Normal Text> notepad.exe</Normal Text><br/>
<Commands>WinActivate</Commands><Symbol>,</Symbol><Normal Text> Untitled - Notepad</Normal Text><br/>
<Commands>WinWaitActive</Commands><Symbol>,</Symbol><Normal Text> Untitled - Notepad</Normal Text><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> 7 lines</Normal Text><Symbol>{</Symbol><Normal Text>!</Normal Text><Symbol>}{</Symbol><Keys and buttons>Enter</Keys and buttons><Symbol>}</Symbol><br/>
<Commands>SendInput</Commands><Symbol>,</Symbol><Normal Text> inside the CTRL</Normal Text><Symbol>{</Symbol><Normal Text>+</Normal Text><Symbol>}</Symbol><Normal Text>J hotkey.</Normal Text><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Keys and buttons>Numpad0 & Numpad1</Keys and buttons><Symbol>::</Symbol><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> You pressed Numpad1 while holding down Numpad0.</Normal Text><br/>
<Commands>Run</Commands><Symbol>,</Symbol><Normal Text> notepad.exe</Normal Text><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Comment>; Untitled - Notepad</Comment><br/>
<Directives>#IfWinActive</Directives><Normal Text> Untitled - Notepad</Normal Text><br/>
<Keys and buttons>!q</Keys and buttons><Symbol>::</Symbol><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> You pressed ALT</Normal Text><Keys and buttons>+Q</Keys and buttons><Normal Text> in Notepad.</Normal Text><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Comment>; Any window that isn't Untitled - Notepad</Comment><br/>
<Directives>#IfWinActive</Directives><br/>
<Keys and buttons>!q</Keys and buttons><Symbol>::</Symbol><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> You pressed ALT</Normal Text><Keys and buttons>+Q</Keys and buttons><Normal Text> in any window.</Normal Text><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Comment>; Retrieve the ID/HWND of the active window</Comment><br/>
<Keywords>id</Keywords><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Functions>WinExist</Functions><Symbol>(</Symbol><String>"A"</String><Symbol>)</Symbol><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><Keywords>id</Keywords><br/>
<Normal Text></Normal Text><br/>
<Comment>; Press Win+↑ to maximize the active window</Comment><br/>
<Keys and buttons>#Up</Keys and buttons><Symbol>::</Symbol><Commands>WinMaximize</Commands><Symbol>,</Symbol><Normal Text> A</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keys and buttons>#i</Keys and buttons><Symbol>::</Symbol><br/>
<Commands>Run</Commands><Symbol>,</Symbol><Normal Text> https://www.google.com/</Normal Text><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Keys and buttons>^p</Keys and buttons><Symbol>::</Symbol><br/>
<Commands>Run</Commands><Symbol>,</Symbol><Normal Text> notepad.exe</Normal Text><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Keys and buttons>~j</Keys and buttons><Symbol>::</Symbol><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> ack</Normal Text><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Symbol>:*:</Symbol><Normal Text>acheiv</Normal Text><Symbol>::</Symbol><Normal Text>achiev</Normal Text><br/>
<Symbol>::</Symbol><Normal Text>achievment</Normal Text><Symbol>::</Symbol><Normal Text>achievement</Normal Text><br/>
<Symbol>::</Symbol><Normal Text>acquaintence</Normal Text><Symbol>::</Symbol><Normal Text>acquaintance</Normal Text><br/>
<Symbol>:*:</Symbol><Normal Text>adquir</Normal Text><Symbol>::</Symbol><Normal Text>acquir</Normal Text><br/>
<Symbol>::</Symbol><Normal Text>aquisition</Normal Text><Symbol>::</Symbol><Normal Text>acquisition</Normal Text><br/>
<Symbol>:*:</Symbol><Normal Text>agravat</Normal Text><Symbol>::</Symbol><Normal Text>aggravat</Normal Text><br/>
<Symbol>:*:</Symbol><Normal Text>allign</Normal Text><Symbol>::</Symbol><Normal Text>align</Normal Text><br/>
<Symbol>::</Symbol><Normal Text>ameria</Normal Text><Symbol>::</Symbol><Normal Text>America</Normal Text><br/>
<Symbol>:*:</Symbol><Normal Text>ftw</Normal Text><Symbol>::</Symbol><Normal Text>Free the whales </Normal Text><Comment>; Hotstring modifiers</Comment><br/>
<Normal Text>this_is_a_label: </Normal Text><Comment>; label</Comment><br/>
<Normal Text></Normal Text><br/>
<Directives>#IfWinActive</Directives><Normal Text> Untitled - Notepad</Normal Text><br/>
<Keys and buttons>#Space</Keys and buttons><Symbol>::</Symbol><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> You pressed WIN</Normal Text><Keys and buttons>+SPACE</Keys and buttons><Normal Text> in Notepad.</Normal Text><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>Ctrl down</Keys and buttons><Symbol>}</Symbol><Normal Text>c</Normal Text><Symbol>{</Symbol><Keys and buttons>Ctrl up</Keys and buttons><Symbol>}</Symbol><br/>
<Commands>SendInput</Commands><Symbol>,</Symbol><Normal Text> [b]</Normal Text><Symbol>{</Symbol><Keys and buttons>Ctrl down</Keys and buttons><Symbol>}</Symbol><Normal Text>v</Normal Text><Symbol>{</Symbol><Keys and buttons>Ctrl up</Keys and buttons><Symbol>}</Symbol><Normal Text>[/b]</Normal Text><br/>
<Flow of control>return</Flow of control><Normal Text> </Normal Text><Comment>; This ends the hotkey. The code below this point will not get triggered.</Comment><br/>
<Normal Text></Normal Text><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> This text has been typed</Normal Text><Symbol>{</Symbol><Normal Text>!</Normal Text><Symbol>}</Symbol><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>a</Keys and buttons><Symbol>}</Symbol><Normal Text> </Normal Text><Comment>; WRONG</Comment><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>a</Keys and buttons><Symbol>}{</Symbol><Keys and buttons>b</Keys and buttons><Symbol>}{</Symbol><Keys and buttons>c</Keys and buttons><Symbol>}</Symbol><Normal Text> </Normal Text><Comment>; WRONG</Comment><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>abc</Keys and buttons><Symbol>}</Symbol><Normal Text> </Normal Text><Comment>; WRONG</Comment><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> abc </Normal Text><Comment>; CORRECT</Comment><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Keys and buttons>^s</Keys and buttons><Normal Text> </Normal Text><Comment>; Both of these send CTRL+S</Comment><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>Ctrl down</Keys and buttons><Symbol>}</Symbol><Normal Text>s</Normal Text><Symbol>{</Symbol><Keys and buttons>Ctrl up</Keys and buttons><Symbol>}</Symbol><Normal Text> </Normal Text><Comment>; Both of these send CTRL+S</Comment><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>Ctrl down</Keys and buttons><Symbol>}</Symbol><Normal Text>c</Normal Text><Symbol>{</Symbol><Keys and buttons>Ctrl up</Keys and buttons><Symbol>}</Symbol><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>b down</Keys and buttons><Symbol>}{</Symbol><Keys and buttons>b up</Keys and buttons><Symbol>}</Symbol><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>Tab down</Keys and buttons><Symbol>}{</Symbol><Keys and buttons>Tab up</Keys and buttons><Symbol>}</Symbol><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>Up down</Keys and buttons><Symbol>}</Symbol><Normal Text> </Normal Text><Comment>; Press down the up-arrow key.</Comment><br/>
<Flow of control>Sleep</Flow of control><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>1000</Decimal><Normal Text> </Normal Text><Comment>; Keep it down for one second.</Comment><br/>
<Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>Up up</Keys and buttons><Symbol>}</Symbol><Normal Text> </Normal Text><Comment>; Release the up-arrow key.</Comment><br/>
<Normal Text></Normal Text><br/>
<Commands>Send</Commands><Symbol>,</Symbol><br/>
<Symbol>(</Symbol><br/>
<Normal Text>Line 1</Normal Text><br/>
<Normal Text>Line 2</Normal Text><br/>
<Normal Text>Apples are a fruit.</Normal Text><br/>
<Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Commands>Send</Commands><Normal Text> </Normal Text><Variables>%A_Hour%</Variables><br/>
<Functions>SubStr</Functions><Symbol>(</Symbol><Decimal>37</Decimal><Normal Text> </Normal Text><Symbol>*</Symbol><Normal Text> </Normal Text><Decimal>12</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Symbol>)</Symbol><br/>
<Functions>SubStr</Functions><Symbol>(</Symbol><Variables>A_Hour</Variables><Normal Text> </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>12</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Symbol>)</Symbol><br/>
<Functions>SubStr</Functions><Symbol>(</Symbol><Variables>A_AhkPath</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Functions>InStr</Functions><Symbol>(</Symbol><Variables>A_AhkPath</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><String>"AutoHotkey"</String><Symbol>))</Symbol><br/>
<Functions>SubStr</Functions><Symbol>(</Symbol><String>"I'm scripting, awesome!"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>16</Decimal><Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Commands>SetTitleMatchMode</Commands><Normal Text> RegEx</Normal Text><br/>
<Commands>WinActivate</Commands><Normal Text> ahk_exe i</Normal Text><Symbol>)</Symbol><String Char>\\</String Char><Regex>notepad</Regex><String Char>\.</String Char><Regex>exe</Regex><Symbol>$</Symbol><Normal Text> </Normal Text><Comment>; Match the name part of the full path.</Comment><br/>
<Commands>WinActivate</Commands><Normal Text> ahk_exe im</Normal Text><Symbol>)(*</Symbol><Regex>BSR_ANYCRLF</Regex><Symbol>)</Symbol><Regex>abc</Regex><String Char>\R</String Char><Regex>xyz</Regex><br/>
<Commands>WinActivate</Commands><Normal Text> ahk_exe im</Normal Text><Symbol>)(*</Symbol><Regex>BSR_ANY</Regex><Symbol>[^</Symbol><Regex>]</Regex><Symbol>]</Symbol><Regex>CRLF</Regex><Symbol>)</Symbol><Regex>abc</Regex><String Char>\R</String Char><Regex>xyz</Regex><br/>
<Normal Text></Normal Text><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>MyVar</Variables><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>5</Decimal><Symbol>)</Symbol><br/>
<Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> MyVar equals </Normal Text><Variables>%MyVar%</Variables><Keys and buttons>!!</Keys and buttons><br/>
<Normal Text> </Normal Text><Flow of control>ExitApp</Flow of control><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>MyVar </Normal Text><Symbol>=</Symbol><Normal Text> Text</Normal Text><br/>
<Normal Text>MyVar </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Variables>%MyVar2%</Variables><br/>
<Normal Text>MyVar </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Variables>%MyVar2%</Variables><Normal Text> some text </Normal Text><Variables>%MyVar3%</Variables><Normal Text>.</Normal Text><br/>
<Normal Text>MyVar </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Functions>SubStr</Functions><Symbol>(</Symbol><String>"I'm scripting, awesome!"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>16</Decimal><Symbol>)</Symbol><br/>
<Normal Text>MyVar </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"Text"</String><br/>
<Normal Text>MyVar </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>MyVar2</Variables><br/>
<Normal Text>MyVar </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Decimal>6</Decimal><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Decimal>8</Decimal><Normal Text> </Normal Text><Symbol>/</Symbol><Normal Text> </Normal Text><Decimal>3</Decimal><Normal Text> </Normal Text><Symbol>*</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Normal Text> </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Functions>Sqrt</Functions><Symbol>(</Symbol><Decimal>9</Decimal><Symbol>)</Symbol><br/>
<Normal Text>MyVar </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"The value of 5 + "</String><Normal Text> </Normal Text><Variables>MyVar2</Variables><Normal Text> </Normal Text><String>" is: "</String><Normal Text> </Normal Text><Decimal>5</Decimal><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Variables>MyVar2</Variables><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>Var1</Variables><Normal Text> </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><Variables>Var2</Variables><Symbol>)</Symbol><br/>
<Normal Text> Var1 </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>Var2</Variables><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Decimal>100</Decimal><br/>
<Normal Text></Normal Text><br/>
<Comment>; Some examples showing when to use percents and when not:</Comment><br/>
<Normal Text>Var </Normal Text><Symbol>=</Symbol><Normal Text> Text </Normal Text><Comment>; Assign some text to a variable (legacy).</Comment><br/>
<Keywords>Number</Keywords><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Decimal>6</Decimal><Normal Text> </Normal Text><Comment>; Assign a number to a variable (expression).</Comment><br/>
<Normal Text>Var2 </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Variables>%Var%</Variables><Normal Text> </Normal Text><Comment>; Assign a variable to another (legacy).</Comment><br/>
<Normal Text>Var3 </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>Var</Variables><Normal Text> </Normal Text><Comment>; Assign a variable to another (expression).</Comment><br/>
<Normal Text>Var4 </Normal Text><Symbol>.=</Symbol><Normal Text> Var </Normal Text><Comment>; Append a variable to the end of another (expression).</Comment><br/>
<Normal Text>Var5 </Normal Text><Symbol>+=</Symbol><Normal Text> </Normal Text><Variables>Var</Variables><Normal Text> </Normal Text><Comment>; Add the value of a variable to another (expression).</Comment><br/>
<Normal Text>Var5 </Normal Text><Symbol>-=</Symbol><Normal Text> </Normal Text><Variables>Var</Variables><Normal Text> </Normal Text><Comment>; Subtract the value of a variable from another (expression).</Comment><br/>
<Normal Text>Var6 </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Functions>SubStr</Functions><Symbol>(</Symbol><Variables>Var</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; Variable inside a function. This is always an expression.</Comment><br/>
<Normal Text>Var7 </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Variables>%Var%</Variables><Normal Text> Text </Normal Text><Comment>; Assigns a variable to another with some extra text (legacy).</Comment><br/>
<Normal Text>Var8 </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>Var</Variables><Normal Text> </Normal Text><String>" Text"</String><Normal Text> </Normal Text><Comment>; Assigns a variable to another with some extra text (expression).</Comment><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>%Var%</Variables><Normal Text> </Normal Text><Comment>; Variable inside a command.</Comment><br/>
<Commands>StringSplit</Commands><Symbol>,</Symbol><Normal Text> Var</Normal Text><Symbol>,</Symbol><Normal Text> Var</Normal Text><Symbol>,</Symbol><Normal Text> x </Normal Text><Comment>; Variable inside a command that uses InputVar and OutputVar.</Comment><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Keywords>Number</Keywords><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>6</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; Whenever an IF has parentheses, it'll be an expression. So no percent signs.</Comment><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>Var</Variables><Normal Text> </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><Keywords>Number</Keywords><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; Whenever an IF has parentheses, it'll be an expression. So no percent signs.</Comment><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Keywords>Number</Keywords><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>6</Decimal><Normal Text> </Normal Text><Comment>; Without parentheses, the IF is legacy. However, only variables on the 'right side' need percent signs.</Comment><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>Var1</Variables><Normal Text> </Normal Text><Symbol><</Symbol><Normal Text> </Normal Text><Variables>%Var2%</Variables><Normal Text> </Normal Text><Comment>; Without parentheses, the IF is legacy. However, only variables on the 'right side' need percent signs.</Comment><br/>
<Normal Text></Normal Text><br/>
<Normal Text>MyObject </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>[</Symbol><String>"one"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"two"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"three"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>17</Decimal><Symbol>]</Symbol><br/>
<Normal Text>Banana </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><String>"Color"</String><Symbol>:</Symbol><Normal Text> </Normal Text><String>"Yellow"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"Taste"</String><Symbol>:</Symbol><Normal Text> </Normal Text><String>"Delicious"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"Price"</String><Symbol>:</Symbol><Normal Text> </Normal Text><Decimal>3</Decimal><Symbol>}</Symbol><br/>
<Normal Text>MyObject </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Functions>Array</Functions><Symbol>(</Symbol><String>"one"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"two"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"three"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>17</Decimal><Symbol>)</Symbol><br/>
<Normal Text>Banana </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Functions>Object</Functions><Symbol>(</Symbol><String>"Color"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"Yellow"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"Taste"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"Delicious"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"Price"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>3</Decimal><Symbol>)</Symbol><br/>
<Normal Text>Banana</Normal Text><Symbol>[</Symbol><String>"Pickled"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>True</Variables><Normal Text> </Normal Text><Comment>; This banana has been pickled. Eww.</Comment><br/>
<Normal Text>Banana</Normal Text><Symbol>.</Symbol><Normal Text>Consistency </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"Mushy"</String><br/>
<Normal Text>Value </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>Banana</Variables><Symbol>[</Symbol><String>"Color"</String><Symbol>]</Symbol><br/>
<Normal Text>Value </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>Banana</Variables><Symbol>.</Symbol><Keywords>Color</Keywords><br/>
<Normal Text>MyObject</Normal Text><Symbol>[</Symbol><String>"NewerKey"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Float>3.1415</Float><br/>
<Normal Text>MyObject</Normal Text><Symbol>.</Symbol><Normal Text>NewKey </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"Shiny"</String><br/>
<Normal Text>MyObject</Normal Text><Symbol>.</Symbol><Normal Text>Push</Normal Text><Symbol>(</Symbol><Variables>Value1</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Value2</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Value3</Variables><Symbol>...)</Symbol><br/>
<Normal Text>Banana</Normal Text><Symbol>.</Symbol><Normal Text>Consistency </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>""</String><br/>
<Normal Text>RemovedValue </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>MyObject</Variables><Symbol>.</Symbol><Keys and buttons>Delete</Keys and buttons><Symbol>(</Symbol><Variables>AnyKey</Variables><Symbol>)</Symbol><br/>
<Normal Text>NumberOfRemovedKeys </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>MyObject</Variables><Symbol>.</Symbol><Keys and buttons>Delete</Keys and buttons><Symbol>(</Symbol><Variables>FirstKey</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>LastKey</Variables><Symbol>)</Symbol><br/>
<Normal Text>arr </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>[{}]</Symbol><Normal Text> </Normal Text><Comment>; Creates an array containing an object.</Comment><br/>
<Normal Text>arr</Normal Text><Symbol>[</Symbol><Decimal>1</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>{}</Symbol><Normal Text> </Normal Text><Comment>; Creates a second object, implicitly freeing the first object.</Comment><br/>
<Normal Text>arr</Normal Text><Symbol>.</Symbol><Normal Text>RemoveAt</Normal Text><Symbol>(</Symbol><Decimal>1</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; Removes and frees the second object.</Comment><br/>
<Normal Text>x </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>{},</Symbol><Normal Text> y </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>{}</Symbol><Normal Text> </Normal Text><Comment>; Create two objects.</Comment><br/>
<Normal Text>x</Normal Text><Symbol>.</Symbol><Normal Text>child </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>y</Variables><Symbol>,</Symbol><Normal Text> y</Normal Text><Symbol>.</Symbol><Normal Text>parent </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>x</Variables><Normal Text> </Normal Text><Comment>; Create a circular reference.</Comment><br/>
<Normal Text>y</Normal Text><Symbol>.</Symbol><Normal Text>parent </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>""</String><br/>
<Normal Text>x </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>""</String><Symbol>,</Symbol><Normal Text> y </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>""</String><br/>
<Normal Text>table</Normal Text><Symbol>.</Symbol><Normal Text>base</Normal Text><Symbol>.</Symbol><Normal Text>__Get</Normal Text><Symbol>(</Symbol><Variables>table</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>x</Variables><Symbol>)[</Symbol><Variables>y</Variables><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>content</Variables><Normal Text> </Normal Text><Comment>; A</Comment><br/>
<Normal Text>table</Normal Text><Symbol>.</Symbol><Normal Text>base</Normal Text><Symbol>.</Symbol><Normal Text>__Set</Normal Text><Symbol>(</Symbol><Variables>table</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>x</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>y</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>content</Variables><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; B</Comment><br/>
<Normal Text>RemovedValue </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>MyObject</Variables><Symbol>.</Symbol><Variables>RemoveAt</Variables><Symbol>(</Symbol><Variables>Index</Variables><Symbol>)</Symbol><br/>
<Normal Text>NumberOfRemovedKeys </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>MyObject</Variables><Symbol>.</Symbol><Variables>RemoveAt</Variables><Symbol>(</Symbol><Variables>Index</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Length</Variables><Symbol>)</Symbol><br/>
<Normal Text>val </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>obj</Variables><Symbol>.</Symbol><Keywords>Property</Keywords><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Decimal>42</Decimal><br/>
<Normal Text>m1 </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Keywords>new</Keywords><Normal Text> </Normal Text><Variables>GMem</Variables><Symbol>(</Symbol><Decimal>0</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>20</Decimal><Symbol>)</Symbol><br/>
<Normal Text>m2 </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keywords>base</Keywords><Symbol>:</Symbol><Normal Text> </Normal Text><Variables>GMem</Variables><Symbol>}.</Symbol><Keywords>__New</Keywords><Symbol>(</Symbol><Decimal>0</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>30</Decimal><Symbol>)</Symbol><br/>
<Normal Text>x </Normal Text><Symbol>?</Symbol><Normal Text> </Normal Text><Variables>CallIfTrue</Variables><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Variables>CallIfFalse</Variables><Symbol>()</Symbol><br/>
<Normal Text>ProductIsAvailable </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Keywords>Color</Keywords><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"Red"</String><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Symbol>?</Symbol><Normal Text> </Normal Text><Variables>false</Variables><Normal Text> </Normal Text><Comment>; We don't have any red products, so don't bother calling the function.</Comment><br/>
<Normal Text> </Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Variables>ProductIsAvailableInColor</Variables><Symbol>(</Symbol><Variables>Product</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Keywords>Color</Keywords><Symbol>)</Symbol><br/>
<Normal Text>MyObject</Normal Text><Symbol>.</Symbol><Normal Text>Pop</Normal Text><Symbol>()</Symbol><br/>
<Variables>%Var%</Variables><Symbol>()</Symbol><br/>
<Normal Text></Normal Text><br/>
<Flow of control>Sleep</Flow of control><Normal Text> </Normal Text><Variables>MillisecondsToWait</Variables><br/>
<Flow of control>Sleep</Flow of control><Normal Text> </Normal Text><Variables>%MillisecondsToWait%</Variables><br/>
<Flow of control>Sleep</Flow of control><Normal Text> </Normal Text><Variables>%</Variables><Normal Text> </Normal Text><Variables>MillisecondsToWait</Variables><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><Decimal>1</Decimal><Symbol>+</Symbol><Decimal>1</Decimal><Normal Text> </Normal Text><Comment>; Shows "2"</Comment><br/>
<Commands>MsgBox</Commands><Normal Text> 1</Normal Text><Keys and buttons>+</Keys and buttons><Normal Text>1 </Normal Text><Comment>; Shows "1+1"</Comment><br/>
<Normal Text></Normal Text><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><String>"This is text."</String><br/>
<Commands>MsgBox</Commands><Normal Text> This is text.</Normal Text><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><Normal Text> </Normal Text><Variables>A_AhkVersion</Variables><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Variables>%A_AhkVersion%</Variables><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><Variables>%A_AhkVersion%</Variables><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><String>"Hello %A_UserName%."</String><Normal Text> </Normal Text><Comment>; Shows "%A_UserName%"</Comment><br/>
<Commands>MsgBox</Commands><Normal Text> Hello </Normal Text><Variables>%A_UserName%</Variables><Normal Text>. </Normal Text><Comment>; Shows your username.</Comment><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><String>"Hello "</String><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text> </Normal Text><Variables>A_UserName</Variables><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text> </Normal Text><String>"."</String><Normal Text> </Normal Text><Comment>; Shows your username.</Comment><br/>
<Normal Text>MyVar </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"This is text."</String><br/>
<Normal Text>MyVar </Normal Text><Symbol>=</Symbol><Normal Text> This is text.</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>Var1</Variables><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Variables>Var2</Variables><Symbol>)</Symbol><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>Var1</Variables><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Variables>%Var2%</Variables><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>Var1</Variables><Normal Text> </Normal Text><Symbol>>=</Symbol><Normal Text> </Normal Text><Keywords>Low</Keywords><Normal Text> </Normal Text><Keywords>and</Keywords><Normal Text> </Normal Text><Variables>Var1</Variables><Normal Text> </Normal Text><Symbol><=</Symbol><Normal Text> </Normal Text><Keywords>High</Keywords><Symbol>)</Symbol><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>Var1</Variables><Normal Text> </Normal Text><Keywords>between</Keywords><Normal Text> </Normal Text><Variables>%Low%</Variables><Normal Text> </Normal Text><Keywords>and</Keywords><Normal Text> </Normal Text><Variables>%High%</Variables><br/>
<Normal Text></Normal Text><br/>
<Functions>Format</Functions><Symbol>(</Symbol><String>"{:L}{:U}{:T}"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Commands>input</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Commands>input</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Commands>input</Commands><Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keys and buttons>*#up</Keys and buttons><Symbol>::</Symbol><Commands>MouseMove</Commands><Symbol>,</Symbol><Normal Text> 0</Normal Text><Symbol>,</Symbol><Normal Text> -10</Normal Text><Symbol>,</Symbol><Normal Text> 0</Normal Text><Symbol>,</Symbol><Normal Text> R </Normal Text><Comment>; Win+UpArrow hotkey => Move cursor upward</Comment><br/>
<Keys and buttons>*#Down</Keys and buttons><Symbol>::</Symbol><Commands>MouseMove</Commands><Symbol>,</Symbol><Normal Text> 0</Normal Text><Symbol>,</Symbol><Normal Text> 10</Normal Text><Symbol>,</Symbol><Normal Text> 0</Normal Text><Symbol>,</Symbol><Normal Text> R </Normal Text><Comment>; Win+DownArrow => Move cursor downward</Comment><br/>
<Keys and buttons>*#Left</Keys and buttons><Symbol>::</Symbol><Commands>MouseMove</Commands><Symbol>,</Symbol><Normal Text> -10</Normal Text><Symbol>,</Symbol><Normal Text> 0</Normal Text><Symbol>,</Symbol><Normal Text> 0</Normal Text><Symbol>,</Symbol><Normal Text> R </Normal Text><Comment>; Win+LeftArrow => Move cursor to the left</Comment><br/>
<Keys and buttons>*#Right</Keys and buttons><Symbol>::</Symbol><Commands>MouseMove</Commands><Symbol>,</Symbol><Normal Text> 10</Normal Text><Symbol>,</Symbol><Normal Text> 0</Normal Text><Symbol>,</Symbol><Normal Text> 0</Normal Text><Symbol>,</Symbol><Normal Text> R </Normal Text><Comment>; Win+RightArrow => Move cursor to the right</Comment><br/>
<Normal Text></Normal Text><br/>
<Keys and buttons>*<#RCtrl</Keys and buttons><Symbol>::</Symbol><Normal Text> </Normal Text><Comment>; LeftWin + RightControl => Left-click (hold down Control/Shift to Control-Click or Shift-Click).</Comment><br/>
<Commands>SendEvent</Commands><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>Blind</Keys and buttons><Symbol>}{</Symbol><Keys and buttons>LButton down</Keys and buttons><Symbol>}</Symbol><br/>
<Commands>KeyWait</Commands><Normal Text> RCtrl </Normal Text><Comment>; Prevents keyboard auto-repeat from repeating the mouse click.</Comment><br/>
<Commands>SendEvent</Commands><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>Blind</Keys and buttons><Symbol>}{</Symbol><Keys and buttons>LButton up</Keys and buttons><Symbol>}</Symbol><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Keys and buttons>*<#AppsKey</Keys and buttons><Symbol>::</Symbol><Normal Text> </Normal Text><Comment>; LeftWin + AppsKey => Right-click</Comment><br/>
<Commands>SendEvent</Commands><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>Blind</Keys and buttons><Symbol>}{</Symbol><Keys and buttons>RButton down</Keys and buttons><Symbol>}</Symbol><br/>
<Commands>KeyWait</Commands><Normal Text> AppsKey </Normal Text><Comment>; Prevents keyboard auto-repeat from repeating the mouse click.</Comment><br/>
<Commands>SendEvent</Commands><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>Blind</Keys and buttons><Symbol>}{</Symbol><Keys and buttons>RButton up</Keys and buttons><Symbol>}</Symbol><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Directives>#Persistent</Directives><Normal Text> </Normal Text><Comment>; Keep this script running until the user explicitly exits it.</Comment><br/>
<Flow of control>SetTimer</Flow of control><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>WatchPOV</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>5</Decimal><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Normal Text>WatchPOV:</Normal Text><br/>
<Normal Text>POV </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Commands>GetKeyState</Commands><Symbol>(</Symbol><String>"JoyPOV"</String><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; Get position of the POV control.</Comment><br/>
<Normal Text>KeyToHoldDownPrev </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>KeyToHoldDown</Variables><Normal Text> </Normal Text><Comment>; Prev now holds the key that was down before (if any).</Comment><br/>
<Normal Text></Normal Text><br/>
<Comment>; Some joysticks might have a smooth/continous POV rather than one in fixed increments.</Comment><br/>
<Comment>; To support them all, use a range:</Comment><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>POV</Variables><Normal Text> </Normal Text><Symbol><</Symbol><Normal Text> </Normal Text><Decimal>0</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; No angle to report</Comment><br/>
<Normal Text> KeyToHoldDown </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>""</String><br/>
<Flow of control>else</Flow of control><Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>POV</Variables><Normal Text> </Normal Text><Symbol>></Symbol><Normal Text> </Normal Text><Decimal>31500</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; 315 to 360 degrees: Forward</Comment><br/>
<Normal Text> KeyToHoldDown </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"Up"</String><br/>
<Flow of control>else</Flow of control><Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>POV</Variables><Normal Text> </Normal Text><Keywords>between</Keywords><Normal Text> </Normal Text><Decimal>0</Decimal><Normal Text> </Normal Text><Keywords>and</Keywords><Normal Text> </Normal Text><Decimal>4500</Decimal><Normal Text> </Normal Text><Comment>; 0 to 45 degrees: Forward</Comment><br/>
<Normal Text> KeyToHoldDown </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"Up"</String><br/>
<Flow of control>else</Flow of control><Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>POV</Variables><Normal Text> </Normal Text><Keywords>between</Keywords><Normal Text> </Normal Text><Decimal>4501</Decimal><Normal Text> </Normal Text><Keywords>and</Keywords><Normal Text> </Normal Text><Decimal>13500</Decimal><Normal Text> </Normal Text><Comment>; 45 to 135 degrees: Right</Comment><br/>
<Normal Text> KeyToHoldDown </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"Right"</String><br/>
<Flow of control>else</Flow of control><Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>POV</Variables><Normal Text> </Normal Text><Keywords>between</Keywords><Normal Text> </Normal Text><Decimal>13501</Decimal><Normal Text> </Normal Text><Keywords>and</Keywords><Normal Text> </Normal Text><Decimal>22500</Decimal><Normal Text> </Normal Text><Comment>; 135 to 225 degrees: Down</Comment><br/>
<Normal Text> KeyToHoldDown </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"Down"</String><br/>
<Flow of control>else</Flow of control><Normal Text> </Normal Text><Comment>; 225 to 315 degrees: Left</Comment><br/>
<Normal Text> KeyToHoldDown </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"Left"</String><br/>
<Normal Text></Normal Text><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>KeyToHoldDown</Variables><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Variables>KeyToHoldDownPrev</Variables><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; The correct key is already down (or no key is needed).</Comment><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Comment>; Do nothing.</Comment><br/>
<Normal Text></Normal Text><br/>
<Comment>; Otherwise, release the previous key and press down the new key:</Comment><br/>
<Commands>SetKeyDelay</Commands><Normal Text> -1 </Normal Text><Comment>; Avoid delays between keystrokes.</Comment><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>KeyToHoldDownPrev</Variables><Normal Text> </Normal Text><Comment>; There is a previous key to release.</Comment><br/>
<Normal Text> </Normal Text><Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>%KeyToHoldDownPrev% up</Keys and buttons><Symbol>}</Symbol><Normal Text> </Normal Text><Comment>; Release it.</Comment><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>KeyToHoldDown</Variables><Normal Text> </Normal Text><Comment>; There is a key to press down.</Comment><br/>
<Normal Text> </Normal Text><Commands>Send</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>%KeyToHoldDown% down</Keys and buttons><Symbol>}</Symbol><Normal Text> </Normal Text><Comment>; Press it down.</Comment><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Keys and buttons><^>!m</Keys and buttons><Symbol>::</Symbol><Commands>MsgBox</Commands><Normal Text> You pressed AltGr</Normal Text><Keys and buttons>+m</Keys and buttons><Normal Text>.</Normal Text><br/>
<Keys and buttons><^<!m</Keys and buttons><Symbol>::</Symbol><Commands>MsgBox</Commands><Normal Text> You pressed LeftControl</Normal Text><Keys and buttons>+LeftAlt+m</Keys and buttons><Normal Text>.</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keys and buttons>AppsKey</Keys and buttons><Symbol>::</Symbol><Commands>ToolTip</Commands><Normal Text> Press </Normal Text><Keys and buttons><</Keys and buttons><Normal Text> or </Normal Text><Keys and buttons>></Keys and buttons><Normal Text> to cycle through windows.</Normal Text><br/>
<Keys and buttons>AppsKey Up</Keys and buttons><Symbol>::</Symbol><Commands>ToolTip</Commands><br/>
<Keys and buttons>~AppsKey & <</Keys and buttons><Symbol>::</Symbol><Commands>Send</Commands><Normal Text> </Normal Text><Keys and buttons>!+</Keys and buttons><Symbol>{</Symbol><Keys and buttons>Esc</Keys and buttons><Symbol>}</Symbol><br/>
<Keys and buttons>~AppsKey & ></Keys and buttons><Symbol>::</Symbol><Commands>Send</Commands><Normal Text> </Normal Text><Keys and buttons>!</Keys and buttons><Symbol>{</Symbol><Keys and buttons>Esc</Keys and buttons><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>; Press AppsKey and Alt in any order, then slash (/).</Comment><br/>
<Directives>#if</Directives><Normal Text> </Normal Text><Commands>GetKeyState</Commands><Symbol>(</Symbol><String>"AppsKey"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"P"</String><Symbol>)</Symbol><br/>
<Keys and buttons>Alt & /</Keys and buttons><Symbol>::</Symbol><Commands>MsgBox</Commands><Normal Text> Hotkey activated.</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>; If the keys are swapped, Alt must be pressed first (use one at a time):</Comment><br/>
<Directives>#if</Directives><Normal Text> </Normal Text><Commands>GetKeyState</Commands><Symbol>(</Symbol><String>"Alt"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"P"</String><Symbol>)</Symbol><br/>
<Keys and buttons>AppsKey & /</Keys and buttons><Symbol>::</Symbol><Commands>MsgBox</Commands><Normal Text> Hotkey activated.</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>; [ & ] & \::</Comment><br/>
<Directives>#if</Directives><Normal Text> </Normal Text><Commands>GetKeyState</Commands><Symbol>(</Symbol><String>"["</String><Symbol>)</Symbol><Normal Text> && </Normal Text><Commands>GetKeyState</Commands><Symbol>(</Symbol><String>"]"</String><Symbol>)</Symbol><br/>
<Normal Text>\::</Normal Text><Commands>MsgBox</Commands><br/>
<Normal Text></Normal Text><br/>
<Comment>; Ctrl+Shift+O to open containing folder in Explorer.</Comment><br/>
<Comment>; Ctrl+Shift+E to open folder with current file selected.</Comment><br/>
<Comment>; Supports SciTE and Notepad++.</Comment><br/>
<Keys and buttons>^+o</Keys and buttons><Symbol>::</Symbol><br/>
<Keys and buttons>^+e</Keys and buttons><Symbol>::</Symbol><br/>
<Normal Text> editor_open_folder</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Commands>WinGetTitle</Commands><Symbol>,</Symbol><Normal Text> path</Normal Text><Symbol>,</Symbol><Normal Text> A</Normal Text><br/>
<Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Functions>RegExMatch</Functions><Symbol>(</Symbol><Variables>path</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><String>"\*?\K(.*)\\[^\\]+(?= [-*] )"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>path</Variables><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Functions>FileExist</Functions><Symbol>(</Symbol><Variables>path</Variables><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>&&</Symbol><Normal Text> </Normal Text><Variables>A_ThisHotkey</Variables><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"^+e"</String><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Commands>Run</Commands><Normal Text> explorer.exe /select</Normal Text><String Char>`,</String Char><Normal Text>"</Normal Text><Variables>%path%</Variables><Normal Text>"</Normal Text><br/>
<Normal Text> </Normal Text><Flow of control>else</Flow of control><br/>
<Normal Text> </Normal Text><Commands>Run</Commands><Normal Text> explorer.exe "</Normal Text><Variables>%path1%</Variables><Normal Text>"</Normal Text><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keys and buttons>#h</Keys and buttons><Symbol>::</Symbol><Normal Text> </Normal Text><Comment>; Win+H hotkey</Comment><br/>
<Comment>; Get the text currently selected. The clipboard is used instead of</Comment><br/>
<Comment>; "ControlGet Selected" because it works in a greater variety of editors</Comment><br/>
<Comment>; (namely word processors). Save the current clipboard contents to be</Comment><br/>
<Comment>; restored later. Although this handles only plain text, it seems better</Comment><br/>
<Comment>; than nothing:</Comment><br/>
<Commands>AutoTrim</Commands><Normal Text> Off </Normal Text><Comment>; Retain any leading and trailing whitespace on the clipboard.</Comment><br/>
<Normal Text>ClipboardOld </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>ClipboardAll</Variables><br/>
<Variables>Clipboard</Variables><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>""</String><Normal Text> </Normal Text><Comment>; Must start off blank for detection to work.</Comment><br/>
<Commands>Send</Commands><Normal Text> </Normal Text><Keys and buttons>^c</Keys and buttons><br/>
<Commands>ClipWait</Commands><Normal Text> 1</Normal Text><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>ErrorLevel</Variables><Normal Text> </Normal Text><Comment>; ClipWait timed out.</Comment><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><br/>
<Comment>; Replace CRLF and/or LF with `n for use in a "send-raw" hotstring:</Comment><br/>
<Comment>; The same is done for any other characters that might otherwise</Comment><br/>
<Comment>; be a problem in raw mode:</Comment><br/>
<Commands>StringReplace</Commands><Symbol>,</Symbol><Normal Text> Hotstring</Normal Text><Symbol>,</Symbol><Normal Text> Clipboard</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><String Char>``</String Char><Symbol>,</Symbol><Normal Text> </Normal Text><String Char>````</String Char><Symbol>,</Symbol><Normal Text> All </Normal Text><Comment>; Do this replacement first to avoid interfering with the others below.</Comment><br/>
<Commands>StringReplace</Commands><Symbol>,</Symbol><Normal Text> Hotstring</Normal Text><Symbol>,</Symbol><Normal Text> Hotstring</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><String Char>`r`n</String Char><Symbol>,</Symbol><Normal Text> </Normal Text><String Char>``</String Char><Normal Text>r</Normal Text><Symbol>,</Symbol><Normal Text> All </Normal Text><Comment>; Using `r works better than `n in MS Word, etc.</Comment><br/>
<Commands>StringReplace</Commands><Symbol>,</Symbol><Normal Text> Hotstring</Normal Text><Symbol>,</Symbol><Normal Text> Hotstring</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><String Char>`n</String Char><Symbol>,</Symbol><Normal Text> </Normal Text><String Char>``</String Char><Normal Text>r</Normal Text><Symbol>,</Symbol><Normal Text> All</Normal Text><br/>
<Commands>StringReplace</Commands><Symbol>,</Symbol><Normal Text> Hotstring</Normal Text><Symbol>,</Symbol><Normal Text> Hotstring</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>%A_Tab%</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><String Char>``</String Char><Normal Text>t</Normal Text><Symbol>,</Symbol><Normal Text> All</Normal Text><br/>
<Commands>StringReplace</Commands><Symbol>,</Symbol><Normal Text> Hotstring</Normal Text><Symbol>,</Symbol><Normal Text> Hotstring</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><String Char>`;</String Char><Symbol>,</Symbol><Normal Text> </Normal Text><String Char>```;</String Char><Symbol>,</Symbol><Normal Text> All</Normal Text><br/>
<Variables>Clipboard</Variables><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>ClipboardOld</Variables><Normal Text> </Normal Text><Comment>; Restore previous contents of clipboard.</Comment><br/>
<Comment>; This will move the InputBox's caret to a more friendly position:</Comment><br/>
<Flow of control>SetTimer</Flow of control><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>MoveCaret</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>10</Decimal><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>ErrorLevel</Variables><Normal Text> </Normal Text><Comment>; The user pressed Cancel.</Comment><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Functions>InStr</Functions><Symbol>(</Symbol><Functions>Hotstring</Functions><Symbol>,</Symbol><Normal Text> </Normal Text><String>":R</String><String Char>`::</String Char><String>:"</String><Symbol>)</Symbol><br/>
<Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Normal Text> You didn't provide an abbreviation. The hotstring has not been added.</Normal Text><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><br/>
<Symbol>}</Symbol><br/>
<Comment>; Otherwise, add the hotstring and reload the script:</Comment><br/>
<Commands>FileAppend</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><String Char>`n</String Char><Variables>%Hotstring%</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>%A_ScriptFullPath%</Variables><Normal Text> </Normal Text><Comment>; Put a `n at the beginning in case file lacks a blank line at its end.</Comment><br/>
<Commands>Reload</Commands><br/>
<Flow of control>Sleep</Flow of control><Normal Text> </Normal Text><Decimal>200</Decimal><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> 4</Normal Text><Symbol>,,</Symbol><Normal Text> The hotstring just added appears to be improperly formatted.</Normal Text><br/>
<Flow of control>IfMsgBox</Flow of control><Symbol>,</Symbol><Normal Text> </Normal Text><Keywords>Yes</Keywords><Symbol>,</Symbol><Normal Text> </Normal Text><Commands>Edit</Commands><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Normal Text>MoveCaret:</Normal Text><br/>
<Flow of control>IfWinNotActive</Flow of control><Symbol>,</Symbol><Normal Text> </Normal Text><Keywords>New</Keywords><Normal Text> </Normal Text><Functions>Hotstring</Functions><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><br/>
<Comment>; Otherwise, move the InputBox's insertion point to where the user will type the abbreviation.</Comment><br/>
<Commands>Send</Commands><Normal Text> </Normal Text><Symbol>{</Symbol><Keys and buttons>Home</Keys and buttons><Symbol>}{</Symbol><Keys and buttons>Right 3</Keys and buttons><Symbol>}</Symbol><br/>
<Flow of control>SetTimer</Flow of control><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>MoveCaret</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Keywords>Off</Keywords><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Comment>; This example also demonstrates one way to implement case conformity in a script.</Comment><br/>
<Symbol>:</Symbol><Normal Text>C</Normal Text><Symbol>:</Symbol><Normal Text>BTW</Normal Text><Symbol>::</Symbol><Normal Text> </Normal Text><Comment>; Typed in all-caps.</Comment><br/>
<Symbol>:</Symbol><Normal Text>C</Normal Text><Symbol>:</Symbol><Normal Text>Btw</Normal Text><Symbol>::</Symbol><Normal Text> </Normal Text><Comment>; Typed with only the first letter upper-case.</Comment><br/>
<Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>:</Symbol><Normal Text>btw</Normal Text><Symbol>::</Symbol><Normal Text> </Normal Text><Comment>; Typed in any other combination.</Comment><br/>
<Normal Text> case_conform_btw</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> hs </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>A_ThisHotkey</Variables><Normal Text> </Normal Text><Comment>; For convenience and in case we're interrupted.</Comment><br/>
<Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>hs</Variables><Normal Text> </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><String>":C:BTW"</String><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Commands>Send</Commands><Normal Text> BY THE WAY</Normal Text><br/>
<Normal Text> </Normal Text><Flow of control>else</Flow of control><Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>hs</Variables><Normal Text> </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><String>":C:Btw"</String><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Commands>Send</Commands><Normal Text> By the way</Normal Text><br/>
<Normal Text> </Normal Text><Flow of control>else</Flow of control><br/>
<Normal Text> </Normal Text><Commands>Send</Commands><Normal Text> by the way</Normal Text><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Directives>#IfWinActive</Directives><Normal Text> </Normal Text><Keywords>ahk_class</Keywords><Normal Text> Notepad</Normal Text><br/>
<Symbol>::</Symbol><Normal Text>btw</Normal Text><Symbol>::</Symbol><Normal Text>This replacement text will appear only in Notepad.</Normal Text><br/>
<Directives>#IfWinActive</Directives><br/>
<Symbol>::</Symbol><Normal Text>btw</Normal Text><Symbol>::</Symbol><Normal Text>This replacement text appears in windows other than Notepad.</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Directives>#Hotstring</Directives><Normal Text> EndChars -()[]{}:</Normal Text><Comment>;'"/\,.?!`n `t</Comment><br/>
<Normal Text></Normal Text><br/>
<Functions>Hotstring</Functions><Symbol>(</Symbol><String>"EndChars"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"-()[]{}:;"</String><Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Symbol>::</Symbol><Normal Text>btw</Normal Text><Symbol>::</Symbol><br/>
<Commands>MsgBox</Commands><Normal Text> You typed "</Normal Text><String Char>``</String Char><Normal Text>btw</Normal Text><String Char>``</String Char><Normal Text>".</Normal Text><br/>
<Flow of control>return</Flow of control><br/>
<Normal Text></Normal Text><br/>
<Symbol>:*:</Symbol><Normal Text>]d</Normal Text><Symbol>::</Symbol><Normal Text> </Normal Text><Comment>; This hotstring replaces "]d" with the current date and time via the commands below.</Comment><br/>
<Normal Text></Normal Text><br/>
<Normal Text>MyFunction</Normal Text><Symbol>(</Symbol><Variables>FirstParameter</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Second</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Flow of control>ByRef</Flow of control><Normal Text> </Normal Text><Variables>Third</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Fourth</Variables><Symbol>:=</Symbol><String>""</String><Symbol>)</Symbol><br/>
<Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><String>"a value"</String><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Flow of control>Loop</Flow of control><Normal Text> </Normal Text><Decimal>3</Decimal><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><Variables>MyArray%A_Index%</Variables><br/>
<Normal Text></Normal Text><br/>
<Commands>SysGet</Commands><Symbol>,</Symbol><Normal Text> WA</Normal Text><Symbol>,</Symbol><Normal Text> MonitorWorkArea</Normal Text><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> Left: </Normal Text><Variables>%WALeft%</Variables><Normal Text> -- Top: </Normal Text><Variables>%WATop%</Variables><Normal Text> -- Right: </Normal Text><Variables>%WARight%</Variables><Normal Text> -- Bottom: </Normal Text><Variables>%WABottom%</Variables><Normal Text>.</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text>n </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Decimal>123</Decimal><Normal Text> </Normal Text><Decimal>00123</Decimal><Normal Text> </Normal Text><Symbol>-</Symbol><Float>1.</Float><Normal Text> </Normal Text><Hex>0x7B</Hex><Normal Text> </Normal Text><Hex>0x007B</Hex><Normal Text> </Normal Text><Symbol>-</Symbol><Hex>0x1</Hex><Normal Text> </Normal Text><Float>3.14159</Float><br/>
<Normal Text></Normal Text><br/>
<Commands>FileAppend</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Comment>; Comment.</Comment><br/>
<Comment>; Comment.</Comment><br/>
<Normal Text>( </Normal Text><Functions>LTrim</Functions><Normal Text> </Normal Text><Keywords>Join</Keywords><Normal Text> </Normal Text><Comment>; Comment.</Comment><br/>
<Normal Text> </Normal Text><Comment>; This is not a comment; it is literal. Include the word Comments in the line above to make it a comment.</Comment><br/>
<Normal Text>), C:\File.txt </Normal Text><Comment>; Comment.</Comment><br/>
<Normal Text></Normal Text><br/>
<Normal Text>param </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>%A_Index%</Variables><Normal Text> </Normal Text><Comment>; Fetch the contents of the variable whose name is contained in A_Index.</Comment><br/>
<Normal Text></Normal Text><br/>
<Keywords>Add</Keywords><Symbol>(</Symbol><Variables>X</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Y</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Z</Variables><Symbol>:=</Symbol><Decimal>0</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Variables>X</Variables><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Variables>Y</Variables><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Variables>Z</Variables><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keywords>Join</Keywords><Symbol>(</Symbol><Variables>sep</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>params</Variables><Symbol>*)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>for</Flow of control><Normal Text> </Normal Text><Variables>index</Variables><Symbol>,</Symbol><Variables>param</Variables><Normal Text> </Normal Text><Keywords>in</Keywords><Normal Text> </Normal Text><Variables>params</Variables><br/>
<Normal Text> str </Normal Text><Symbol>.=</Symbol><Normal Text> param . sep</Normal Text><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Functions>SubStr</Functions><Symbol>(</Symbol><Variables>str</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>-</Symbol><Functions>StrLen</Functions><Symbol>(</Symbol><Variables>sep</Variables><Symbol>))</Symbol><br/>
<Symbol>}</Symbol><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><Keywords>Join</Keywords><Symbol>(</Symbol><String>"</String><String Char>`n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"one"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"two"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"three"</String><Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>LogToFile</Normal Text><Symbol>(</Symbol><Variables>TextToLog</Variables><Symbol>)</Symbol><br/>
<Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>global</Flow of control><Normal Text> </Normal Text><Variables>LogFileName</Variables><Normal Text> </Normal Text><Comment>; This global variable was previously given a value somewhere outside this function.</Comment><br/>
<Normal Text> </Normal Text><Commands>FileAppend</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>%TextToLog%</Variables><String Char>`n</String Char><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>%LogFileName%</Variables><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>SetDefaults</Normal Text><Symbol>()</Symbol><br/>
<Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>global</Flow of control><br/>
<Normal Text> MyGlobal </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Decimal>33</Decimal><br/>
<Normal Text> </Normal Text><Flow of control>local</Flow of control><Normal Text> </Normal Text><Variables>x</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>y</Variables><Symbol>:=</Symbol><Decimal>0</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>z</Variables><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>LogToFile</Normal Text><Symbol>(</Symbol><Variables>TextToLog</Variables><Symbol>)</Symbol><br/>
<Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>static</Flow of control><Normal Text> </Normal Text><Variables>LoggedLines</Variables><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Decimal>0</Decimal><br/>
<Normal Text> LoggedLines </Normal Text><Symbol>+=</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><br/>
<Normal Text> </Normal Text><Flow of control>global</Flow of control><Normal Text> </Normal Text><Variables>LogFileName</Variables><br/>
<Normal Text> </Normal Text><Commands>FileAppend</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>%LoggedLines%</Variables><Normal Text>: </Normal Text><Variables>%TextToLog%</Variables><String Char>`n</String Char><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>%LogFileName%</Variables><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>GetFromStaticArray</Normal Text><Symbol>(</Symbol><Variables>WhichItemNumber</Variables><Symbol>)</Symbol><br/>
<Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>static</Flow of control><br/>
<Normal Text> </Normal Text><Flow of control>static</Flow of control><Normal Text> </Normal Text><Variables>FirstCallToUs</Variables><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>true</Variables><br/>
<Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>FirstCallToUs</Variables><br/>
<Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> FirstCallToUs </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>false</Variables><br/>
<Normal Text> </Normal Text><Flow of control>Loop</Flow of control><Normal Text> </Normal Text><Decimal>10</Decimal><br/>
<Normal Text> StaticArray</Normal Text><Variables>%A_Index%</Variables><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"Value #"</String><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text> </Normal Text><Variables>A_Index</Variables><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Variables>StaticArray%WhichItemNumber%</Variables><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>ColorName</Variables><Normal Text> </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><String>""</String><Normal Text> </Normal Text><Keywords>AND</Keywords><Normal Text> </Normal Text><Keywords>not</Keywords><Normal Text> </Normal Text><Variables>FindColor</Variables><Symbol>(</Symbol><Variables>ColorName</Variables><Symbol>))</Symbol><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Normal Text> </Normal Text><Variables>%ColorName%</Variables><Normal Text> could not be found.</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keywords>class</Keywords><Normal Text> baseObject </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>static</Flow of control><Normal Text> </Normal Text><Variables>foo</Variables><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"bar"</String><br/>
<Normal Text>}</Normal Text><br/>
<Normal Text>baseObject </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Variables>foo</Variables><Symbol>:</Symbol><Normal Text> </Normal Text><String>"bar"</String><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>thing </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>{}</Symbol><br/>
<Normal Text>thing</Normal Text><Symbol>.</Symbol><Normal Text>foo </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"bar"</String><br/>
<Normal Text>thing</Normal Text><Symbol>.</Symbol><Normal Text>test </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Functions>Func</Functions><Symbol>(</Symbol><String>"thing_test"</String><Symbol>)</Symbol><br/>
<Normal Text>thing</Normal Text><Symbol>.</Symbol><Normal Text>test</Normal Text><Symbol>()</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>thing_test</Normal Text><Symbol>(</Symbol><Keywords>this</Keywords><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><Keywords>this</Keywords><Symbol>.</Symbol><Variables>foo</Variables><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keywords>class</Keywords><Normal Text> Color</Normal Text><br/>
<Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Keywords>__New</Keywords><Symbol>(</Symbol><Variables>aRGB</Variables><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Keywords>this</Keywords><Symbol>.</Symbol><Normal Text>RGB </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>aRGB</Variables><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text> </Normal Text><Keywords>__Delete</Keywords><Symbol>()</Symbol><br/>
<Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><String>"Delete Color."</String><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text> </Normal Text><Flow of control>static</Flow of control><Normal Text> </Normal Text><Keys and buttons>Shift</Keys and buttons><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Variables>R</Variables><Symbol>:</Symbol><Decimal>16</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>G</Variables><Symbol>:</Symbol><Decimal>8</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>B</Variables><Symbol>:</Symbol><Decimal>0</Decimal><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text> </Normal Text><Keywords>__Get</Keywords><Symbol>(</Symbol><Variables>aName</Variables><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Comment>; </Comment><Alert Level 3>NOTE</Alert Level 3><Comment>: Using this.Shift here would cause an infinite loop!</Comment><br/>
<Normal Text> shift </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Keywords>Color</Keywords><Symbol>.</Symbol><Keys and buttons>Shift</Keys and buttons><Symbol>[</Symbol><Variables>aName</Variables><Symbol>]</Symbol><Normal Text> </Normal Text><Comment>; Get the number of bits to shift.</Comment><br/>
<Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Keys and buttons>shift</Keys and buttons><Normal Text> </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><String>""</String><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; Is it a known property?</Comment><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Keywords>this</Keywords><Symbol>.</Symbol><Keywords>RGB</Keywords><Normal Text> </Normal Text><Symbol>>></Symbol><Normal Text> </Normal Text><Keys and buttons>shift</Keys and buttons><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text> </Normal Text><Hex>0xff</Hex><br/>
<Normal Text> </Normal Text><Comment>; </Comment><Alert Level 3>NOTE</Alert Level 3><Comment>: Using 'return' here would break this.RGB.</Comment><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text> </Normal Text><Keywords>__Set</Keywords><Symbol>(</Symbol><Variables>aName</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>aValue</Variables><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>((</Symbol><Keys and buttons>shift</Keys and buttons><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Keywords>Color</Keywords><Symbol>.</Symbol><Keys and buttons>Shift</Keys and buttons><Symbol>[</Symbol><Variables>aName</Variables><Symbol>])</Symbol><Normal Text> </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><String>""</String><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> aValue </Normal Text><Symbol>&=</Symbol><Normal Text> </Normal Text><Decimal>255</Decimal><Normal Text> </Normal Text><Comment>; Truncate it to the proper range.</Comment><br/>
<Normal Text></Normal Text><br/>
<Normal Text> </Normal Text><Comment>; Calculate and store the new RGB value.</Comment><br/>
<Normal Text> </Normal Text><Keywords>this</Keywords><Symbol>.</Symbol><Normal Text>RGB </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>aValue</Variables><Normal Text> </Normal Text><Symbol><<</Symbol><Normal Text> </Normal Text><Keys and buttons>shift</Keys and buttons><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>|</Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Keywords>this</Keywords><Symbol>.</Symbol><Keywords>RGB</Keywords><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text> </Normal Text><Symbol>~(</Symbol><Hex>0xff</Hex><Normal Text> </Normal Text><Symbol><<</Symbol><Normal Text> </Normal Text><Keys and buttons>shift</Keys and buttons><Symbol>))</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text> </Normal Text><Comment>; 'Return' must be used to indicate a new key-value pair should not be created.</Comment><br/>
<Normal Text> </Normal Text><Comment>; This also defines what will be stored in the 'x' in 'x := clr[name] := val':</Comment><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Variables>aValue</Variables><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text> </Normal Text><Comment>; </Comment><Alert Level 3>NOTE</Alert Level 3><Comment>: Using 'return' here would break this.stored_RGB and this.RGB.</Comment><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text> </Normal Text><Comment>; Meta-functions can be mixed with properties:</Comment><br/>
<Normal Text> </Normal Text><Keywords>RGB</Keywords><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Keywords>get</Keywords><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Comment>; Return it in hex format:</Comment><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Functions>format</Functions><Symbol>(</Symbol><String>"0x{:06x}"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Keywords>this</Keywords><Symbol>.</Symbol><Variables>stored_RGB</Variables><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text> </Normal Text><Keywords>set</Keywords><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Keywords>this</Keywords><Symbol>.</Symbol><Variables>stored_RGB</Variables><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>value</Variables><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text> </Normal Text><Keywords>class</Keywords><Normal Text> __Get extends Properties</Normal Text><br/>
<Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> R</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Keywords>this</Keywords><Symbol>.</Symbol><Keywords>RGB</Keywords><Normal Text> </Normal Text><Symbol>>></Symbol><Normal Text> </Normal Text><Decimal>16</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text> </Normal Text><Decimal>255</Decimal><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text> G</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Keywords>this</Keywords><Symbol>.</Symbol><Keywords>RGB</Keywords><Normal Text> </Normal Text><Symbol>>></Symbol><Normal Text> </Normal Text><Decimal>8</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text> </Normal Text><Decimal>255</Decimal><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text> B</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Keywords>this</Keywords><Symbol>.</Symbol><Keywords>RGB</Keywords><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text> </Normal Text><Decimal>255</Decimal><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text> </Normal Text><Keywords>Property</Keywords><Symbol>[]</Symbol><Normal Text> </Normal Text><Comment>; Brackets are optional</Comment><br/>
<Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Keywords>get</Keywords><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Symbol>...</Symbol><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text> </Normal Text><Keywords>set</Keywords><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Symbol>...</Symbol><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Variables>value</Variables><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keywords>class</Keywords><Normal Text> Properties extends FunctionObject</Normal Text><br/>
<Symbol>{</Symbol><br/>
<Normal Text> Call</Normal Text><Symbol>(</Symbol><Variables>aTarget</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>aName</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>aParams</Variables><Symbol>*)</Symbol><br/>
<Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Comment>; If this Properties object contains a definition for this half-property, call it.</Comment><br/>
<Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Functions>ObjHasKey</Functions><Symbol>(</Symbol><Keywords>this</Keywords><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>aName</Variables><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Keywords>this</Keywords><Symbol>[</Symbol><Variables>aName</Variables><Symbol>].</Symbol><Variables>Call</Variables><Symbol>(</Symbol><Variables>aTarget</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>aParams</Variables><Symbol>*)</Symbol><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>MyGet</Normal Text><Symbol>(</Symbol><Keywords>this</Keywords><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Key</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Key2</Variables><Symbol>)</Symbol><br/>
<Normal Text>MySet</Normal Text><Symbol>(</Symbol><Keywords>this</Keywords><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Key</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Key2</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Value</Variables><Symbol>)</Symbol><br/>
<Normal Text>MyCall</Normal Text><Symbol>(</Symbol><Keywords>this</Keywords><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Name</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>Params</Variables><Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>ClassName </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Normal Text> </Normal Text><Keywords>__Get</Keywords><Symbol>:</Symbol><Normal Text> </Normal Text><Functions>Func</Functions><Symbol>(</Symbol><String>"MyGet"</String><Symbol>),</Symbol><Normal Text> </Normal Text><Keywords>__Set</Keywords><Symbol>:</Symbol><Normal Text> </Normal Text><Functions>Func</Functions><Symbol>(</Symbol><String>"MySet"</String><Symbol>),</Symbol><Normal Text> </Normal Text><Keywords>__Call</Keywords><Symbol>:</Symbol><Normal Text> </Normal Text><Functions>Func</Functions><Symbol>(</Symbol><String>"MyCall"</String><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>red </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Keywords>new</Keywords><Normal Text> </Normal Text><Keywords>Color</Keywords><Symbol>(</Symbol><Hex>0xff0000</Hex><Symbol>),</Symbol><Normal Text> red</Normal Text><Symbol>.</Symbol><Normal Text>R </Normal Text><Symbol>-=</Symbol><Normal Text> </Normal Text><Decimal>5</Decimal><br/>
<Normal Text>cyan </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Keywords>new</Keywords><Normal Text> </Normal Text><Keywords>Color</Keywords><Symbol>(</Symbol><Decimal>0</Decimal><Symbol>),</Symbol><Normal Text> cyan</Normal Text><Symbol>.</Symbol><Normal Text>G </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Decimal>255</Decimal><Symbol>,</Symbol><Normal Text> cyan</Normal Text><Symbol>.</Symbol><Normal Text>B </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Decimal>255</Decimal><br/>
<Normal Text></Normal Text><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><String>"red: "</String><Normal Text> </Normal Text><Variables>red</Variables><Symbol>.</Symbol><Variables>R</Variables><Normal Text> </Normal Text><String>","</String><Normal Text> </Normal Text><Variables>red</Variables><Symbol>.</Symbol><Variables>G</Variables><Normal Text> </Normal Text><String>","</String><Normal Text> </Normal Text><Variables>red</Variables><Symbol>.</Symbol><Variables>B</Variables><Normal Text> </Normal Text><String>" = "</String><Normal Text> </Normal Text><Variables>red</Variables><Symbol>.</Symbol><Keywords>RGB</Keywords><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><String>"cyan: "</String><Normal Text> </Normal Text><Variables>cyan</Variables><Symbol>.</Symbol><Variables>R</Variables><Normal Text> </Normal Text><String>","</String><Normal Text> </Normal Text><Variables>cyan</Variables><Symbol>.</Symbol><Variables>G</Variables><Normal Text> </Normal Text><String>","</String><Normal Text> </Normal Text><Variables>cyan</Variables><Symbol>.</Symbol><Variables>B</Variables><Normal Text> </Normal Text><String>" = "</String><Normal Text> </Normal Text><Variables>cyan</Variables><Symbol>.</Symbol><Keywords>RGB</Keywords><br/>
<Normal Text></Normal Text><br/>
<Comment>; This example requires the FunctionObject class in order to work.</Comment><br/>
<Normal Text>blue </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Keywords>new</Keywords><Normal Text> </Normal Text><Keywords>Color</Keywords><Symbol>(</Symbol><Hex>0x0000ff</Hex><Symbol>)</Symbol><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><Variables>blue</Variables><Symbol>.</Symbol><Variables>R</Variables><Normal Text> </Normal Text><String>","</String><Normal Text> </Normal Text><Variables>blue</Variables><Symbol>.</Symbol><Variables>G</Variables><Normal Text> </Normal Text><String>","</String><Normal Text> </Normal Text><Variables>blue</Variables><Symbol>.</Symbol><Variables>B</Variables><br/>
<Normal Text></Normal Text><br/>
<Normal Text>x </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Keywords>base</Keywords><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Variables>addr</Variables><Symbol>:</Symbol><Normal Text> </Normal Text><Functions>Func</Functions><Symbol>(</Symbol><String>"x_Addr"</String><Symbol>),</Symbol><Normal Text> </Normal Text><Keywords>__Set</Keywords><Symbol>:</Symbol><Normal Text> </Normal Text><Functions>Func</Functions><Symbol>(</Symbol><String>"x_Setter"</String><Symbol>)}}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>; Assign value, implicitly calling x_Setter to create sub-objects.</Comment><br/>
<Normal Text>x</Normal Text><Symbol>[</Symbol><Decimal>1</Decimal><Symbol>,</Symbol><Decimal>2</Decimal><Symbol>,</Symbol><Decimal>3</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>"..."</String><br/>
<Normal Text></Normal Text><br/>
<Comment>; Retrieve value and call example method.</Comment><br/>
<Commands>MsgBox</Commands><Normal Text> </Normal Text><Symbol>% </Symbol><Variables>x</Variables><Symbol>[</Symbol><Decimal>1</Decimal><Symbol>,</Symbol><Decimal>2</Decimal><Symbol>,</Symbol><Decimal>3</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><String>"</String><String Char>`n</String Char><String>"</String><Normal Text> </Normal Text><Variables>x</Variables><Symbol>.</Symbol><Variables>addr</Variables><Symbol>()</Symbol><Normal Text> </Normal Text><String>"</String><String Char>`n</String Char><String>"</String><Normal Text> </Normal Text><Variables>x</Variables><Symbol>[</Symbol><Decimal>1</Decimal><Symbol>].</Symbol><Variables>addr</Variables><Symbol>()</Symbol><Normal Text> </Normal Text><String>"</String><String Char>`n</String Char><String>"</String><Normal Text> </Normal Text><Variables>x</Variables><Symbol>[</Symbol><Decimal>1</Decimal><Symbol>,</Symbol><Decimal>2</Decimal><Symbol>].</Symbol><Variables>addr</Variables><Symbol>()</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>x_Setter</Normal Text><Symbol>(</Symbol><Variables>x</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>p1</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>p2</Variables><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>p3</Variables><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> x</Normal Text><Symbol>[</Symbol><Variables>p1</Variables><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><Keywords>new</Keywords><Normal Text> </Normal Text><Variables>x</Variables><Symbol>.</Symbol><Keywords>base</Keywords><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>x_Addr</Normal Text><Symbol>(</Symbol><Variables>x</Variables><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Symbol>&</Symbol><Variables>x</Variables><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Commands>InputBox</Commands><Symbol>,</Symbol><Normal Text> OutputVar</Normal Text><Symbol>,</Symbol><Normal Text> Question 1</Normal Text><Symbol>,</Symbol><Normal Text> What is your first name?</Normal Text><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>OutputVar</Variables><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"Bill"</String><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> That's an awesome name</Normal Text><String Char>`,</String Char><Normal Text> </Normal Text><Variables>%OutputVar%</Variables><Normal Text>.</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Commands>InputBox</Commands><Symbol>,</Symbol><Normal Text> OutputVar2</Normal Text><Symbol>,</Symbol><Normal Text> Question 2</Normal Text><Symbol>,</Symbol><Normal Text> Do you like AutoHotkey?</Normal Text><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>OutputVar2</Variables><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"yes"</String><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> Thank you for answering </Normal Text><Variables>%OutputVar2%</Variables><String Char>`,</String Char><Normal Text> </Normal Text><Variables>%OutputVar%</Variables><Keys and buttons>!</Keys and buttons><Normal Text> We will become great friends.</Normal Text><br/>
<Flow of control>else</Flow of control><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>%OutputVar%</Variables><String Char>`,</String Char><Normal Text> That makes me sad.</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> 4</Normal Text><Symbol>,,</Symbol><Normal Text> Would you like to continue?</Normal Text><br/>
<Flow of control>IfMsgBox</Flow of control><Symbol>,</Symbol><Normal Text> </Normal Text><Keywords>No</Keywords><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><Normal Text> </Normal Text><Comment>; If No, stop the code from going further.</Comment><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> You pressed YES. </Normal Text><Comment>; Otherwise, the user picked yes.</Comment><br/>
<Normal Text></Normal Text><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>car</Variables><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"old"</String><Symbol>)</Symbol><br/>
<Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> The car is really old.</Normal Text><br/>
<Normal Text> </Normal Text><Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>wheels</Variables><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"flat"</String><Symbol>)</Symbol><br/>
<Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> This car is not safe to drive.</Normal Text><br/>
<Normal Text> </Normal Text><Flow of control>return</Flow of control><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text> </Normal Text><Flow of control>else</Flow of control><br/>
<Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> Be careful</Normal Text><Keys and buttons>!</Keys and buttons><Normal Text> This old car will be dangerous to drive.</Normal Text><br/>
<Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Flow of control>else</Flow of control><br/>
<Symbol>{</Symbol><br/>
<Normal Text> </Normal Text><Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> My</Normal Text><String Char>`,</String Char><Normal Text> what a shiny new vehicle you have there.</Normal Text><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Keywords>Color</Keywords><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"Red"</String><Normal Text> </Normal Text><Keywords>or</Keywords><Normal Text> </Normal Text><Keywords>Color</Keywords><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"Green"</String><Normal Text> </Normal Text><Keywords>or</Keywords><Normal Text> </Normal Text><Keywords>Color</Keywords><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"Blue"</String><Normal Text> </Normal Text><Comment>; Comment.</Comment><br/>
<Normal Text> </Normal Text><Keywords>or</Keywords><Normal Text> </Normal Text><Keywords>Color</Keywords><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"Black"</String><Normal Text> </Normal Text><Keywords>or</Keywords><Normal Text> </Normal Text><Keywords>Color</Keywords><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"Gray"</String><Normal Text> </Normal Text><Keywords>or</Keywords><Normal Text> </Normal Text><Keywords>Color</Keywords><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"White"</String><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; Comment.</Comment><br/>
<Normal Text> </Normal Text><Keywords>and</Keywords><Normal Text> ProductIsAvailableInColor(Product</Normal Text><Symbol>,</Symbol><Normal Text> Color</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Comment>; Comment.</Comment><br/>
<Normal Text></Normal Text><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Symbol>(</Symbol><Variables>codepage</Variables><Normal Text> </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><String>""</String><Symbol>)</Symbol><br/>
<Normal Text> codepage </Normal Text><Symbol>:=</Symbol><Normal Text> </Normal Text><String>" /CP"</String><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text> </Normal Text><Variables>codepage</Variables><br/>
<Normal Text>cmd</Normal Text><Symbol>=</Symbol><Normal Text>"</Normal Text><Variables>%A_AhkPath%</Variables><Normal Text>"</Normal Text><Variables>%codepage%</Variables><Normal Text> "</Normal Text><String Char>`%</String Char><Normal Text>1" </Normal Text><String Char>`%</String Char><Keys and buttons>*</Keys and buttons><br/>
<Normal Text>key</Normal Text><Symbol>=</Symbol><Normal Text>AutoHotkeyScript\Shell\Open\Command</Normal Text><br/>
<Flow of control>if</Flow of control><Normal Text> </Normal Text><Variables>A_IsAdmin</Variables><Normal Text> </Normal Text><Comment>; Set for all users.</Comment><br/>
<Normal Text> </Normal Text><Commands>RegWrite</Commands><Symbol>,</Symbol><Normal Text> REG_SZ</Normal Text><Symbol>,</Symbol><Normal Text> HKCR</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><Variables>%key%</Variables><Symbol>,,</Symbol><Normal Text> </Normal Text><Variables>%cmd%</Variables><br/>
<Flow of control>else</Flow of control><Normal Text> </Normal Text><Comment>; Set for current user only.</Comment><br/>
<Normal Text> </Normal Text><Commands>RegWrite</Commands><Symbol>,</Symbol><Normal Text> REG_SZ</Normal Text><Symbol>,</Symbol><Normal Text> HKCU</Normal Text><Symbol>,</Symbol><Normal Text> Software\Classes\</Normal Text><Variables>%key%</Variables><Symbol>,,</Symbol><Normal Text> </Normal Text><Variables>%cmd%</Variables><br/>
<Normal Text></Normal Text><br/>
<Keys and buttons>^j</Keys and buttons><Symbol>::</Symbol><Normal Text> </Normal Text><Comment>; hotkey label</Comment><br/>
<Commands>MsgBox</Commands><Symbol>,</Symbol><Normal Text> You typed btw.</Normal Text><br/>
|