Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Re: Extract a folder name from a path

Expand Messages
  • Don - HtmlFixIt.com
    See the thing is ... it doesn t ... ^!Set %folder%= D: folder1 folder2 folder3 folder4 folder5 ^!SetListDelimiter ^!SetArray %folderarray%=^%folder% ^!Info
    Message 1 of 39 , Jan 27, 2010
    • 0 Attachment
      See the thing is ... it doesn't ...

      ^!Set %folder%="D:\folder1\folder2\folder3\folder4\folder5"
      ^!SetListDelimiter \
      ^!SetArray %folderarray%=^%folder%
      ^!Info Array number is: ^%folderarray0% and Folder 5 is: ^%folderarray6%
      ^!Info Array is: *^%folderarray%*
      ^!Dec %folderarray0%
      ^!Info Array number is: ^%folderarray0% and Folder 5 is: ^%folderarray6%
      ^!Info Array is: *^%folderarray%*
      ^!Inc %folderarray0%
      ^!Info Array number is: ^%folderarray0% and Folder 5 is: ^%folderarray6%
      ^!Info Array is: *^%folderarray%*


      ebbtidalflats wrote:
      > Yes of course, dec path0 will make the previous last element inaccessible. If you need to keep it for some reason, just copy the array before decrementing it.
      >
      > Or save the desired element[s]:
      >
      > ^!SetArray %arguments%=^&
      > ^!Set %last%=^%arguments^%arguments0%%
      > ^!Dec %arguments0%
      > ^!Set %next2last%=^%arguments^%arguments0%%
      > ^!Dec %arguments0%
      > ^!Set %etc%=^%arguments^%arguments0%%
      >
      >
      > Cheers,
      >
      > Eb
      >
      > --- In ntb-clips@yahoogroups.com, "Don - HtmlFixIt.com" <don@...> wrote:
      >> Interesting way to get next to last element. Very creative.
      >>
      >> Any bad downsides to changing the path0 when there are really more
      >> elements in the array? If you wanted to have the last element later
      >> (not the case here) is it thus chopped off? Is memory cleared?
      >>
      >>> ^!Dec %path0%
      >>> ;new 'last' array element contains folder name
      >>> ^!Info [L]^%path^%path0%%
      >
      >
      >
      >
      > ------------------------------------
      >
      > Fookes Software: http://www.fookes.com/
      > NoteTab website: http://www.notetab.com/
      > NoteTab Discussion Lists: http://www.notetab.com/groups.php
      >
      > ***
      > Yahoo! Groups Links
      >
      >
      >
      >
    • Axel Berger
      ... So I was wrong after all. Thanks Eb Axel
      Message 39 of 39 , Jan 31, 2010
      • 0 Attachment
        ebbtidalflats wrote:
        > The array size ACTUALLY CHANGED! Not smoke and mirrors after all.

        So I was wrong after all.

        Thanks Eb

        Axel
      Your message has been successfully submitted and would be delivered to recipients shortly.