Re: directory tree -> array

2020-03-03 Thread Richard Gaskin via use-livecode
liminate pPath from every line of pPaths. Then insert each line into an array. email subject "directory tree -> array" forum topic "f=7&t=33565" */ function arrayFromPaths pPaths, pPath -- a list of full paths, and the path that was used to generate the list

Re: directory tree -> array

2020-02-04 Thread Alex Tweedly via use-livecode
On 04/02/2020 17:20, Bob Sneidar via use-livecode wrote: Good points. I'll make some changes and resubmit. It never dawned on me that someone would intentionally send an empty path, but it *might* happen accidentally. Also, a path like /Users/BobSneidar being repeated would be very edge case,

Re: directory tree -> array

2020-02-04 Thread Bob Sneidar via use-livecode
eductively >>>> simple but I don't think it is: >>>> >>>> What is the simplest way to build an array that reflects the files and >>>> folders within a given folder? >>>> >>>> There's a discussion about this h

Re: directory tree -> array

2020-02-04 Thread Alex Tweedly via use-livecode
rned, I'm offering help here instead. The list of full paths contains enough information to build an array representation of the directory tree. /** Summary: Given a list of full paths, and given the partial path they share, build an array representing the directory structure pPaths: a retu

Re: directory tree -> array

2020-02-04 Thread Alex Tweedly via use-livecode
given the partial path they share, build an array representing the directory structure pPaths: a return-delimited list of full paths pPath: the path that was used to generate the list of full paths Returns (array): A array with a branch node for each folder and a leaf node for each file Descrip

Re: directory tree -> array

2020-02-03 Thread Bob Sneidar via use-livecode
Yes, but I couldn't get the recursion working right. My brain fried. Bob S > On Feb 3, 2020, at 11:18 , Ben Rubinstein via use-livecode > wrote: > > On 22/01/2020 18:26, Richard Gaskin via use-livecode wrote: >> We have many handlers that deliver directory trees as lists, but arrays are >>

Re: directory tree -> array

2020-02-03 Thread Ben Rubinstein via use-livecode
On 22/01/2020 18:26, Richard Gaskin via use-livecode wrote: We have many handlers that deliver directory trees as lists, but arrays are a different beast.  Because the depth is both unknowable and varied, I can't think of a way to do this without resorting to "do". Surely this is what recursio

Re: directory tree -> array

2020-02-03 Thread Bob Sneidar via use-livecode
'm offering help > here instead. > > The list of full paths contains enough information to build an array > representation of the directory tree. > > > /** > > Summary: Given a list of full paths, and given the partial path they share, > build an array repre

Re: directory tree -> array

2020-02-01 Thread Dick Kriesel via use-livecode
path that was used to generate the list of full paths Returns (array): A array with a branch node for each folder and a leaf node for each file Description: Eliminate pPath from every line of pPaths. Then insert each line into an array. email subject "directory tree -> array" f

Re: directory tree -> array

2020-01-22 Thread Brian Milby via use-livecode
Wasn’t talking about the widget but building the underlying array that it would display. Thanks, Brian On Jan 22, 2020, 2:21 PM -0500, Richard Gaskin via use-livecode , wrote: > Where is the tree widget used in the Standalone Builder? > > -- > Richard Gaskin > Fourth World Systems > > Brian Milb

Re: directory tree -> array

2020-01-22 Thread Richard Gaskin via use-livecode
Where is the tree widget used in the Standalone Builder? -- Richard Gaskin Fourth World Systems Brian Milby wrote: > Much of the needed work is already done in the standalone builder > code. I don’t think it does a nested array, but it does handle things > like processing links/shortcuts. I

Re: directory tree -> array

2020-01-22 Thread Brian Milby via use-livecode
Much of the needed work is already done in the standalone builder code.  I don’t think it does a nested array, but it does handle things like processing links/shortcuts.  I’ll try to take a look to see if a short recursive function could be easily built. Thanks, Brian On Jan 22, 2020, 1:59 PM -

Re: directory tree -> array

2020-01-22 Thread Richard Gaskin via use-livecode
Bob Sneidar wrote: > I found a populate directory demo with a tree widget, but it fails, > almost certainly because the embedded widget is out of sync with > the current tree widget. Here you go. If you turn one up it would be good to see the code. So widgets can embed other widgets? I did not

Re: directory tree -> array

2020-01-22 Thread Bob Sneidar via use-livecode
Won't work. The behavior is missing. Bob S > On Jan 22, 2020, at 10:38 , Bob Sneidar via use-livecode > wrote: > > I found a populate directory demo with a tree widget, but it fails, almost > certainly because the embedded widget is out of sync with the current tree > widget. Here you go.

Re: directory tree -> array

2020-01-22 Thread Bob Sneidar via use-livecode
I found a populate directory demo with a tree widget, but it fails, almost certainly because the embedded widget is out of sync with the current tree widget. Here you go. > On Jan 22, 2020, at 10:34 , Bob Sneidar via use-livecode > wrote: > > The tree view widget has an array at it's core. I

Re: directory tree -> array

2020-01-22 Thread Bob Sneidar via use-livecode
The tree view widget has an array at it's core. I seem to remember someone creating a stack that uses the tree view widget to represent a folder structure. You should be able to simply extract the array from that. I'll poke around. Bob S > On Jan 22, 2020, at 10:21 , Bob Sneidar via use-live

Re: directory tree -> array

2020-01-22 Thread Richard Gaskin via use-livecode
We have many handlers that deliver directory trees as lists, but arrays are a different beast. Because the depth is both unknowable and varied, I can't think of a way to do this without resorting to "do". -- Richard Gaskin Bob Sneidar wrote: > I thought someone created a handler for this? I

Re: directory tree -> array

2020-01-22 Thread Bob Sneidar via use-livecode
I thought someone created a handler for this? It requires iteration. Bob S > On Jan 22, 2020, at 10:17 , Richard Gaskin via use-livecode > wrote: > > I stumbled across a code challenge for y'all, one that seems seductively > simple but I don't think it is: > > What is the simplest way to b

directory tree -> array

2020-01-22 Thread Richard Gaskin via use-livecode
I stumbled across a code challenge for y'all, one that seems seductively simple but I don't think it is: What is the simplest way to build an array that reflects the files and folders within a given folder? There's a discussion about this here: https://forums.livecode.com/viewtopic.php?f=7&t