aa_macro syntax 
 aa_macro source 
 HTML source 
 HTML render 
Key

§ 4.102 - [locsplit] Built-In

Mnemonic aid: locsplit for LOCal SPLIT

See also:  [glosplit] ,  [split]  and  [splitcount] 

This built-in takes content and splits it into local variables with a numeric suffix for retrieval using the  [v]  or  [lv]  built-ins. The idea is that for some styles, you will want to pass more than one parameter.  [locsplit]  takes a variable base-name vName, a separator parameter X, and then the content to be split. You can specify anything you like as the separator, although to use a comma, you must use the comma escape,  [co] 

Tip: After the  [locsplit vName,splitSpec,ContentToSplit]  operation has run, you can retrieve the number of variables that were created as current  [v vnamex]  values from the local variable vname_splitcount.

[locsplit vName,X,item(Xitem)]

[locsplit xyz,|,ben|larry|joe]
The last split produced [v xyz_splitcount] parameters
[v xyz2]
[v xyz1]
[v xyz0]

[style disp [v xyz[b]] ]
[locsplit xyz,|,grapes|oranges|cherries|passionfruit|tomatoes|raspberries]
[for disp,0,[v xyz_splitcount],1]

[locsplit xyz,[co],Sheila,Michelle,Shevaughn]
[v xyz2]
[v xyz1]
[v xyz0]

[splitcount 2]
[locsplit xyz,[co],Jim,Becky Thatcher,Tom Sawyer, and Huckleberry Finn]
[v xyz0]
[v xyz1]
[v xyz2]

The last split produced 3 parameters
joe
larry
ben

grapes oranges cherries passionfruit tomatoes raspberries

Shevaughn
Michelle
Sheila

Jim
Becky Thatcher
Tom Sawyer, and Huckleberry Finn
The last split produced 3 parameters joe larry ben grapes oranges cherries passionfruit tomatoes raspberries Shevaughn Michelle Sheila Jim Becky Thatcher Tom Sawyer, and Huckleberry Finn

Other built-ins used here:  [co] ,  [for] ,  [parm] ,  [parm] ,  [splitcount] ,  [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