ReJump


Chapter 9:: Manual:: ReJump DataFile
Technology



 


Home

Datafile
About
News
Manual
<...
Chapter 9
...>
Download
Contacts








Operations with lists of objects

There are operators ":" and "." for operations with lists of objects "data-" in the system.
":" - direct link
"." - backward link
Result of each operation - list of objects.

During work with lists operators "+", "-", "/", "*" are supported. Their work is identical to operations with aggregates.

You can sum, deduct, divide and multiply them.
When you sum lists (+) the result list contains all elements from the first and the second lists without doubling.
When you deduct (-) the second list from the first list the result list contains information from the first list without elements from the second list.
When you divide (/) the result list contains elements only from the first list or only from the second list.
When you multiply (*) the result list contains elements from the both lists.

It is possible to use brackets "(" and ")" in expressions.
Example,
<&data-guestbook:(mes+mes2)>
list contains all files with extensions "mes" and "mes2" from the folder "guestbook".
<&(data-guestbook-1--mes2+data-guestbook-3--mes)*(data-guestbook:mes)>
result: data-guestbook-3--mes

Here is one more operator for list processing - "!"
It's used for operations ":" and "." iteration.
For example, record "data-guestbook:mes!" equals to sequence: "data-guestbook:mes+data-guestbook:mes:mes+..." We use it for opinion quantity calculation for example.
<&data-guestbook-1--mes:reply!>
At first we'll get an opinions on the message "1.mes".
Then opinions on the opinions on this message, etc.
If opinions would be presented in the form of tree, operation ":reply!" get list of all elements from that tree.

We use parameter "sort" to sort the list. It is similarly to parameters "skip" and "on_page" (see section 4)
List is sorted in alphabetical order by the default.

Record format: list?sort=template

Example <@data-guestbook:mes?sort=val_tpl<mes_tpl/#1@>
Template "val_tpl" contents: <&$1?Value>.

The result is file sorting with extension "mes" according to its contents (numerical or string).

Template "val/#1" would be called for every object. Sorting would be processed by finding during template processing values.

Parameter "desc" is used for sorted list output in postorder.

Parameter "where=template" is used for fetching. Sequence includes object if the result of template "/#1" processing is nonzero and nonempty.

Note, there are parameters "?Pos(object)", "?Next(object)" and "?Prev(object)". It returns object position, next object and previous object in the list accordingly.

Example: <&data-guestbook:mes?Pos(data-guestbook-2--mes)>
If there are two objects with extension "mes": "1.mes" and "2.mes". Then the result of expression is "2".

Index
Download
Contacts
If you have any questions, please, contact us via email: datafile@rejump.com.


© 2002-2009 Алексей Мась, ReJump