tags:

views:

82

answers:

2

Hi,

I'm trying to create a Table of Contents for a small publication using Filemaker 10, since that's what the data has been stored in previously.

I'm able to generate page numbers, add heading to the TOC and pretty much everything else I've needed to do - one thing withstanding.

Our designer wants to fill each TOC line with "." to make it easier to read.

Currently:

Using Stack Overflow                                                  1
Why Reddit is better than digg                                        7
Does Filemaker really suck this much                                 84
Ways to convince bosses                                              92
Ditching FileMaker                                                   97

Wanted:

Using Stack Overflow..................................................1
Why Reddit is better than digg........................................7
Does Filemaker really suck this much.................................84
Ways to convince bosses..............................................92
Ditching FileMaker...................................................97

The item and page number are in different fields. Using a border is unsatisfactory because it underlines everything.

Solutions?

+2  A: 

Brenton,

You need to break it up into bits and then put it back with the right spacing. Something like this would do :

Let ( [

text = "Why Reddit is better than digg........................................7" ; 
len = Length ( text ) ; 
end = RightWords ( text ; 1 ) ; 
lenEnd = Length ( end ) ;
lenStart = Length ( Trim ( Right ( text ; len - lenEnd ) ) ) ] ;

Left ( text ; lenStart ) &
Left ( "..........................................................................." ; len - lenStart - lenEnd ) & 
end )

I've built the "text" variable into the calc for testing, but you could do this as a Custom Function or just inside a calculation with the field instead.

Also this assumes you're using a mono spaced font and the gap in the middle is a space character.

Cheers, Nick

Nicholas Orr
Nice solution - though I would really prefer a solution that doesn't require the use of a mono spaced font.
Brenton C
+3  A: 
Sam Barnum