SORT# returns a string containing a sorted Telitab set
SORT#(Telitab$, SortPar$, [Mode%=0 or 1])
Arguments
Before explaining the SORT# function, some words on unfolding a Telitab set for a particular parameter. Unfolding implies that the record(s) containing this parameter are moved to the top of the hierarchy.
So if Telitab_1$ contains the dataset:
2
"MODELS"
{
0
-4 "1" "2" "3" "4"
"MODMAT$" "wood" "foam" "wood" "plywood"
"LPP" 112.30 133.80 98.60 145.00
"B" 17.80 21.50 16.42 22.40
"T" 7.65 9.20 6.70 9.40
}
"PROJECTS"
{
1
"CLIENT$" "YardX"
}
To explain the data:
you have two objects, MODELS and PROJECTS presented as list values in Telitab_1$ containing TeLiTabs themselfs (with several parameters).
LPP is part of the MODELS object (TeLiTab).
When you unfold Telitab_1$ dataset on parameter "LPP", you get:
1
"PROJECTS"
{
1
"CLIENT$" "YardX"
}
0
-4 "1" "2" "3" "4"
"MODMAT$" "wood" "foam" "wood" "plywood"
"LPP" 112.30 133.80 98.60 145.00
"B" 17.80 21.50 16.42 22.40
"T" 7.65 9.20 6.70 9.40
You see that PROJECT still is a separate object (and presented as a list value in Telitab_1$). All other data (which was part of the MODELS object) now is part of Telitab_1$ and thus a table in the TeLiTab.
To unfold a Telitab set for a particular parameter implies that the record(s) containing this parameter are moved to the top of the hierarchy. If UnfoldPar$ = "NullString", no unfolding is performed.
The SORT#() function unfolds and sorts de telitab like in the following example:
SORT#(Telitab_1$, "LPP", 0)
or
SORT#(Telitab_1$, "LPP"))
returns:
1
"PROJECTS"
{
1
"CLIENT$" "YardX"
}
-4 "1" "2" "3" "4"
"MODMAT$" "wood" "wood" "foam" "plywood"
"LPP" 98.60 112.30 133.80 145.00
"B" 16.42 17.80 21.50 22.40
"T" 6.70 7.65 9.20 9.40
SORT#(Telitab_1$, "LPP", 1)
returns:
1
"PROJECTS"
{
1
"CLIENT$" "YardX"
}
-4 "1" "2" "3" "4"
"MODMAT$" "plywood" "foam" "wood" "wood"
"LPP" 145.00 133.80 112.30 98.60
"B" 22.40 21.50 17.80 16.42
"T" 9.40 9.20 7.65 6.70
If SortPar$ contains a parameter which does not occurr in the Telitab$ set, an error message is returned:
"No valid Sort parameter: "ParName" given in SORT# function."
Quick links: Function overview | Attribute overview | Constants overview | Dimensions overview