aa_macro syntax 
 aa_macro source 
 HTML source 
 HTML render 
Key

4.100 - [splash] Built-In

Mnemonic aid: splash for SPLASH content

 [splash]  splits content, optionally limit=N times, separated by the default comma or the separator specified by the optional sep= parameter, and passes it to the style specified by style=styleName if the (style=styleName,) option is used, while obeying the (pre=,), (post=,), (inter=,) and (ntl=,) options. If the (style=,) option is not used, then the results are returned verbatim.

(style=styleName,) specifies a style to be called for each result.

(limit=N,) specifies the maximum number of splits (results-1... specifying two splits means (up to) three results).

(sep=,) specifies the string that separates the results.

(pre=,) specifies a string to be emitted before each result.

(post=,) specifies a string to be emitted after each result.

(inter=,) specifies a string to be emitted between each result, unless (ntl=,) is also specified, in which case in between the next to last and the last result, (ntl=,) will be used instead.

(ntl=,) specifies a string to be emitted between the next to last and the last result.

On each iteration,  [splash]  sets the local variable loc_splashnum to a number indicating which result is being processed. The number starts with 1 and increases by one for each iteration. This value can be fetched by the called style, as that style is freshly evaluated upon each iteration.

Tip:

If you would like to use a comma (,) character in the (pre=,), (post=,), (inter=,) or (ntl=,) options, use the comma escape,  [co] . This will be converted into a literal comma in the results.

Tip:

After the  [splash]  operation has run, you can retrieve the number of parameters that were created as current  [parm]  values during the most recent  [splash]  operation from the local variable loc_splashcount.

In addition, each of the parameters may be retrieved using  [parm N] .

Caution:

Built-in and style usage placed in the (pre=,), (post=,), (inter=,) and (ntl=,) options is evaluated only once; this is why the enumerate example uses a subordinate style, numit, to fetch the loc_splashnum value rather than placing it in the (pre=,) option.


[splash (pre=,)(post=,)(inter=,)(ntl=,)(style=styleName,)(sep=,)(limit=N,)content]

[style asterblaster *[b]*]
[style numit [v loc_splashnum]:[b]]
[style enumerate [splash style=numit,inter=[nl],[b]]]
[style itemize [splash inter=[co] ,ntl= and ,[b]]]
[splash inter= ,style=asterblaster,1,2,3,4]
[splash inter= ,style=asterblaster,sep=|,a|b|c|d]
[splash inter= ,style=asterblaster,sep=/,limit=2,i/ii/iii/iv]
[splash inter=[co] ,ntl= and ,pomegranite,pear,peach,persimmon]
{enumerate bolt,nut,screw,nail}
{itemize bear,fox,puma,rabbit,skunk}

*1* *2* *3* *4*
*a* *b* *c* *d*
*i* *ii* *iii/iv*
pomegranite, pear, peach and persimmon
1:bolt
2:nut
3:screw
4:nail
bear, fox, puma, rabbit and skunk
*1* *2* *3* *4* *a* *b* *c* *d* *i* *ii* *iii/iv* pomegranite, pear, peach and persimmon 1:bolt 2:nut 3:screw 4:nail bear, fox, puma, rabbit and skunk

Other built-ins used here:  [co] ,  [nl] ,  [style]  and  [v] 

Keyboard Navigation
, Previous Page . Next Page t TOC i Index

Valid HTML 4.01 Loose
 

This manual was generated with wtfm
wtfm uses aa_macro and SqLite
aa_macro uses python 2.7