UNFOLD# returns an unfolded sub set of a Telitab set
Arguments
If Telitab_1$ contains the dataset:
2
"MODELS"
{
0
-4 "1" "2" "3" "4"
"MODMAT$" "wood" "foam" "wood" "plywood"
"LPP" 112.30 133.80 97.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$ on parameter "LPP", you can write:
UNFOLD#(Telitab_1$, "LPP",0)
which unfolds Teltab$ for parameter "LPP" returns:
1
"PROJECTS"
{
1
"CLIENT$" "YardX"
}
-4 "1" "2" "3" "4"
"MODMAT$" "wood" "foam" "wood" "plywood"
"LPP" 112.30 133.80 97.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.
The records containing "LPP" were part of a sub-TeLiTab of the list item "MODELS" in the input data set. After the unfolding the records containing "LPP" are moved from the sub-TeLiTab to the top of the hierarchy.
In addition to unfolding a Telitab set, UNFOLD# allows the removal (Mode%=0) or retrieval (Mode%=1) of a specific subset of parameters provided in the optional list InpVar.
For the above value of Telitab_1$,
UNFOLD#(Telitab$, "LPP", 0, "MODMAT$", "PROJECTS")
returns:
0
3 "LPP" "B" "T"
"1" 112.30 17.80 7.65
"2" 133.80 21.50 9.20
"3" Â 98.60 16.42 6.70
"4" 145.00 22.40 9.40
Parameters MODMAT$ and object PROJECTS are removed.
For the above value of Telitab_1$,
UNFOLD#(Telitab$, "LPP", 1, "MODMAT$", "PROJECTS")
returns:
1
"PROJECTS"
{
1
"CLIENT$" "YardX"
}
1 "MODMAT$"
"1" "wood"
"2" "foam"
"3" "wood"
"4" "plywood"
Parameters MODMAT$ and object PROJECTS are the only ones presented.
Quick links: Function overview | Attribute overview | Constants overview | Dimensions overview