Difference between revisions of "Programmer Guide/Command Reference/WORDS"

From STX Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
 
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
The <code>WORDS</code> returns the number of arguments ("words" in a broader, or more technical, meaning) supplied to the command.
+
The {{STx}} comnmand <code>WORDS</code> returns the number of arguments ("words" in a broader, or more technical, meaning) supplied to the command.
  <var>var</var> := WORDS <var>arg<sub>1</sub></var> <var>arg<sub>2</sub></var> ... <var>arg<sub>n</sub></var>
+
  <var>var</var> := WORDS <var>arg<sub>1</sub></var> <var>arg<sub>2</sub></var> &hellip; <var>arg<sub>n</sub></var>
 
Note the difference between what is called a word in everyday-use, and what is called a word (an argument) here:
 
Note the difference between what is called a word in everyday-use, and what is called a word (an argument) here:
 
Generally, if you supply <var>n</var> arguments to the <code>WORDS</code> command, it will return the number <var>n</var>, even if one of the arguments should consist of more than one "word" of natural language.
 
Generally, if you supply <var>n</var> arguments to the <code>WORDS</code> command, it will return the number <var>n</var>, even if one of the arguments should consist of more than one "word" of natural language.

Revision as of 14:43, 8 May 2014

The STx comnmand WORDS returns the number of arguments ("words" in a broader, or more technical, meaning) supplied to the command.

var := WORDS arg1 arg2argn

Note the difference between what is called a word in everyday-use, and what is called a word (an argument) here: Generally, if you supply n arguments to the WORDS command, it will return the number n, even if one of the arguments should consist of more than one "word" of natural language.

#v1 := WORDS don`'t come easy       // #v1 will be set to 3
#v2 := WORDS 'don`'t come' easy     // #v2 will be set to 2
#v3 := WORDS 'don`'t' 'come easy'   // #v3 will be set to 2, too
#v4 := WORDS 'don`'t come easy'     // #v4 will be set to 1