Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

datapath find

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    datapath find

    Hi all,

    Does anybody have a datapath finder?

    Most of us know where we put stuff, but alpha does not seem to have a method for finding the datapath on a network without user input.

    I am at a loss to do this from within alpha.

    My datapath is generally like \\server\ups55\sales.adb and not "v:\ups55\sales.adb"

    I cannot find a way to search for shared folders on another computer and not knowing the name. There are a few commercial programs oput there to do this, but require user intervention.

    Hopefully, I can do a search for a planted file on the server, trap the complete path, use that path in a variable and fill in the needed information for a neew install so the user has no problem with an install.

    Any help or ideas will be greatly appreciated and I bet a lot of us can benefit from it.

    Thanks in advance.

    .
    Dave Mason
    [email protected]
    Skype is dave.mason46

    #2
    Re: datapath find

    Dave,
    If you know the uppermost folder that the file will be contained in then I believe is doable without user action....otherwise I cannot.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


      #3
      Re: datapath find

      Alpha doesn't seem to "like" UNC file names. I don't know if that's an Alpha issue or .DBF issue but I suspect it's an Alpha issue. Maybe something to add to the wish list.

      I did discover that FILE.MACHINES_GET() will list the UNC file names of networked drives but FILEFIND.GET() doesn't recognize UNC names so it won't do you much good.

      NOTES:

      1. I also discovered that ?A5_GET_WRITABLE_DRIVES() - as listed in the Help files - doesn't work in any version. However, A5_GET_WRITEABLE_DRIVES() does return mapped drives.

      2. Even if you could find them, I thought there were problems using UNC names in lookups (such as a table lookup in field rules) and possibly some other operations?? Disclaimer: I'm not sure about this one.

      Comment


        #4
        Re: datapath find

        Cal, Dave,
        If you know the network computer name and the folder that a file is in you can use this other function which will take a network path....(MAIN-- is a networked computer).
        Code:
        FilFind=FILEFIND.GET_RECURSE("\\MAIN--\My Documents","*.txt")
        ?Filfind
        = \\MAIN--\My Documents\REBOOT_TEST.txt
        \\MAIN--\My Documents\Strawberry_Prestige.txt
        \\MAIN--\My Documents\AIM_092008_Script_Final.txt
        \\MAIN--\My Documents\Google Map.txt
        \\MAIN--\My Documents\System_Restore_Safemode.txt
        Cal, I see you notice that misspelling as well :) ....been that way at least since v5 I know as I used it back then. At least the help file example has it correct.
        Mike
        __________________________________________
        It is only when we forget all our learning that we begin to know.
        It's not what you look at that matters, it's what you see.
        Henry David Thoreau
        __________________________________________



        Comment


          #5
          Re: datapath find

          Very interesting!

          I had tried it in the Interactive Window without knowing any folder names and, after a very long wait, got this - nothing! FWIW, I also tried it with other combinations - without the backslash, with *.* - and couldn't find anything that worked. Maybe someone else can.

          Code:
           
          ?FILEFIND.GET_RECURSE("\\AIMS-DC3\\","*",FILE_FIND_DIRECTORY)
          = ""
          However, adding a folder name returns all subfolders - almost instantly:
          Code:
          ?FILEFIND.GET_RECURSE("\\AIMS-DC3\Seagull\\","*",FILE_FIND_DIRECTORY)
          = \\AIMS-DC3\Seagull\BarTender
          \\AIMS-DC3\Seagull\Common
          \\AIMS-DC3\Seagull\BarTender\7.74
          \\AIMS-DC3\Seagull\BarTender\7.74\Toolbox
          \\AIMS-DC3\Seagull\BarTender\7.74\Toolbox\Standard Bar Codes
          \\AIMS-DC3\Seagull\BarTender\7.74\Toolbox\Standard RFID
          \\AIMS-DC3\Seagull\BarTender\7.74\Toolbox\Standard Bar Codes\1D
          \\AIMS-DC3\Seagull\BarTender\7.74\Toolbox\Standard Bar Codes\2D
          \\AIMS-DC3\Seagull\BarTender\7.74\Toolbox\Standard Bar Codes\EAN - JAN - UPC
          \\AIMS-DC3\Seagull\BarTender\7.74\Toolbox\Standard Bar Codes\Postal - Shipping
          \\AIMS-DC3\Seagull\BarTender\7.74\Toolbox\Standard Bar Codes\RSS
          \\AIMS-DC3\Seagull\BarTender\7.74\Toolbox\Standard Bar Codes\TLC
          \\AIMS-DC3\Seagull\Common\ShellExtension
          Unfortunately, I believe that the whole point of the original question was that the developer had no way of knowing what folder it was in.
          Last edited by CALocklin; 08-07-2010, 11:32 PM.

          Comment


            #6
            Re: datapath find

            Thanks for the responses. I think if we can figure it all out, we can post in the code archive? Someone else may have a use for it too. I only wish The Alpha Company Gang would look at this.

            actually, I will know the name of a "planted" file in a folder on the server and that it will be on a the root of a drive. It will be a shared folder. I can cause it to be a set folder name too if absolutely necessary. I was also thinking way past alpha as another way(vb, pb, c, etc.), but if possible to stay in alpha, it would be better.

            My boot strap for a work station asks for a path to the master adb now and accepts user input, but users have wrong ideas sometimes or don't have enough knowledge to carry it out. It would be better if they did not have to cross this.


            .
            Dave Mason
            [email protected]
            Skype is dave.mason46

            Comment


              #7
              Re: datapath find

              Originally posted by DaveM View Post
              ... users have wrong ideas sometimes or don't have enough knowledge to carry it out. It would be better if they did not have to cross this.
              Oh, come on! Where do you find users like that? None of mine would have any problem with such a simple task.

              Comment


                #8
                Re: datapath find

                Dave,
                So far I can get it if the server name and drive name is known. A list of files is then shown with full paths and would be easy to do......still thinking/working on not having to know the drive......
                Mike
                __________________________________________
                It is only when we forget all our learning that we begin to know.
                It's not what you look at that matters, it's what you see.
                Henry David Thoreau
                __________________________________________



                Comment


                  #9
                  Re: datapath find

                  You can do it without knowing the drive (see File.Machines_get() ) BUT you have to know the first level folder name.

                  So, if you KNOW that the application will always be installed to <SomeDrive>MyAppFolder, then you can use File.Machines_get() to get a list of drives and then check each one to find the one that has your folder/file. (Although, personally, I hate it when people force me to install to a specific folder name)
                  EDIT: Oops! Maybe that's what you meant by "server name and drive name is known".

                  Frankly, I'm not sure there is any good way to solve this. Even if you could find every folder on every drive, (a) someone is likely to put your application is a subfolder of a subfolder somewhere which would make it even tougher to find (a couple of my clients have done that) and (b) it could (maybe) take a long time to run a search like that.

                  Another issue I've run into is that the user installed my app on the server but didn't know how to share it. In that case, being able to search the folders wouldn't do much good.

                  Wait! I think I have the answer - teach everybody that uses a computer how to share folders and to navigate through the folders to find the one they want. After all, this should be part of Computers 101.

                  Comment


                    #10
                    Re: datapath find

                    Cal,
                    you have to know the first level folder name.
                    This is the key of course--to know the name of the shared folder or drive....unless the folder is shared it will not show up to be searched in by file.get_recurse(). But it will be shared as otherwise the application wouldn't work would it? hmmmm....think that is what I've found in using networked work stations......

                    Using File.Machines_get() does eliminate knowing the server name for the most part.
                    Mike
                    __________________________________________
                    It is only when we forget all our learning that we begin to know.
                    It's not what you look at that matters, it's what you see.
                    Henry David Thoreau
                    __________________________________________



                    Comment


                      #11
                      Re: datapath find

                      Dave,
                      I can do as you want now I believe. As the actual drive is not known and could be either a standard network shared drive (your scenario) or possibily a mapped drive for other users, the search would have to encompass both cases..... could easily add an optional argument to the function to default to both but be able to choose one or the other cases. If there are a lot of shared drives/folders/files it takes a while to run--about 3 or so minutes for 70 gigs of data in one run I made.

                      I will work on it tomorrow afternoon and post it then.....I just wanted you to know it is doable so you won't be still looking for a solution. It will be a function that you will simply enter the file that is to be found....and whether or not to limit the search to local/mapped drives, network drives, or both...2 arguments.
                      Mike
                      __________________________________________
                      It is only when we forget all our learning that we begin to know.
                      It's not what you look at that matters, it's what you see.
                      Henry David Thoreau
                      __________________________________________



                      Comment


                        #12
                        Re: datapath find

                        Dave,
                        Here is the function....a possibly addition would be to place a progress bar in the code as if there is a lot of shared drives and a lot of data it takes a bit to process---9 minutes to go through about 70 gigs over the (slow)network. Any questions just ask.

                        When choosing a Mapped drive I reversed the order as most times people choose the later letters for these and just this could speed up the find process I am thinking.

                        The file name should be made for sure UNIQUE to be sure the correct path is obtained....and has to have the file extension.

                        I added a global variable called var->apth as well as setting the function itself to have the path value....depends upon how you want to use it....
                        Code:
                        'Date Created: 08-Aug-2010 07:37:21 PM
                        'Last Updated: 09-Aug-2010 10:00:56 PM
                        'Created By  : MikeC
                        'Updated By  : MikeC
                        FUNCTION Path_Find AS C (File_name AS C, Search AS C ="MN")
                        'description: Choose a Filename that is unique and has been placed in the path to find.  Second argument defaults to searching both local/Mapped drives ="M" and Network drives = "N" when left blank.
                        '
                        '''==================NETWORKED DRIVE===========================
                        dim File_Name as c
                        dim mach as c
                        mach=File.Machines_get("S")
                        dim FilFind as C
                        dim pth as c
                        pth=""
                        '
                        if Search="MN" .or. Search="NM" .or. Search="N"
                            dim File_Name as c
                            dim mach as c
                            mach=File.Machines_get("S")
                        '    
                            dim FilFind as C
                            dim pth as c
                            pth=""
                            for each qi in mach
                                file.dir_put(qi)
                                pth=qi
                        '
                                FilFind=FILEFIND.GET_RECURSE(pth,File_name)
                                  if FilFind<>""
                                     dim full_pth as c
                                     full_pth=word_subtract(pth,File_name)+chr(92)
                                     goto found_path
                                  end if    
                            next
                            if (Search="NM" or Search="MN") .and. FilFind=""
                                goto Mapped
                            end if
                        '
                        end if
                        '
                        '''==================MAPPED DRIVE===========================
                        If Search="M"
                            mapped:
                            'sort descending so that the more likely later drive letters
                            '' of a mapped drive will be processed first
                            mach=SORTSUBSTR(a5_get_writeable_drives(),crlf(),"D")
                            mach=*for_each(qt,qt+chr(92),mach)'adds backslash for escape needed in .GET_RECURSE()
                            pth=""
                            for each qi in mach
                                file.dir_put(qi)
                                pth=qi
                        '
                                FilFind=FILEFIND.GET_RECURSE(pth,File_name)
                                  if FilFind<>""
                                     dim full_pth as c
                                     full_pth=word_subtract(pth,File_name)
                                     full_pth=strtran(pth,chr(92)+chr(92),chr(92))'takes out escape backslash
                                     goto found_path
                                  end if    
                            next    
                        end if
                        found_path:
                        Path_Find=full_pth
                        dim global apth as C
                        apth=full_pth
                        '
                        END FUNCTION
                        Here it is as an importable function
                        Last edited by MikeC; 08-10-2010, 12:30 AM.
                        Mike
                        __________________________________________
                        It is only when we forget all our learning that we begin to know.
                        It's not what you look at that matters, it's what you see.
                        Henry David Thoreau
                        __________________________________________



                        Comment


                          #13
                          Re: datapath find

                          Nice Mike!

                          Apparently the secret was the "S". Maybe as in "Oh s..., how did I miss that?" It's interesting how much difference one little detail can make.

                          Comment


                            #14
                            Re: datapath find

                            Thanks Cal,
                            As with most of my little discoveries, having others present functions/methods (as you did with File.Machines_get() ) that can be utilized as part of the solution makes it so much easier to figure them out. This happens often with puzzles that I solve....many times it is a group effort even if the other participants are not aware of their significant contributions. :)

                            Hope it does as Dave wants.
                            Mike
                            __________________________________________
                            It is only when we forget all our learning that we begin to know.
                            It's not what you look at that matters, it's what you see.
                            Henry David Thoreau
                            __________________________________________



                            Comment

                            Working...
                            X