aa_macro syntax 
 aa_macro source 
 HTML source 
 HTML render 
Key

§ 4.103 - [glosplit] Built-In

Mnemonic aid: glosplit for GLObal SPLIT

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

This built-in takes content and splits it into global variables with a numeric suffix for retrieval using the  [v]  or  [gv]  built-ins. The idea is that for some styles, you will want to pass more than one parameter.  [glosplit]  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  [glosplit vName,splitSpec,ContentToSplit]  operation has run, you can retrieve the number of variables that were created as current  [v vnamex]  values from the global variable vname_splitcount.

[glosplit vName,X,item(Xitem)]

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

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

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

[splitcount 2]
[glosplit 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