Older Entries »
August 28th, 2010

Working with Fonts

In the last few days I worked on my template database again. I use it as a storage place and work of reference of ideas, features, and solutions I developed with FileMaker. It includes a basic collection of custom functions, default scripts for trigger management, and design samples.

Designing a good looking layout is a challenge in itself. But when you try to use the same layout in both worlds, Mac OS and MS Windows, raises the challenge quite a bit. Main problems are the font. There are only few fonts available in both systems. But having the same name does not make it the same font. Text formatted in the same font might have different width and height – resulting in really ugly layouts.

There are different ways to redress these problems:

  • Oversize all labels and fields
  • Use conditional formatting
  • Use hidden tab controls for each operating system
  • Create separate layouts for each operating system

Often, you will use a mixture of different solutions. But to master these challenges you should know a little bit about the fonts in Mac OS and MS Windows.
Read more …

August 15th, 2010

A portal is a window to a related table. When you create a portal, you define the related table and the number of rows to be shown. Besides some other options you can also decide, whether the portal shall have a vertical scroll bar. Unfortunately FileMaker does not offer a direct way to change this option during run-time.

The size of the portal – and therefore the number of rows – may change at run-time. This will happen when you set vertical autosize option for the portal. Changing the height of the layout window will also change the size of the portal. There is no FileMaker function to get the number of actual visible portal rows. Even with such a function, you can not turn off the scroll bar when fewer records are shown in the portal.

To overcome this problem, I wrote two custom functions. These functions and a invisible object create an effect that will hide the portal scroll bar when fewer records than available portal rows are shown.

Read more …

An update for FileMaker Pro 11 and FileMaker Pro 11 Advanced was released today. You should download it to take advantage of all the changes and updated features:

New in FileMaker Pro 11.0v2

Changes in:

  • Field Definition
  • Recovery
  • Snapshot Link
  • Scripting
  • Quick Find
  • Value Lists
  • Printing (rotated text issue)
  • Runtime (Internet access issue; missing Microsoft Visual C++ libraries issue)
  • Plug-ins
  • General (empty merge variables issue; portal flicker (Windows), and others)
  • Excel Import (Japanese furigana issue)
  • IWP
  • xDBC

For detailed information read the release notes at the FileMaker Support pages. There you will find also links to the appropriate update files for the different FileMaker versions.

June 9th, 2010

As a developer you might need a timer in your database. In that case you might find this feature helpful. You can create timer, as many as you like. Use them for benchmarks, to log import and export times, or to keep track of user log-in times.

Stop Watch

Each timer works like a little stopwatch. You can …

  • start it,
  • stop it,
  • restart/stop it again,
  • read the elapsed time,
  • and reset/remove it.

This is accomplished with custom functions and a global variable:

  • timer( name; action )
  • param( key; value )
  • param.get( key; params )
  • param.delete( key; params )
  • $$timer

Read more …

April 20th, 2010

What is the simplest custom function with a purpose you can write in FileMaker?
The answer is a custom function with only one character – and that includes the function name and parameters.

The Power of One

My simplest custom function has only a name. And it is the shortest possible name, a single character. The character I choose is the underscore. The function does not expect any function parameters and calculates and returns nothing.

Function _( )
/* no content */

The custom function is so simple I had to add this comment here, otherwise my custom function box would look just odd.

Why is there no content in the function body? Or, a better question, what does the function do?

This function will return an empty string (“”). And this should give you a clue, how to use the function. You can use this function wherever you would use an empty string:

  • Check whether fields or variables are empty
  • Initialize or ‘delete’ variables
  • For Let functions returning nothing (used to set global variables)
  • For ‘optional’ parameters in custom function you do not want to fill
  • For evaluation expression to avoid excessive use of the escape character

This also explains why I choose the underscore for the name of this custom function. The underscore looks like a placeholder or something empty and therefore resembles best the purpose and meaning of the function.

Example of Use

Compare for empty value:

If( $value = _; ... )

Delete global variables and return nothing from a Let function:

Let( $$counter = _; _ )

Call a custom function with optional parameter and keep that parameter undefined. In this example the function myFunction expects three parameter, but the second and third parameter are optional and do not require any value. I cannot really skip these parameters in FileMaker, but with the underscore I can indicate, I do not assign a specific value to them.

myFunction( "Arnold"; _; _ )
myFunction( "Kegebein"; _; 1 )

Avoid excessive use of the escape character. Without my custom function you would have to use some escape characters. That makes it harder to read and understand the expression.

Evaluate( "Let( $$X = _; _ )" )
//--- Without the custom function:
Evaluate( "Let( $$X = \"\"; \"\" )" )

Almost no day goes by without me using this function.

Older Entries »