Good suggestion Irneb,
nth would be more suitable for this application.
main problem is how to obtain position on my LST when i select something at dcl?
The index of the selected item in a
list_box or
popup_list DCL tile is held by the
$value action expression which may be accessed from within the
action_tile statement for the tile, e.g.:
(action_tile <DCL-tile> "(setq idx $value)")
Here, the
idx symbol would hold a string containing the zero-based indexes of the selected item(s) in the
list_box or
popup_list.
since i'm filter LST (maybe sort at some list_box) this is not easy i guess ?
Since you are populating each
list_box with a list of items retrieved from the main data (based on selected items from other list boxes), you can use the index of the selected item (as described above) to retrieve the selected item from the list of items populating the current
list_box.
Alternatively, if the lists were
not going to be sorted independently of the main data list, you could use a list of indexes of the selected items in each
list_box to retrieve a corresponding list of selected items from the main data list.
For example, if your main data was:
(I missed the last level of nesting in my earlier post)
(setq data
'(
( "Drawing1"
( "Layout1"
( "Block1"
( "Tag1"
( "Value1" "Value2" )
)
( "Tag2"
( "Value1" "Value2" )
)
)
( "Block2"
( "Tag1"
( "Value1" "Value2" )
)
( "Tag2"
( "Value1" "Value2" )
)
)
)
( "Layout2"
( "Block1"
( "Tag1"
( "Value1" "Value2" )
)
( "Tag2"
( "Value1" "Value2" )
)
)
( "Block2"
( "Tag1"
( "Value1" "Value2" )
)
( "Tag2"
( "Value1" "Value2" )
)
)
)
)
( "Drawing2"
( "Layout1"
( "Block1"
( "Tag1"
( "Value1" "Value2" )
)
( "Tag2"
( "Value1" "Value2" )
)
)
( "Block2"
( "Tag1"
( "Value1" "Value2" )
)
( "Tag2"
( "Value1" "Value2" )
)
)
)
( "Layout2"
( "Block1"
( "Tag1"
( "Value1" "Value2" )
)
( "Tag2"
( "Value1" "Value2" )
)
)
( "Block2"
( "Tag1"
( "Value1" "Value2" )
)
( "Tag2"
( "Value1" "Value2" )
)
)
)
)
)
)
Such a function might be:
(defun _getitems
( idx data
/ n
) )
)
)
Which you would then call with the main data list and a list of indexes for each level of the data:
_$ (_getitems '(1 0 1 1 0) data)
("Drawing2" "Layout1" "Block2" "Tag2" "Value1")
Sorry if this isn't explained too well.