Relative File Path

Version 2

     

    Custom Function

     

    Compatibility
    Creator
    Mac OS X, Windows
    Todd Duell
    FMP 8.5, 9, 10, 11
    Formulations Pro
    Web: No
    File Type: ZIP
    Server: Yes
    FileSize: ~ .28 megabytes
    http://www.formulationspro.com

    Description

    If you need to define a relative path from your database to a file defined by a calculation or a script in your database you need to find a way to make the path dynamic. The best way to do this is to define a custom function to handle the path generation for you. You might be asking yourself where this technique would possibly be used? It can be used for web site development to locate files and images, the web viewer (FileMaker 8.5) to view files on your computer, storing printed files to a defined location, saving files on a shared file server, etc. The technique is far more useful that you may imagine. However, when you actually try to get it to work for the first time you may find that it's more of a task to program that you had anticipated. Even if you don't have FileMaker Advanced to write custom functions, you can still use this technique in a calculation or a script to define a variable. It works best in FileMaker Pro 8.5, but can also be used to work with 8.0 and 7.0. This article will demonstrate the utility of the custom function with FileMaker Pro 8.5 and the web viewer to view a file in a relative location from the Path.fp7 database.

     


    Code

     

    Sample Input

    Sample Output


    Developer's Notes

    See sample file for full demo and technical article.

     


    FileMaker Inc. provides this content on an “As Is” basis, without any warranty, and subject to the terms of the FileMaker Technical Network Agreement. FileMaker makes no representations and is not liable for any content or related information. You may use the content as part of your own solutions and for your customers, but you may not otherwise publicly distribute any content that you did not submit. ©2009-2011 FileMaker, Inc. All Rights Reserved. FileMaker is a trademark of FileMaker, Inc. registered in the U.S. and other countries.