Documentation Clarification - Sub Arrays with spaces|a2b|roy@wasystems.net|1222052657|a2b|xx|0|76.102.148.130|<br />! array colors &nbsp; &nbsp; = white black orange red blue<br /><br />If I wanted to add &quot;dark blue&quot; and &quot;light blue&quot;, how would I go about such a thing? ||||
Re: Documentation Clarification - Sub Arrays with spaces|Kirsle|casey@cuvou.net|1222055584|Kirsle|xx|0|69.227.167.128|[quote author=6E3D6D0F0 link=1222052657/0#0 date=1222052657]<br />! array colors     = white black orange red blue<br /><br />If I wanted to add &quot;dark blue&quot; and &quot;light blue&quot;, how would I go about such a thing? [/quote]<br /><br />[quote]array<br /><br />This will create an array of strings, which can then be used later in triggers (see + TRIGGER). If the array contains single words, separating the words with a space character is fine. If the array contains items with multiple words in them, separate the entries with a pipe symbol (&quot;&#124;&quot;).<br /><br />Examples:<br /><br />  ! array colors = red green blue cyan magenta yellow black white orange brown<br />  ! array be     = is are was were<br />  ! array whatis = what is&#124;what are&#124;what was&#124;what were[/quote]<br /><br />[code]! array colors = white&#124;black&#124;orange&#124;red&#124;blue&#124;dark blue&#124;light blue[/code]<br /><br />Something the documentation doesn't specifically cover very clearly is what happens when your array is really long and ya wanna span it across a second line with ^...<br /><br />The WD says &quot;Note that when the ^ command continues the previous command, no spaces or line breaks are implied at the joining of the two lines. The \s and \n tags must be explicitely defined where needed.&quot; but how that applies to arrays is...<br /><br />If your array has single-word items (which are separated by spaces) and you go onto a second line, you need to have a \s somewhere, i.e.<br /><br />[code]! array colors = red blue green<br />^ \syellow cyan magenta<br /><br />! array colors = red blue green\s<br />^ yellow cyan magenta[/code]<br /><br />Otherwise the array would be &quot;red blue greenyellow cyan magenta&quot; with no implied space where the line break was.<br /><br />With pipe-separated ones it's less tricky I guess:<br /><br />[code]! array colors = white&#124;black&#124;orange&#124;<br />^ red&#124;blue&#124;light blue&#124;dark blue[/code]<br /><br />Just make sure there's a pipe somewhere around that point.<br /><br />Alternatively,<br /><br />[code]! array colors = white black orange red blue light\sblue dark\sblue[/code]<br /><br />If your array contains mostly single-word items and you don't want the mess of pipe symbols, use a \s where needed.<br /><br />[b]Edit[/b]<br /><br />No, that last thing I said is a bug. \s's don't work like that. If you want to span an array of single-word items to a new line and use a \s like that, it would all be combined (i.e. red blue green\syellow cyan magenta), creating an array of (&quot;red&quot;, &quot;blue&quot;, &quot;green yellow&quot;, &quot;cyan&quot;, &quot;magenta&quot;).<br /><br />I'll put it on my to-fix list.||1222056253|Kirsle|
