there is a 4D forums-thread Array to hierarchical list, need code. Main interest is converting a paths-array into a hierarchical-list.

Keisuke Miyako build a demonstration. Again using regex to split the path-elements
Match regex(„([^/]+)/(.*)“;$item;1;$pos;$len)
The Gem for me are these two lines in the object-method for the form-list.
//because we can’t directly assign to a form local variable
VARIABLE TO VARIABLE(Current process;Self->;$list)

    I learned two things

  • we can use hierarchical list without an attached longint-variable, i.e. object-name only
  • we can’t directly assign to a form local variable, unless we force 4D to call itself, even inexplicit