Please enable JavaScript to view this site.

A-Shell Reference

Updated August 2023; see History

Function

Type

Description

.EXTENT($a())

Num

Returns the total # of values, i.e. (row,col,value) triplets, in the gridmap $a(). Returns -1 if the gridmap has not yet been initialized or was subsequently destroyed with REDIMX.

.ISNULL(var)

Boolean

Tests the expression expr for null (same as for ordered maps). Expression may be an iterator, e.g. .ISNULL($$i), or a gridmap element reference, e.g. .ISNULL($a(row,col)), or a string variable.

.KEY($$i, 1)

String

Returns the row key (key #1), associated with the element currently indexed by the iterator $$i. See Comments below.

.KEY($$i, 2)

String

Returns the column key (key #2), associated with the element currently indexed by the iterator $$i. See Comments below.

.MINROW($a())

Num

Returns the first row number.

.MAXROW($a())

Num

Returns the last row number.

.MINCOL($a(),row)

Num

Returns the first (lowest) column number on the specified row (or -99999999 if none). Applies only to gridmaps with numeric column indices, i.e. gridmap(int;int;varstr).

.MAXCOL($a(),row)

Num

Same as .MINCOL($a(),row) except for the last (highest) column number on the row.

.COLNUM($a(),colname$)

Num

Returns the column number associated with colname$ (or -99999999 if no match). Applies to both gridmap variations. For gridmaps with numeric column indices, it scans row 1 to find a value match on the colname$; the resulting column number can be used (along with a row number) to directly address the gridmap. For gridmaps with string column indices, it scans row 1 (presumed to be the first data row) for a key match on the colname$, returning the ordinal sequence # (starting from 1) of the matching column. That mainly serves just to verify the existence of the target column.

 

Comments

Note that the .KEY() functions are of type string; use the VAL() function to convert the result to a numeric value suitable for comparing to row and column numbers. Otherwise you may be tripped up by the fact that "2" > 10.

See Also

INPCSVX.BP in the EXLIB for an example involving some of these gridmap functions.

History

2023 July, A-Shell 6.5.1736:  .MINCOL, .MAXCOL and .COLNUM added.

2023 July, A-Shell 6.5.1734:  .MINROW() extended to work for negative row numbers.