Support reverse $QUERY() for globals and locals
Final Release Note
$query(glvn,-1) returns the previous subscripted local or global variable node name, independent of level, which precedes the node specified by its argument in M collating sequence and has a data value. That is, if $query(glvn1) returns glvn2, then $query(glvn2,-1) returns glvn1 if glvn1 exists, otherwise it returns the node preceding glvn1. Also, $query(gvn) works correctly in case the global corresponding to gvn has nodes with null subscripts and the database has Standard Null Collation set to FALSE (i.e. GT.M Null Collation is in effect). Previously, this would result in infinite loops. (#10 (closed))
Description
$query for both globals and locals works only in the forward direction currently. The goal is to get it working in the reverse direction, just like $order. So if ^x(1) and ^x(2) exist, $query(^x(2),-1) should return ^x(1). Same for local variables i.e. $query(x(2),-1).
Draft Release Note
$query(glvn,-1) returns the previous subscripted local or global variable node name, independent of level, which precedes the node specified by its argument in M collating sequence and has a data value. That is, if $query(glvn1) returns glvn2, then $query(glvn2,-1) should return glvn1. (#10 (closed))
$query(gvn) works correctly in case the global corresponding to gvn has nodes with null subscripts and the database has Standard Null Collation set to FALSE (i.e. GT.M Null Collation is in effect). Previously, this would result in infinite loops. (#10 (closed))
Messages & Recovery Manual
A QUERY2 error is issued when $query(gvn,dir) is invoked with dir not evaluating to a -1 or 1 (the only permissible values).