Name: number

Type: function

Syntax: the number of [card|cd|background|bkgnd|bg] {<objectType> | parts | controls}

Syntax: the number of {<objectType> | parts | controls} [{in | of} <group>]

Syntax: the number of {backgrounds | groups} [ [{in | of} <card>] {in | of} <stack>]

Syntax: the number of [marked] cards [{in | of} <stack>]

Syntax: the number of {char[acters] | items | words | lines} {in | of} <string> 

Summary: <return|Returns> the number of <object|objects> of a certain kind, or the number of <chunk|chunks> in a <string>.

Synonyms: num

Introduced: 1.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
repeat for the number of words in inputString

Example:
if the number of card buttons &gt; 0 then doTheButtons

Parameters:
objectType: One of buttons (or btns), fields (or flds), images, graphics (or grcs), players, scrollbars, EPSs, audioClips, videoClips, groups, backgrounds, or cards.
group: A reference to any group in the current stack.
card: 
stack: Any stack reference.
string (string): Any string or expression that evaluates to a string.

Returns: The <number> <function> <return|returns> a <non-negative> <integer>.

Description:
Use the <number> <function> to find out how many of a thing there are.

If you use the form the number of card controls, the <number> <function> returns the number of <control|controls> on the <current card> that are not members of a <group(command)>. The form the number of background controls returns the number of grouped controls that are in a <group(command)> whose <backgroundBehavior> <property> is set to true.

The expression
  the number of chars in <string> 
is equivalent to
  the length of <string> 

The expression the number of backgrounds of <stack> <return|returns> the number of <group(glossary)|groups> in the <stack>. The <expression> the number of groups of <stack> returns the number of groups on the <current card> of the <stack>. <group(glossary)|groups> that are <nest|nested> inside another <group(command)> are not counted.

>*Note:* The <number> is implemented as a <read-only> <global> <property>, but can be more conveniently thought of as a <function>.

References: backgroundBehavior (property), layer (property), function (control_st), string (keyword), control (keyword), integer (keyword), property (glossary), current card (glossary), return (glossary), group (glossary), nest (glossary), chunk (glossary), read-only (glossary), expression (glossary), non-negative (glossary), length (function), global (command), group (command), object (object), control (object)

Tags: text processing
