@

Syntax @identifier

Action Takes the address of identifier. The address can be used with the dereference operator (^) to refer back to the original object specified by identifier. Addresses provide a way to refer to Object Database cells rather than their contents. A script that

takes the address of an object as a parameter can change the contents of that database location, while a script that takes an object's value as a parameter works only with a copy of that value.

Examples name = "";
if dialog.ask ("What's your name?", @name) {msg (name)}
The built-in verb dialog.ask takes the address of a string as its second parameter. When passed the address of the local variable "name," dialog.ask is able to change its value.

saying = "A bird in the hand is worth two in the bush";
string.countWords (saying)

In this case, the built-in verb string.countWords doesn't need to be able to change the original string; it just wants to work with its value. Therefore, we don't use the address operator.

adr = @people [user.initials].notepad
if not defined (adr^)
new (outlineType, adr)

This advanced example shows how the dereference operator works in tandem with the address operator. First, we put the address of the location where the user's notepad outline usually exists into the variable adr. We then check to see if the object at that
address is defined - that is, if it actually exists. If not, we create an outline there using the new verb, which takes the database address as its second parameter.

Notes Strings that name database cells can be coerced to addresses with the address verb. So the value of address ("system.verbs") is equal to @system.verbs.

See Also ^

[ ]

address

local

on

Discuss