File: tags.md

package info (click to toggle)
surgescript 0.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,200 kB
  • sloc: ansic: 15,748; sh: 61; javascript: 38; makefile: 13
file content (66 lines) | stat: -rw-r--r-- 1,384 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
TagSystem
=========

Utility functions for dealing with object tags. This object is available at `System.tags` and shouldn't be instantiated directly.

Functions
---------

#### list

`list()`

Lists all tags used in all objects.

*Returns*

A new [Array](/reference/array) of strings with all tags used in all objects.

#### select

`select(tagName)`

Selects all objects that are tagged `tagName`.

*Arguments*

* `tagName`: string.

*Returns*

A new [Array](/reference/array) of strings with the names of the objects tagged with `tagName`. If there are no such objects, an empty array is returned.

#### tagsOf

`tagsOf(objectName)`

Returns the tags of the objects named `objectName`.

*Available since:* SurgeScript 0.6.0

*Arguments*

* `objectName`: string.

*Returns*

A new [Array](/reference/array) of strings with the names of the tags associated with the objects named `objectName`. If the objects are untagged or do not exist, an empty array is returned.

#### hasTag

`hasTag(objectName, tagName)`

Checks if objects named `objectName` are tagged `tagName`. Prefer using [Object.hasTag()](/reference/object#hastag) if possible.

See also: [Object.hasTag()](/reference/object#hastag).

*Available since:* SurgeScript 0.6.0

*Arguments*

* `objectName`: string.
* `tagName`: string.

*Returns*

Returns `true` if the objects are tagged as specified, or `false` otherwise.