Xojo.Io and SpecialFolder.SharedDocuments

  1. 3 months ago

    I use this code found in the forum

    using Xojo.io
    dim f as FolderItem = SpecialFolder.Documents
    
    for each i as FolderItem in f1.Children
      if i.IsFolder = false and i.IsVisible then Listbox1.AddRow i.name
    next

    However when try to use it with SpecialFolder.SharedDocuments and read files on a second level subdirectory in it, I got errors as I can't use f1 = f.child("xxx")

    Is anybody can help me?
    I appreciate it in advance

    using Xojo.io ....

    then SpecialFolder is Xojo.IO.SpecialFolder and there is not a SharedDocuments method

    you have to use something like:

    using Xojo.io
    Dim fOldNowNew As Global.Folderitem=Global.SpecialFolder.SharedDocuments
    dim f1 as  New FolderItem(fOldNowNew.NativePath.ToText)

    ... then you can use the f1 iterable functionality

  2. David C

    Feb 6 Pre-Release Testers, Xojo Pro Derby, ITM

    f1 is never defined.

  3. Edited 3 months ago

    Sorru i put the wrong code. This is which troubles me

    using Xojo.io
    dim f1 as FolderItem = SpecialFolder.SharedDocuments

    for each i as FolderItem in f1.Children
    if i.IsFolder = false and i.IsVisible then Listbox1.AddRow i.name
    next

    Dim f1 as folderitem = specialfolder.ShatedDocuments gives me an error “item dies not exist”

    I try to read all the files stored in public directory users/public/public documents in windows or shated_documents in XOjo Cloud

  4. Your testing if item is not a folder and is visible
    no need to test if item is visible ??
    test if item exist (if i.IsFolder = false and i.exists)

  5. Antonio R

    Feb 7 Pre-Release Testers, Xojo Pro Answer Europe (Italy)

    using Xojo.io ....

    then SpecialFolder is Xojo.IO.SpecialFolder and there is not a SharedDocuments method

    you have to use something like:

    using Xojo.io
    Dim fOldNowNew As Global.Folderitem=Global.SpecialFolder.SharedDocuments
    dim f1 as  New FolderItem(fOldNowNew.NativePath.ToText)

    ... then you can use the f1 iterable functionality

or Sign Up to reply!