Cal11 calculator

How Do You Put A Tab in A Filemaker Calculation

Reviewed by Calculator Editorial Team

When working with FileMaker calculations, you may need to insert tab characters to format text output or create structured data. This guide explains how to properly insert tabs in FileMaker calculations using different methods.

Basic Method Using Char()

The most reliable way to insert a tab character in a FileMaker calculation is by using the Char() function. The ASCII code for a tab character is 9.

// Basic tab insertion Let ( tabChar = Char(9); result = "First part" & tabChar & "Second part" ) result

This method works in all versions of FileMaker and is the most straightforward approach. The Char() function takes the ASCII code as its parameter and returns the corresponding character.

Alternative Methods

Using Unicode Character

You can also use the Unicode character for tab (U+0009) directly in your calculation:

// Unicode tab character "First part" & " " & "Second part"

Using Substitute Function

For more complex scenarios, you can use the Substitute function to replace a placeholder with a tab:

// Substitute method Substitute("First part|Second part", "|", Char(9))

Note: The Substitute method is useful when you need to format text that already contains tab placeholders.

Practical Examples

Here are some practical examples of how to use tabs in FileMaker calculations:

Creating Tab-Delimited Output

For generating tab-delimited text for export:

// Tab-delimited output Let ( tab = Char(9); header = "Name" & tab & "ID" & tab & "Department"; row1 = "John Doe" & tab & "12345" & tab & "Marketing"; result = header & Return & row1 ) result

Formatting Report Output

For creating aligned columns in reports:

// Formatted report Let ( tab = Char(9); line1 = "Product:" & tab & tab & "Price:" & tab & "Quantity"; line2 = "Widget A" & tab & tab & "$19.99" & tab & "5"; result = line1 & Return & line2 ) result

Common Pitfalls

When working with tabs in FileMaker calculations, be aware of these common issues:

  • Invisible Tabs: Tabs may not be visible in the calculation result if your output method doesn't preserve whitespace.
  • Export Issues: Some export formats may not properly handle tab characters, causing data to appear misaligned.
  • Version Differences: While Char(9) works in all versions, some older FileMaker versions might have different behavior with Unicode characters.

Tip: Always test your tab-delimited output in the actual destination system where you'll be using the data.

FAQ

Can I use tabs in FileMaker Pro Advanced calculations?
Yes, all the methods described in this guide work in FileMaker Pro Advanced.
How do I make tabs visible in a calculation result?
Use the View as List View or View as Table View layout modes to see tabs as separators between fields.
Are there any limitations to using tabs in calculations?
The main limitation is that some export formats may not properly handle tab characters, so always test your output.
Can I use tabs in web viewer calculations?
Yes, tabs work in web viewer calculations as long as the receiving application can interpret them.
Is there a way to insert multiple tabs in one calculation?
Yes, you can concatenate multiple Char(9) functions or use repeated Substitute functions for multiple tabs.