local (addr = @examples.age);
x = addr^
» 46
This simple example shows how the dereference operator extracts the value of the address, in this case the address of the "age" cell in the "examples" table.
on triple (addrN)
addrN^ = addrN^ * 3
triple (@examples.age)
Type this script into a script window. In this example, the local script "triple" multiplies by three the value whose address is passed to it.
The example below demonstrates a more straightforward method of accomplishing the same thing, but it is interesting see how the @ and ^ operators work together here.
on triple (n)
return (n * 3)
examples.age = triple (examples.age)
typeOf (window.frontmost ()^) == tableType
» true
Here, the value returned by window.frontmost - a string - is treated as a database address, and the type of the value at that address is compared to tableType. If the frontmost window contains a table, the result of the expression will be true.