File definition modifications
Before you can learn how to modify a file definition,
it is helpful to know how to create a file definition.
A file definition stores information about the structure
of a file, such as field names, what type of data each field
holds, and which fields to index.
Note: When you create a file definition, you can copy fields
and their properties (including validation and default and
calculation formulas) from other files. If you want to do
this, make sure the other files are open in the current window
before you begin, and at step 2 deselect New Window.
To create a file definition:
1. At the Superbase window, choose File/New/File.
2. In the New File dialog box, enter a name for the new file,
then click OK.
The File Definition dialog box appears.
The list in the top left of the dialog box shows other database
files that are open in the current window. You can use this
list to switch between file definitions. This is useful if
you want to copy fields or other information from one file
definition to another. You can use Copy and Paste to copy
fields from these files into the file definition you're creating.
3. To add a field to your file definition, double-click in
the Field Name column on a blank row, or click Add. In the
Add Field dialog box, enter a name for the field, and click
OK.
Note: You can use up to 15 characters in a field name, but
you mustn't begin a field name with a number, or include blank
spaces, or use reserved words.
4. To set the data type of the field, select one of these
data types from the Data Type list:
Text
External
Decimal
Long Integer
Integer
Date
Time
5. To set the display format of the field, double-click in
the Format column for that field, or click the Format button.
Superbase displays the appropriate Format dialog box for
the data type of the field you selected.
6. Repeat steps 3 through 5 for additional fields you want
to add.
7. To create indexes for the file, double-click in the Index
column, or click the Index button. In the Index Definition
dialog box, select the fields you want to use as indexes.
8. In addition, you can: assign further field properties,
add validation and calculation and default formulas, add comments
and status bar help for each field, rename fields, delete
fields, and assign passwords for data security. For more help
on these tasks, see Modifying a File Definition.
9. When you finish, click Save to save your changes to the
file definition.
Superbase displays your new file in the work space.
Exercise:
Create a new file called PEOPLE to hold the names and phone
numbers of PEOPLE in your organization. Add the following
fields, with properties similar to these…
First_Name Text 15 characters
Last_Name Text 15 characters Indexed
Phone_Number Text 20 characters Indexed
Full_Name Calculated Text 31 characters Formula= First_Name
+ " " + Last_Name Indexed
Building Number Text 10 characters
Once you have learned to create a new file definition, modification
is simply a matter of opening up the file in your Superbase
window (use the File, Open File command) and then selecting
the command to modify the file defintion, which is File, Modify
File. The File Defintion dialog will look similar to the following:

Once a file is open in the file definition panel, you can
make changes to it and SAVE them, or you can CANCEL out which
simply returns to the original definition of the file. |