Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3075 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

There appears to be a bug in FM9 (and probably prior) with the ValueListItems() function. If you pass a filename in the first parameter that contains a period, the function returns nothing. That is, if the actual name of the FM file on disk has a period in it (such as a file extention), then the ValueListItems function return "".

So.. if my filename is 'FMProDB' everything is fine. If it is 'FMProDB 1.0v1' the function fails.

This happens regardless of whether the first parameter is passed as a string literal (i.e. "MyDabase.fm7") or by using the Get(Filename) function as follows:

ValueListItems ( Get ( FileName ) ; "colors" )

I'm wondering if someone can verify this as a FM9 bug or not. I have only tested on Mac and would like to know if it also fails on Windows. Just create an empty database with a value list of custom values (i.e. colors, etc). Then use the Custom dialog script command (with the above line of code) to display the contents of the list. It will work if the filename has no period. It will fail if it does.

John

Posted (edited)

On Windows, I can confirm that, if file is Colors.v1.fp7 and I have value list called Colors and custom dialog is: ValueListItems ( Get ( FileName ) ; "Colors" ) ... that it does not work - it is blank. If I remove the period before v1, it works and lists the values.

UPDATE: Whether it is a bug or not ... I've always been taught never to have a period within name because the dot separates the file name from the extension. I suppose that's why most people wouldn't have noticed this oddity.

Edited by Guest
Added update
Posted

This is a known issue. It affects not only the ValueListItems() function, but any function that requires the file name. The solution is to include the file extension explicitly in the file name. This works even if you use Get (FileName) to return the file name dynamically:

ValueListItems ( Get ( FileName ) & ".fp7" ; "MyValueList" )

Of course, this is not required if you take care not to use period when naming your files.

This happens regardless of whether the first parameter is passed as a string literal (i.e. "MyDabase.fm7")

That is not my experience - maybe because I use the correct extension which is ".fp7"?

Posted

Thanks much for the .fp7 trick. That works fine.

But.. the bottom line is that this is a bug. If it is possible for an end user to completely hose your app by simply renaming the database file with a valid Finder or Windows Explorer name, something is wrong. Both Win and Mac handle a period in the name just fine -- even including the extention period.

Also.. if a period in the file name was invalid, then many other things in FM would break that do not such as relationships across multiple files, lookups across multiple files, etc.

They need to fix this.

Posted

Of course it's a bug. But if you use more than one file in your solution (and these days who doesn't), it will still be possible for the end user to ruin it by renaming a file - even if this bug is fixed.

  • 2 years later...
Posted

The problem is the period in the file name. Known issue. Adopt a file naming convention that does not allow periods. Problem solved.

  • 5 years later...
Posted
On April 20, 2011 at 6:57 PM, Vaughan said:

The problem is the period in the file name. Known issue. Adopt a file naming convention that does not allow periods. Problem solved.

Here is the bug report and discussion on this long-standing FileMaker bug. 

https://community.filemaker.com/thread/133594

Please don't say "problem solved" when there is a bug that prevents people from doing very typical work behavior. Mac and Windows both allow non-file-extension-preceding periods/dots in file name, and most apps work properly, unless that app has a bug. Users should be able to rename files, unless you are saying FileMaker should only be used in very controlled corporate environments. In that case, FileMaker Inc. will need to adjust their priorities in what features they push, right? ;-) 

Posted

Developer Utilities is the only safe method of changing file names by changing all file references at same time.

As for ValueListItems() and if referencing local file, this works:

ValueListItems ( "" ; "your value list name" )

By not specifying the file name, FileMaker assumes it is the local file so you can safely rename the file.  That does not protect from multi-file solutions however.

I should add ... even if you only have a single file, renaming the file can break import scripts referencing the same file.  Nowadays, we set variables with the path and use it instead but before variables, imports were easily broken.

Posted
26 minutes ago, LaRetta said:

As for ValueListItems() and if referencing local file, this works:

ValueListItems ( "" ; "your value list name" )

Is this documented anywhere?

Posted

I don't think so.  I read it somewhere in a blog late one night and haven't been able to find it since.  :tongue2:

I tested it and it does work for many functions in versions 12 and up.

I haven't tried versions prior to 12.

This topic is 3075 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.