Next: , Previous: , Up: Top   [Index]


8 Byte Array Data Traversal Functions

The traversal functions read multiple keys and their associated data into ‘decq’ double ended queue objects. Before adding to the ‘decq’ collector, they clear it. The keys are added in their table forward traversal order. They are immediately followed in the ‘decq’ sequence by their table associated data.

db_q_glxf

void db_q_glxf(table t, decq q, data g, data l, integer x, ...);

adds to q the keys and their associated data in table t, from the first greater than g towards the last less than l, all if x is negative, x otherwise.

db_q_goxf

void db_q_goxf(table t, decq q, data g, data o, integer x, ...);

adds to q the keys and their associated data in table t, from the first greater than g towards the last less than or matching o, all if x is negative, x otherwise.

db_q_ulxf

void db_q_ulxf(table t, decq q, data u, data l, integer x, ...);

adds to q the keys and their associated data in table t, from the first matching or greater than u towards the last less than l, all if x is negative, x otherwise.

db_q_uoxf

void db_q_uoxf(table t, decq q, data u, data o, integer x, ...);

adds to q the keys and their associated data in table t, from the first matching or greater than u towards the last less than or matching o, all if x is negative, x otherwise.

Traversal Parameters

After the maximal keys retrieval count, a number of operation modifiers may follow as an integer identifier and an optional argument. Recognized modifiers include:

Examples

Read all keys and their associated data between inclusive "alpha" and non inclusive "omega" from table "illusion":

db_q_ulxf(db["illusion"], q, "alpha", "omega", -1);

Read all keys starting with inter, remove their common prefix:

db_q_ulxf(db["illusion"], q, "inter", "intes", -1, 'k', 'p', 5);

Traverse keys only, from after start key a to before end key z, picking up to 225 at a time and summing their lengths to y.

decq q;
data a, z;
integer j, y;

a = "alpha";
z = "omega";

y = 0;

while (~t.q_glxf.1(q, a, z, 225, 'k')) {
    j = ~q;
    do {
	y += ~qf_qs_data(q);
    } while (j -= 1);
    a.copy(qb_q_data(q));
}

Next: , Previous: , Up: Top   [Index]