Skip to content

Commit

Permalink
fix more typos
Browse files Browse the repository at this point in the history
  • Loading branch information
maul.esel committed Sep 22, 2012
1 parent 40db148 commit 53b2a99
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion en/_posts/2011-10-29-Introduction.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ You can use AutoHotkey for game scripts, for quick macros, for tasks that take h
- [useful tools: TillaGoTo](Useful-Tools-TillaGoTo.html)
- [Variables, commands and function stuff](Variables-functions-commands.html)

- [the power of builtin variables](builtin-variables.html)
- [the power of built-in variables](builtin-variables.html)
- [Working with conditions](Working-with-conditions.html)
- [Basic User Interaction: MsgBox & Co.](Basic-user-interaction.html)
- [Repeating things](Repeating.html)
Expand Down
4 changes: 2 additions & 2 deletions en/_posts/2011-11-06-Labels.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ return ; goto will exit the script here
{% endhighlight %}

## Using labels
Besides the possibilities above, there are some ways to use labels with builtin functionality.
Besides the possibilities above, there are some ways to use labels with built-in functionality.

### OnExit
`OnExit` let's you specify a label name to which the script will jump to before it exits. You can put there some routines to clean up some memory, files or whatever your script used.
Expand All @@ -60,7 +60,7 @@ Also, there are some standard label names that are launched when a GUI closes et
If you add a label named <cite>OnClipboardChange</cite> to your script, it will be launched whenever the system clipboard changes. You can retrieve the contents and modify or react on them.

### IsLabel()
One more thing to mention is the builtin function `IsLabel()` which can be used to test if a given name (often a variable) is an existing label.
One more thing to mention is the built-in function `IsLabel()` which can be used to test if a given name (often a variable) is an existing label.
If you try to jump to a non-existing label, AutoHotkey will throw an error. In case you have a dynamic label name, you can use this function to avoid this error.

## spaghetti code
Expand Down
2 changes: 1 addition & 1 deletion en/_posts/2011-11-06-Lets-start.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ permalink: /en/Lets-start.html

# Let's start

Now we'll finally start to do some coding! We'll cover the most important areas that can be easily done using builtin features.
Now we'll finally start to do some coding! We'll cover the most important areas that can be easily done using built-in features.

The first thing we have to figure out is [what a script does on startup](auto-execute-section.html).
22 changes: 11 additions & 11 deletions en/_posts/2011-11-09-builtin-variables.markdown
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
---
title: The power of builtin variables
title: The power of built-in variables
layout: post
permalink: /en/builtin-variables.html
---

# The power of builtin variables
# The power of built-in variables

## What are builtin variables?
As the name says, builtin variables are builtin. Their content is not filled by the user but by AutoHotkey itself.
## What are built-in variables?
As the name says, built-in variables are built-in. Their content is not filled by the user but by AutoHotkey itself.
There are several differences with their handling:

* builtin variables are available *everywhere*, in the auto-execute section, any label and any user-defined function
* the content of a builtin variable can not be changed directly by the user (some exceptions listed below)
* all builtin variables begin with an `A_` prefix, except for `ErrorLevel`, `ComSpec` and `ProgramFiles` (which is also available as `A_ProgramFiles`)
* built-in variables are available *everywhere*, in the auto-execute section, any label and any user-defined function
* the content of a built-in variable can not be changed directly by the user (some exceptions listed below)
* all built-in variables begin with an `A_` prefix, except for `ErrorLevel`, `ComSpec` and `ProgramFiles` (which is also available as `A_ProgramFiles`)

**Note:** In AutoHotkey v2 and AutoHotkey\_H v2, the `ComSpec` and `ProgramFiles` variables are removed (and `A_ComSpec` is introduced).

### Setting the content
As noted above, you usually can't change the content of a builtin variable. There are 2 exceptions of that rule:
As noted above, you usually can't change the content of a built-in variable. There are 2 exceptions of that rule:

* `ErrorLevel` can be set
* IronAHK uses builtin variable assignment to replace some commands such as `SetWorkingDir C:\Any\Dir` by `A_WorkingDir := "C:\Any\Dir"`
* IronAHK uses built-in variable assignment to replace some commands such as `SetWorkingDir C:\Any\Dir` by `A_WorkingDir := "C:\Any\Dir"`

## Which variables are available?
There are way too much builtin variables to list them all here. The areas they cover reach from `A_Space` over script properties, date & time, script settings, user idle time, GUI variables, OS info up to things like `A_LastHotkey`.
There are way too much built-in variables to list them all here. The areas they cover reach from `A_Space` over script properties, date & time, script settings, user idle time, GUI variables, OS info up to things like `A_LastHotkey`.

