Tuesday, September 19, 2017

#1 2005-10-13 03:14:44 pm

julifos
Administrator
From:: Malasaña, Madrid
Registered: 2002-11-20
Posts: 2014

What is a "record"?

A record is a collection of keys and values. You access such values invoking its keys (or labels):

Applescript:

set theRecord to {a:1, b:"string", c:{1, 2, 3}, d:{a:1, b:2}}

tell theRecord
   its a --> a number: 1
   b of it --> a string: "string"
end tell

c of theRecord --> a list: {1,2,3}
theRecord's d --> a record: {a:1, b:2}

Keys can be also properties defined by developers:

Applescript:

display dialog "Hello!" giving up after 5
--> {button returned:"OK", gave up:false}

Here we get some info after we display a dialog: the button pressed by the user (if any) and if it was gave up.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)