PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 1ms

/IronAHK/Site/docs/autohotkey/index.html

http://github.com/polyethene/IronAHK
HTML | 44 lines | 44 code | 0 blank | 0 comment | 0 complexity | 99a37a9b5674825cde7dee5f9542f728 MD5 | raw file
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>AutoHotkey</title>
  6. <link href="../primary.css" rel="stylesheet" type="text/css" />
  7. <script type="text/javascript" src="../main.js" defer="defer"></script>
  8. </head>
  9. <body>
  10. <h1>AutoHotkey</h1>
  11. <div id="page">
  12. <p>While scripts will function identically to AutoHotkey in almost all cases there are several underlying changes and enhancements.</p>
  13. <h2 id="syntax">Syntax</h2>
  14. <p>The script compiler automatically makes the following conversions to ease transition from AutoHotkey:</p>
  15. <ul>
  16. <li id="accessors"><em id="accessors">Set</em> commands such as <code>SetKeyDelay</code>, <code>AutoTrim</code> and <code>DetectHiddenWindows</code> have been replaced with accessors to their respective <code>A_</code> variables, i.e. <code>SetWorkingDir, %A_Temp%</code> is translated to <code>A_WorkingDir = %A_Temp%</code>;</li>
  17. <li id="ifs"><em>If</em> commands are replaced by the equivalent if-statements, e.g. <code>IfGreater, var, 10</code> becomes <code>if var &gt; 10</code>. This includes <code>IfMsgBox</code>, <code>IfInString</code>, <code>IfWinActive</code> and others;</li>
  18. <li id="strings"><a href="../commands/instr/"><code>InStr</code></a> and <a href="../commands/substr/"><code>SubStr</code></a> are used in place of older string commands like <code>StringLeft</code> and <code>StringTrimRight</code>;</li>
  19. <li id="repeat"><code>Repeat</code> is converted to <a href="../commands/loop/"><code>Loop</code></a>;</li>
  20. <li id="debugging"><code>Edit</code>, <code>ListHotkeys</code>, <code>ListLines</code> and <code>ListVars</code> will do nothing until a future version which has improved debugging support.</li>
  21. </ul>
  22. <p>In future versions these conversions will be disabled, resulting in compiler errors.</p>
  23. <h3>New Features</h3>
  24. <p id="null">Setting a variable to <code>null</code> will <a href="../syntax/variable/#delete">delete</a> it.</p>
  25. <p id="is">The <code>is</code> keyword has become an expression operator to compare types. </p>
  26. <p id="json"><a href="../syntax/variable/#object">Objects</a> (associative arrays) and regular <a href="../syntax/variable/#array">arrays</a> can be defined with <a href="http://www.json.org/">JSON</a>. Consequently, the symbols <code>[</code> and <code>]</code> can no longer be used in variable names.</p>
  27. <p id="parent"> <code>break</code> and <code>continue</code> now have a parameter to indicate which parent loop block should be used.</p>
  28. <p id="each">An each-loop can be used to enumerate objects and arrays with variables <code>A_LoopKey</code> and <code>A_LoopField</code>. Strings can be accessed this way by every character.</p>
  29. <p id="delegates">Function names can be used as variables to refer to their pointers (delegates). Any object can be invoked as a late-bound function.</p>
  30. <h2>Commands</h2>
  31. <h3>New Functions</h3>
  32. <ul>
  33. <li><a href="../commands/#security">Security</a>: encryption, decryption, calculating hashes and generating secure random numbers.</li>
  34. <li><a href="../commands/#network">Network</a>: resolve host name to IP address (including reverse lookup) and send an email.</li>
  35. </ul>
  36. <h2 id="security">Security</h2>
  37. <p>When scripts are <a href="../overview/compiling/">compiled</a> the source code is not attached to the binary file so it cannot be decompiled. This is unlike AutoHotkey which stores a full copy of the script with the compiled .exe which can be extracted and decrypted or read from process memory when it is executed. </p>
  38. <h2 id="portability">Portability</h2>
  39. <p>Scripts will run the same natively on all operating systems and architectures (32 or 64 bit) with a .NET compatible runtime such as <a href="http://www.go-mono.com/">Mono</a>. Almost every version of Windows from XP onwards and most recent Linux desktop distributions have this installed by default.</p>
  40. <h2 id="unicode">Encoding</h2>
  41. <p>Source files are read as Unicode text. This is the same for all strings, hotkeys and hotstrings in a script.</p>
  42. </div>
  43. </body>
  44. </html>