A list of them can be found in the respective manual. Online links:
* [AutoHotkey classic](http://www.autohotkey.com/docs/Variables.htm#BuiltIn)
* [AutoHotkey\_L](http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/Variables.htm#BuiltIn)

## booleans
Additionally to those listed in the links above, AutoHotkey has the builtin variables (or constants) **true** and **false**. IronAHK also introduces **null**.
Additionally to those listed in the links above, AutoHotkey has the built-in variables (or constants) **true** and **false**. IronAHK also introduces **null**.
2 changes: 1 addition & 1 deletion en/_posts/2011-11-10-Basic-user-interaction.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ IfMsgBox Cancel
As with any `if` statement, you use curly braces ({ and }) to enclose larger blocks here, and you can put an `else` below it.

### Getting the user's decision \#2
In AutoHotkey v2 and AutoHotkey\_H v2, this statement is removed. You must use a regular `if` statement and compare against the builtin variable `A_MsgBoxResult`.
In AutoHotkey v2 and AutoHotkey\_H v2, this statement is removed. You must use a regular `if` statement and compare against the built-in variable `A_MsgBoxResult`.

### Getting the user's decision \#3
\[missing: info on IronAHK\]
Expand Down
2 changes: 1 addition & 1 deletion en/_posts/2011-11-12-Repeating.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Loop
MsgBox Loop iteration %A_Index%
}
{% endhighlight %}
As you see above, the builtin-variable `A_Index` contains the current iteration count. If you just want to repeat one line, yu can leave out the braces.
As you see above, the built-in variable `A_Index` contains the current iteration count. If you just want to repeat one line, you can leave out the braces.

As the above may consume a lot of memory, you may want it to wait some time before the next iteration:
{% highlight ahk linenos %}; any AutoHotkey version
Expand Down
4 changes: 2 additions & 2 deletions en/_posts/2011-11-12-Structures.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ DllCall("MulDiv","UInt",TheAddressOfTheString,"UInt",1,"UInt",1,"Str")
The two functions have also been backported to older versions of AutoHotkey, and are available as [libraries](http://www.autohotkey.com/forum/topic59738.html).

### structure library
The AutoHotkey library [Struct](http://www.autohotkey.com/forum/topic59581.html), by HotkeyIt, allows simple and intuitive creation of structures without difficult offset or type calculations. Given an initial structure description, it creates an object that allows access of structure members with the builtin object access syntax. Recommended if there are a lot of structs to manage and the performance drop is acceptable.
The AutoHotkey library [Struct](http://www.autohotkey.com/forum/topic59581.html), by HotkeyIt, allows simple and intuitive creation of structures without difficult offset or type calculations. Given an initial structure description, it creates an object that allows access of structure members with the built-in object access syntax. Recommended if there are a lot of structs to manage and the performance drop is acceptable.

## summary
* Structures are sections of memory filled with structured data.
* Members are specific independant parts in the data.
* Members are accessed by their type and offset.
* Each type almost always needs to be mapped to an AutoHotkey builtin type to be used.
* Each type almost always needs to be mapped to an AutoHotkey built-in type to be used.
* AutoHotkey functions that are useful when working with structures are `VarSetCapacity()`, `NumPut()`, and `NumGet()`.

## example
Expand Down
6 changes: 3 additions & 3 deletions en/_posts/2011-11-24-DllCalls.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ permalink: /en/DllCalls.html

# Accessing Windows API
## API
**API** is an abbreviation for <cite>application programmer interface</cite>. This means it is a way to access another app, a web service, an OS, a library etc. from your code. It does not specify *how* to do this: APIs can be based on HTTPRequests \(e.g. web services\), exchanging text files, window messages, DLLs \(dynamic link libraries\), which will be covered in this chapter, or COM \(which will be covered later\). So the way we're looking at here does of course not work for all APIs.
**API** is an abbreviation for <cite>application programming interface</cite>. This means it is a way to access another app, a web service, an OS, a library etc. from your code. It does not specify *how* to do this: APIs can be based on HTTPRequests \(e.g. web services\), exchanging text files, window messages, DLLs \(dynamic link libraries\), which will be covered in this chapter, or COM \(which will be covered later\). So the way we're looking at here does of course not work for all APIs.

### Accessing DLLs
The way we look at here does not only work for Windows, but for a lot of other code packaged in a DLL. Custom Gui controls often use this. But it is important to know you can't even cover all of them: the DLLs must be native code (e.g. not a .NET library), and it must be organized in *functions* (not *classes*).

## Using the Windows builtin `MessageBox` function
## Using the Windows built-in `MessageBox` function
As you know, AutoHotkey has the `MsgBox` command. So actually theres no **need** for calling the Windows API function most of the time. But we're doing so because it's a good example.

**Note:** This is, of course, Windows-only code. So it will not work for IronAHK users on other systems.
Expand All @@ -30,7 +30,7 @@ Then we see a <cite>Syntax</cite> box:
__in UINT uType
);

We can't use this as it's not AutoHotkey code. In AutoHotkey, to call a function in a DLL, we use the builtin `DllCall()` function. As the manual tells us, it's first parameter is the DLL file and the function to call.
We can't use this as it's not AutoHotkey code. In AutoHotkey, to call a function in a DLL, we use the built-in `DllCall()` function. As the manual tells us, it's first parameter is the DLL file and the function to call.

In case of the MessageBox function, we needn't specify the DLL file:
> DllFile may be omitted when calling a function that resides in User32.dll, Kernel32.dll, ComCtl32.dll, or Gdi32.dll.
Expand Down

0 comments on commit 53b2a99

Please sign in to comment.