AnsweredAssumed Answered

Design functions fail when filename has a dot in it

Question asked by danshockley on Aug 28, 2013
Latest reply on Nov 22, 2016 by beverly

Summary

Design functions fail when filename has a dot in it

Product

FileMaker Pro

Version

11, 12 (plus others?)

Operating system version

Mac OS X 10.8.3, iOS 6 (actually, any OS, though not tested on Windows)

Description of the issue

The Design functions (TableNames, TableIDs, LayoutNames, LayoutIDs, etc) fail when the file in question has a dot in its name. This is true for FileMaker 11, and continues to be a problem in FileMaker Pro 12 and FileMaker Go 12.
What seems to be happening is that those functions assume that whatever comes after the last dot in the "filename" parameter MUST be an extension and should thus be stripped off. This is the opposite behavior of what is returned by the Get ( FileName ) function, which is the name without the file extension. In other words, despite the fact that the parameter is labeled "filename," you MUST include some kind of (even completely false) file extension to avoid this bug.
When a file does not have an extra dot in its name, you can do the following to get a list of the layout names in a file:
LayoutNames ( Get ( FileName ) )
But, the same expression returns nothing when the file has a dot in its name before the one preceding the file extension.

Steps to reproduce the problem

1. Have a file named, for example, SomeFile.fmp12  (or SomeFile.fp7 if in versions before 12).
2. Open Data Viewer's "Watch" tab, add a new expression, and type in: LayoutNames ( Get ( FileName ) ), then click the "Monitor" button.
3. See that it provides a return-delimited list of the layout names in that file.
4. Close the file and rename it, for example, SomeFile.23.fmp12, then open it back up.
5. Look at what and notice that the expression entered before now returns nothing.
6. Modify the expression to: LayoutNames ( Get ( FileName ) & ".random_text" )
7. It works again, despite the fact that the value provided for the 'filename' parameter is ridiculous.

Expected result

The filename parameter should accept the same thing that the Get ( FileName ) function returns: the filename without a file extension. At the very least, it should attempt to use the filename provided AS-IS before stripping off whatever comes after a dot in the name. That should be a fall-back operation, not the default.

Actual result

The Design functions throw away the part of the file name after a dot, assuming anything after it is a file extension, and fail to provide the objects requested.

Exact text of any error message(s) that appear

N/A

Workaround

Throw on any file extension to the parameter, regardless of whether it is the real file extension or not. The important thing is to have something that is NOT the filename come after the final dot in the value submitted to the function.

Outcomes