Please enable JavaScript to view this site.

A-Shell Reference

In addition to traditional arrays, ASB supports the following types of collections:

Ordered Maps

dimx $CAPITALS, ordmap(varstr;varstr)     ! map of strings

...

$CAPITALS("FRANCE") = "PARIS"

dimx $STATES, ordmap(varstr;varx)      ! map of blobs/structures

...

Map1 STATE,ST_STATE

...

$STATES(“California”) = STATE        ! load structure into map

...

STATE = $STATES(“California”)       ! retrieve structure from map by key

? STATE.POPULATE, STATE.CAPITAL, …  ! access members

Multi Level List

dimx $JSONDOC, mlist(varstr)   ! JSON doc stored as multi-level list

...

$JSONDOC(.pushback) = name$ + ":" + value$   ! push name:value pair on end of list

Two-dimensional Ordered Maps (Grid Maps)

dimx $GMAP, gridmap(int, int, varstr)

...

$GMAP(row, col) = "Blue Moon"

dimx $GMAP, gridmap(int, varstr, varstr)

...

$GMAP(row,"Nationality") = "Utopian"