A good example that we never stop learning. I’ve been forced to do a job using FileMaker 14 ( ), whch has led to discovering that a function released in FMP v6 can break in all FMP versions Mac or Windows depending on the way the file is named.
The file I had been given was named in the format ‘FileName v1.2.1’, I know periods are not recommended in file names, but this was someone else’s file I was adding functionality to.
Simply, the FieldNames (filename ; layoutname) function fails if the file name includes a period.
Time lost tracing this one, but richer for the knowledge. I replaced the periods with underscores in the file name and trapped for this within the startup script to prevent the client reverting.
@tonywhitelive, I'm guessing that the gotcha for using the FieldNames function when the layout name and TO name are the same is that the function has to decide whether to return all field names ( TO name wins ) or return only the field names on the layout ( layout name wins ). Do we know which object wins?
I've been hit by similar problems from multiple different languages/commands. My rule of thumb... only use alpha characters and underscores, and maybe numbers. Anything that could be considered a word break can cause unintended consequences. The only time in production code that I deviate from this when writing new code, is using a '-' for a data separator for a report that I'm emailing.