Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Open a folder

  1. #11
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,972
    Hi Cory,

    In this case, I don't think I can use GETDIR() since it seems like it only accesses the open folder dialog box.
    I was looking to physically open the folder.
    I don't understand what you mean. Explain what you want to do. GETDIR() lets the user select a folder and that selected folder is returned at which point you can do what you want with the result.

    Using the RUN command still seems to be my best option and it works fine.
    I would not recommend that as it is not cross platform and as much as you think you will *never* change from windows you may alter that view in time. Better to code for cross platform so that apps and data can be moved without changing them.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  2. #12
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    Hi Barry,

    In an earlier post, I've already described what I'm trying to achieve. I'm not sure how to say it differently, but let me try.

    In my app, I have a command button labeled 'Browse'.
    When the user clicks this button, GetDir() is called to allow the user to select the directory path they want.
    The returned value is saved in a table so that it can be re-used in the future. The path is also displayed with the help of a label.

    In my app, I have a second command button labeled 'Open Folder'.
    When this button is clicked, the saved path is accessed and the folder opens for the user (currently with the RUN command calling Windows Explorer).

    This way, the user does not have to open 'Computer' and take the time to navigate the complex levels to get to their preferred folder location (ex. C:\Users\user_name\Documents\...\...\...\...).
    This also allows the user to remain in the app while keeping the folder window open so the user can switch back and forth if they need/want to.

    I understand your comment about cross platform programming, although I am currently programming for a windows environment. In addition, I currently do not have access to other platforms nor do I have the knowledge on how other platform directory structures are handled.

    If you have a suggestion on how I can change the RUN command to physically open a window to display the files in a folder instead of just having an open folder dialog box, I would like to know more about it.

    I hope this helps to clarify my program intensions.

    Thanks,
    Cory

  3. #13
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,011
    Hi Cory,

    it sounds like you want to use getdir() to store the folder, and then getfile() to select the file. You would add the path stored with getdir() so the getfile() opens in the correct directory.

    hth,

    Hank

  4. #14
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,462
    Hi Cory,

    Another possibility you might like to consider is using an Attachments Section. The user could then access their documents (say filtered by a field storing the username()) from the Attachments Section directly.

    Regards,

    Yvonne

  5. #15
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    Hi Hank,

    Doesn't getfile() still open a dialog box for the user to select a file?
    If that is the case, does the dialog remain open even after a file has been selected?
    Also, the Lianjapedia doesn't show that you can send a path to this function.


    Hi Yvonne,

    The attachments section is a good idea although I don't think it will be beneficial in this case.
    Since I have not used attachment sections yet, my knowledge of it is limited.
    My understanding is that the attachments would only be available while the app is in use.
    The user will need access to all files even when the app is not running.
    The app doesn't need to store the files. It creates them and provides a means to open the folder so that user doesn't have to go searching for it.

    The buttons that I described are essentially a header section for reports.
    This allows the user to set the path for the reports and view all items in the folder and they can do what ever they wish with the files (rename, delete, modify - if applicable, etc.) just as you would normally do with any windows explorer folder. The main sections are where the user can run various reports. When a particular report is executed, if a file previously existed, it will be deleted and re-created so that the information is always accurate as of the time the report was created. When a report is newly created, the user can open the file directly for viewing. I use showdocument for this.

    Name:  open folder.jpg
Views: 56
Size:  35.9 KB

    I really didn't think this would become a complicated issue.

    Perhaps I am missing something with the help that has been provided or perhaps I'm not expressing my intensions clear enough.
    I am not looking to open a file from a folder, I just want to open the folder for the user.


    Cory

  6. #16
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,011
    Hi Cory,

    yes, same as VFP: you CD to the directory, do your getfile, CD back to where you were. No need to keep the directory open in Windows Explorer all the time.

    Hank

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us