Brian Dunning's FileMaker Custom Functions

SortTitle ( title ; language )

Outputs sortable string for book and movie titles and company names by placing leading definite or indefinite article at end of string for any of six dozen languages

  Be the first to rate this function Log in to vote

Adam Sugerman   Adam Sugerman - Show more from this author

  Sample input:
SortTitle ( "L'Étranger" ; "French" )
  Sample output:
"Étranger, L'"

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Function outputs a sortable string for book and movie titles and company names by placing leading definite or indefinite article for specified language at end of title. Designed to handle multiword articles and articles suffixed by an apostrophe or hyphen.

List of articles for each language is based on U.S. Library of Congress bibliographic index of "Initial Definite and Indefinite Articles," at www.loc.gov/marc/bibliographic/bdapndxf.html, retrieved 2026-11-06. Breton, Luxembourgish and Romansh added independently of LOC index.

Function defaults to English when a value for language isn't supplied or the input value doesn't match existing values in dictionary. The default language can be changed by setting the value "English" in the variable declaration ~lang to a given system's default language.

An additional 28 languages that don't use leading articles are included in the dictionary with empty article lists to prevent the function from defaulting to default language when titles for the input language are entered using a word that matches an article in the default language.

IN:
title = title to be sorted, e.g., "The Bookstore"
language = language of title (optional; defaults to English)

EXAMPLES:
SortTitle ( "The Bookstore" ; "English" ) => "Bookstore, The"
SortTitle ( "For Whom the Bell Tolls" ; "English" ) => "For Whom the Bell Tolls"
SortTitle ( "Al-Mu'allaqat" ; "Arabic" ) => "Mu'allaqat, Al-"
SortTitle ( "L'Étranger" ; "French" ) => "Étranger, L'"
SortTitle ( "Ang mga Ibong Mandaragit" ; "Tagalog" ) => "Ibong Mandaragit, Ang mga"
SortTitle ( "Parthiban Kanavu" ; "Tamil" ) => "Parthiban Kanavu"

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 22 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: