In my last article I started explaining fields. So I thought I'd continue, as they are the building blocks for everything else.
One of the basic choices, after creating a field, is whether to "index" it. If a field is indexed, it means that FM stores a special list of its contents, ready to use quickly. It then uses this list to do Finds and other operations rather than having to go back and read the field again.
You can reach the indexing dialog by hitting the button at the bottom of the Options dialog box, labelled Storage Options.
There are usually three choices; Indexing on, indexing off, but available if needed, and indexing permanently off. The middle one is the default. It happens automatically if you don't specify one of the others, so usually you don't have to do anything. The first time you run an operation such as a Find on that field, FM takes a little time to index it. But then the next time you do a Find it's very fast.
There are a few situations where you would want to check the "indexing off" box (as well as some when FM won't let you index a field anyway). One would be if you have file storing very long text passages in a field, and you don't want searches performed on the text itself. Indexing would require a lot of disk space. And only the first 60 characters would be indexed anyway, so the rest would be left unstored. It would be better to add a small "keywords" field of the main concepts for indexing and searching.
The main use of not indexing is to force a field to update. This allows you to use the Status functions to give you current values, useful for such things as the found record count. Normally status functions only calculate once. FM does this operation itself, displaying the value in the status bar on the left of the window. But that status bar takes up a lot of real estate. You can create your own fields to display the same info. Then you can put them wherever you want and hide the status bar, allowing a much wider layout.
Status Bar "Box"
To do this first create a Calculation field, with the formula: Status(CurrentFoundCount). Hit the Storage Options button and check, "Do not store calculation results."
If you want to see the relative number of each record as well, just type @@ with the text tool while in layout mode. The reason I say "relative" is that it changes, depending on its position in the found set. It only tells you where it is in relation to the other found records (for an unchanging record serial number see my previous month's article). The unstored calculation, Status(CurrentRecordNumber) gives you the same thing as @@ (as far as I can tell).
Another number you might want to see is the total number of records in the database. This would also be an unstored calculation: Status(CurrentRecordCount). It will remain the same unless you add or delete records.
To duplicate the navigation controls, draw a couple of arrow objects (or just type ">"), then change them to Buttons (Format Menu). The Specify Buttons dialog will appear. Under Navigation, choose Go to Record/Request/Page, and Next (in the drop-down box). Choose Previous for the left arrow. You could also add little bars for Go to Record, First and Go to Record, Last.
Here's a picture of what it could look like (yours would look better). ![]()
The @@ would display the "relative" current record number.
Unindexed :-(
I've found one small kink relating to indexing. If, for some reason, you've caused indexing to be turned off for a field, then you have to go in and turn it back on again. Say you have a indexed calculation field, and you change one of the referenced fields in such a way that it can no longer be indexed. If you make it a global field or based on a relationship, then FM will turn indexing off.
You'll notice, because even though everything still works, and displays the correct data, any operation using the field slows way way down. Even if you fix the problem, by changing the referenced field back to a valid "indexable" type, the "indexing off" box will remain checked until you manually uncheck it. You're not likely to run into this problem if you always know what you're doing; so how is that I know about it?
Paste from Index You can view and paste values from the Index directly by choosing Paste Special, From Index (Edit Menu), or Cmd-I. All the indexed values drop down. Type the first letter or couple of letters to scroll, then just hit return or enter to paste a value. You can view them as individual words, or entire entries (to keep certain words together when viewed by individual words, type an Option-space instead of a space).
Send comments, questions, toys to Fenton Jones