get folder name from path ???

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • RizlaUK
    Indigo Rose Customer
    • May 2006
    • 5552

    get folder name from path ???

    well, it seems im struggleing with what seems like a easy task

    i want to let the user choose a folder with dialog.folderfind and add the folder to a tree object, seems easy huh
    how do i get the name of the folder selected, iv tryed everything "reversefind, trim left)

    i just cant seem to get it,

    so now iv got the "DelimitedStringFunctions" from the ams examples and added table,count to the end of it, how do i get the last item in the table, or is there a function to get the folder selected from dialog.folderfind

    as always, thanks in advance for any help/advice
    Embrace change in your life, you never know, it could all work out for the best
  • RizlaUK
    Indigo Rose Customer
    • May 2006
    • 5552

    #2
    Nevermind, i got it in the end

    its a forest and trees thing, i dident think about "string.mid"

    fPath = Dialog.FolderBrowse("Please select a folder:", "C:\\");
    fName = String.Mid(fPath, String.ReverseFind(fPath, "\\") + 1, -1);

    Input.SetText("test", fName);
    Embrace change in your life, you never know, it could all work out for the best

    Comment

    • azmanar
      Indigo Rose Customer
      • Oct 2004
      • 1020

      #3
      Hi,

      I dont know whether this is relevant to you.

      There is a String.SplitPath action that breaks down all the path.
      Newbie Examples
      ------> AMS 7.5 : amstudio.azman.info
      ----> AMS 6 & 5: www.azman.info/ams/
      ----> FB: facebook.com/GuideToWealth

      ----> Content Development Blog: www.AZMAN.asia

      Comment

      • RizlaUK
        Indigo Rose Customer
        • May 2006
        • 5552

        #4
        Hi azmanar, yeah i know about the split.path, but i wanted to get the name of the folder selected, the split path function returns the full folder path to the selected folder, i needed to add the name of the folder to the text of a tree object and the path to the tree data

        i beleave the String.SplitPath returns Drive, Folder, Filename and Extension

        Thanks for your input anyway,

        it took me a while to figer out, bit i got there in the end
        Embrace change in your life, you never know, it could all work out for the best

        Comment

        Working...
        X