Next Previous Up Contents
Next: Null Values
Up: Algebraic Expression Syntax
Previous: Referencing Table Parameters
There are a few pseudovariables which have special functions
in the expression language.
The following specials are columnlike, in that they have a different value
for each row:

$index
or $0
 The current row number in the underlying table (the first row is 1).
This is the value seen in the grey numbers at the left of the grid in the
Data Window,
and is not affected by the current Row Subset or Row Order.
Note that this value is a
long
(8byte integer);
when using it in certain expressions you may find it necessary to convert
it to an int
(4byte integer) using the
toInteger()
function.
The deprecated alias "INDEX
" may also be used.

$index0
or $00
 The current row number in the apparent table
(the first row is 1).
This value is sensitive to the current Row Subset and Row Order of
the table. It has a null value for rows not in the current subset.

$random
(Deprecated)
 A doubleprecision random number
0<=x<1
.
NOTE: this token is deprecated since it can behave
unpredictably (the same cell does not always yield the same result).
Use instead the random()
function in class
Maths.
The following specials are parameterlike, in that their value is
not sensitive to the row:

$nrow
 The number of rows in the table.
This figure refers to the underlying table, not the apparent table,
so it is not affected by the value of the current subset.
Note that this value is a
long
(8byte integer);
when using it in certain expressions you may find it necessary to convert
it to an int
(4byte integer) using the
toInteger()
function.

$ncol
 The number of columns in the table.
This figure refers to the underlying table, not the apparent table,
so it is not affected by hiding columns.

$nrow0
 The number of rows in the apparent table.
This value may be less than
$nrow
if a nondefault
current subset is selected.

$ncol0
 The number of columns in the apparent table.
This value will be less than
$ncol
if some columns are
currently hidden.
Next Previous Up Contents
Next: Null Values
Up: Algebraic Expression Syntax
Previous: Referencing Table Parameters
TOPCAT  Tool for OPerations on Catalogues And Tables
Starlink User Note253
TOPCAT web page:
http://www.starlink.ac.uk/topcat/
Author email:
m.b.taylor@bristol.ac.uk
Mailing list:
topcatuser@jiscmail.ac.uk