@NUMPORTS — Returns the number of matching printer ports.

Syntax:
%@NUMPORTS[I|N,wildspec]

IIP printing ports only
NNon-IP printing ports only
wildspecwildcard name to match

If neither I nor N is specified, both IP and non-IP printing ports will be counted. If no wildspec is given, * will be used by default.