ACI 4D Insider Reference Guide

®
4D Insider
Reference
Mac™OS and Windows® Versions
4D Insider
© 1999 ACI SA
4D Insider Reference
Version 6.5 for Mac™ OS and Windows
Copyright © 1999 ACI SA/ACI US, Inc. All rights reserved.
The Software described in this manual is governed by the grant of license in the ACI Product Line License Agreement provided with the Software in this package. The Software, this manual, and all documentation included with the Software are copyrighted and may not be reproduced in whole or in part except for in accordance with the ACI Product Line License Agreement.
4th Dimension, 4D, 4D Insider, the 4D logo, 4D Server, ACI, and the ACI logo are registered trademarks of ACI SA.
Microsoft and Windows are registered trademarks of Microsoft Corporation.
Apple, Macintosh, Mac, Power Macintosh, LaserWriter, ImageWriter, ResEdit, and QuickTime are trademarks or registered trademarks of Apple Computer, Inc.
All other referenced trade names are trademarks or registered trademarks of their respective holders.
®
IMPORTANT LICENSE INFORMATION
Use of this Software is subject to the ACI Product Line License Agreement, which is provided in electronic form with the Software. Please read the ACI Product Line License Agreement carefully before completely installing or using the Software.

Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
About this Manual. . . . . . . . . . . . . . . . . . . . . . . . . ix
Cross-Platform Considerations . . . . . . . . . . . . . . . .ix
Chapter Descriptions . . . . . . . . . . . . . . . . . . . . . ix
Hypertext Navigation. . . . . . . . . . . . . . . . . . . . . x
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . xi
Chapter 1 Introduction. . . . . . . . . . . . . . . . . . . 13
Object Relationships. . . . . . . . . . . . . . . . . . . . . . . 13
The Browser Window . . . . . . . . . . . . . . . . . . . . . . 15
Customizing 4D Insider . . . . . . . . . . . . . . . . . . . . . 16
STR# Resources . . . . . . . . . . . . . . . . . . . . . . . . . 16
Chapter 2 Opening a Database . . . . . . . . . . . . . . 17
Running 4D Insider . . . . . . . . . . . . . . . . . . . . . . . 18
Opening Databases . . . . . . . . . . . . . . . . . . . . . . . 18
Memory Management . . . . . . . . . . . . . . . . . . . 20
Opening a Database Locally . . . . . . . . . . . . . . . . 20
Opening a Database on a Server . . . . . . . . . . . . . . 21
Creating a New Database . . . . . . . . . . . . . . . . . . . . 22
Reparsing a Database . . . . . . . . . . . . . . . . . . . . . . 23
Opening Preferred Files (Mac OS only) . . . . . . . . . . . . . 24
Opening Recently Used Files (Windows only) . . . . . . . . . 26
Creating a Database from an SQL Description File . . . . . . . 27
Supported Verbs . . . . . . . . . . . . . . . . . . . . . . 27
Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
General Preferences . . . . . . . . . . . . . . . . . . . . . . . 30
Welcome Window . . . . . . . . . . . . . . . . . . . . . 30
Display Open File Dialog . . . . . . . . . . . . . . . . . . 31
Closing a Database. . . . . . . . . . . . . . . . . . . . . . . . 31
Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Creating a Library. . . . . . . . . . . . . . . . . . . . . . 32
Saving a Library. . . . . . . . . . . . . . . . . . . . . . . 34
Opening a Library . . . . . . . . . . . . . . . . . . . . . 35
Using Libraries in a Multi-Platform Environment . . . . . 36
4D Insider Reference Manual
iii
Contents
Chapter 3 Viewing Database Objects . . . . . . . . . . . 39
Viewing Objects . . . . . . . . . . . . . . . . . . . . . . . . . 40
Selecting an Area within the Browser Window . . . . . . . 41
Types of Objects Displayed . . . . . . . . . . . . . . . . . 41
Viewing Related Objects. . . . . . . . . . . . . . . . . . . 44
Viewing an Object’s Contents . . . . . . . . . . . . . . . . . . 46
Commands . . . . . . . . . . . . . . . . . . . . . . . . . 46
Constants . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Database Methods . . . . . . . . . . . . . . . . . . . . . . 46
Fields and Subfields . . . . . . . . . . . . . . . . . . . . . 47
Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Form Methods . . . . . . . . . . . . . . . . . . . . . . . . 51
Formats/Filters. . . . . . . . . . . . . . . . . . . . . . . . 51
Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Menu Bars . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Project Methods . . . . . . . . . . . . . . . . . . . . . . . 54
Named Selections . . . . . . . . . . . . . . . . . . . . . . 54
Object Methods . . . . . . . . . . . . . . . . . . . . . . . 54
Picture Libraries . . . . . . . . . . . . . . . . . . . . . . . 54
Plug-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Semaphores . . . . . . . . . . . . . . . . . . . . . . . . . 55
Sets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
STR# Resource . . . . . . . . . . . . . . . . . . . . . . . . 55
Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . 56
Subtables. . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Using the Lists in the Browser Window . . . . . . . . . . . . . 57
Selecting a List. . . . . . . . . . . . . . . . . . . . . . . . 57
Scrolling Through a List . . . . . . . . . . . . . . . . . . . 57
Typing Characters to Select an Object in a List. . . . . . . 57
Creating a Subset of Selected Objects in a List . . . . . . . 57
Filtering the Objects Displayed in a List . . . . . . . . . . 58
Selecting All the Objects in a List . . . . . . . . . . . . . . 59
Moving the Used By or Uses List to the Main List . . . . . 59
4D Insider Reference Manual
iv
Contents
Organizing the Browser Windows. . . . . . . . . . . . . . . . 61
Resizing Browser Window Components . . . . . . . . . . 61
Changing the Location of the Lists. . . . . . . . . . . . . 61
Changing the Default Size of the Browser Window . . . . 62
Displaying ID Numbers of Objects . . . . . . . . . . . . . 63
Organizing Multiple Browser Windows . . . . . . . . . . 65
Chapter 4 Using Filters . . . . . . . . . . . . . . . . . . . 67
Adding and Modifying Filters . . . . . . . . . . . . . . . . . . 68
Saving Filter Definitions . . . . . . . . . . . . . . . . . . 68
Adding a Filter . . . . . . . . . . . . . . . . . . . . . . . 69
Modifying a Filter. . . . . . . . . . . . . . . . . . . . . . 73
Changing the Name of a Filter . . . . . . . . . . . . . . . 74
Deleting a Filter . . . . . . . . . . . . . . . . . . . . . . . 75
Modifying the Filter Pop-up Menus . . . . . . . . . . . . 75
Applying Filters Within the Selection. . . . . . . . . . . . . . 77
Applying Anti-filters . . . . . . . . . . . . . . . . . . . . 77
Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Filter for Unused Objects . . . . . . . . . . . . . . . . . . 77
Filter for Local Variables . . . . . . . . . . . . . . . . . . 79
Filter for All Methods . . . . . . . . . . . . . . . . . . . . 80
Filter for All Menu Methods . . . . . . . . . . . . . . . . 81
Filter for All Process Methods. . . . . . . . . . . . . . . . 82
Chapter 5 Searching and Replacing . . . . . . . . . . . . 83
Searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Using Multiple Search Criteria . . . . . . . . . . . . . . . 86
Renaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Renaming a Single Object . . . . . . . . . . . . . . . . . 88
Replacing a String in a Selection of Objects . . . . . . . . 90
Prefixing a Selection of Objects. . . . . . . . . . . . . . . 92
Replacing Text in Forms and Tips . . . . . . . . . . . . . 95
Replacing Commands . . . . . . . . . . . . . . . . . . . 96
4D Insider Reference Manual
v
Contents
Chapter 6 Using Groups . . . . . . . . . . . . . . . . . . 99
Creating a Group . . . . . . . . . . . . . . . . . . . . . . . . 100
Opening an Existing Group . . . . . . . . . . . . . . . . . . 101
Moving Objects to a Group . . . . . . . . . . . . . . . . . . 101
Creating a Group From a Selection . . . . . . . . . . . . . . 102
Creating a Group With Dependencies . . . . . . . . . . 103
Removing an Object from a Group . . . . . . . . . . . . . . 104
Performing Operations on Objects in Groups . . . . . . . . . 104
Ungrouping/Deleting a Group . . . . . . . . . . . . . . . . . 105
Chapter 7 Moving Objects . . . . . . . . . . . . . . . . 107
Movable Objects . . . . . . . . . . . . . . . . . . . . . . . . 107
Objects Moved Together . . . . . . . . . . . . . . . . . . . . 108
Moving an Object . . . . . . . . . . . . . . . . . . . . . . . 108
Performing a Move . . . . . . . . . . . . . . . . . . . . 109
Controlling the Questions Generated. . . . . . . . . . . 111
Answering the Questions . . . . . . . . . . . . . . . . . 111
Description of the Possible Responses . . . . . . . . . . 113
Setting Preferences for Moving. . . . . . . . . . . . . . . . . 116
Defining Delimiter Objects . . . . . . . . . . . . . . . . . . 118
By Type of Object . . . . . . . . . . . . . . . . . . . . . 118
By Object . . . . . . . . . . . . . . . . . . . . . . . . . 119
Chapter 8 Documenting Objects . . . . . . . . . . . . . 121
Creating Documentation. . . . . . . . . . . . . . . . . . . . 121
Opening the Documentation Window . . . . . . . . . . 122
Changing Font, Font Size, Style and Color of Text . . . . 123
Setting the Delimiter Object Option . . . . . . . . . . . 123
Viewing the Date of the Last Modification . . . . . . . . 123
Deleting Documentation. . . . . . . . . . . . . . . . . . . . 124
Printing Documentation . . . . . . . . . . . . . . . . . . . . 125
Creating General Documentation . . . . . . . . . . . . . . . 125
Creating Documentation in a Multi-User Environment . . . 126
4D Insider Reference Manual
vi
Contents
Chapter 9 Localizing Databases . . . . . . . . . . . . . 127
Using STR# Resources in the 4D Environment . . . . . . . . .128
Localizing Menus and Menu Items. . . . . . . . . . . . . 128
Localizing Buttons . . . . . . . . . . . . . . . . . . . . . 130
Localizing Text Areas . . . . . . . . . . . . . . . . . . . . 131
Using STR# Resources in the 4D Insider Environment . . . . . 132
Converting Text to an STR# Resource . . . . . . . . . . . 132
Editing an STR# Resource. . . . . . . . . . . . . . . . . . 134
Converting an STR# Resource to Text . . . . . . . . . . . 135
Chapter 10 Printing and Exporting . . . . . . . . . . . . 137
Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Exporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Exporting Objects on the Macintosh. . . . . . . . . . . . 139
Exporting Objects in Windows. . . . . . . . . . . . . . .141
Appendix A Keyboard Shortcuts . . . . . . . . . . . . . . . . . . . . . 143
Appendix B Customizer Plus Utility . . . . . . . . . . . . . . . . . . .145
Customizing 4D Insider . . . . . . . . . . . . . . . . . . . . . 145
Types of Option Settings . . . . . . . . . . . . . . . . . . . . 146
Translation of Commands . . . . . . . . . . . . . . . . .146
Script Manager . . . . . . . . . . . . . . . . . . . . . . . 146
Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . .147
Conversions. . . . . . . . . . . . . . . . . . . . . . . . . 148
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149
4D Insider Reference Manual
vii
Contents
4D Insider Reference Manual
viii

Preface

4D Insider is a utility for cross-referencing objects in your databases as well as for copying objects from one database to another. It is one of several tools that, together with 4th Dimension, comprise the 4th Dimension environment.

About this Manual

Cross-Platform Considerations

Chapter Descriptions

This manual introduces 4D Insider and explains how to use it on both the Windows® and Mac™ OS (Power Macintosh) platforms. Although the concepts and functionality of both versions of 4D Insider are nearly identical, the manual addresses any differences where necessary. Such differences may include the graphical user interface and keyboard commands.
The graphics in this manual illustrate 4D Insider in the Windows 95 environment. The two versions of the same screen are only presented if there are any major differences between them.
This manual is divided into the following chapters:
Chapter 1, “Introduction,” provides an overview of 4D Insider.
Chapter 2, “Opening a Database,” describes how to run 4D Insider and open and close databases and libraries.
Chapter 3, “Viewing Database Objects,” discusses how to use
4D Insider’s main window to view the cross-references for objects and to view the objects themselves.
Chapter 4, “Using Filters,” explains how to use filters to select which types of objects you want to view.
4D Insider Reference Manual
ix
Preface
Chapter 5, “Searching and Replacing,” explains how to search for an object and how to replace object names throughout a database or library.
Chapter 6, “Using Groups,” describes how to organize objects into groups.
Chapter 7, “Moving Objects,” explains how you can move objects
from one database or library to another.
Chapter 8, “Documenting Objects,” explains how you can add
documentation for the objects in your database and for the database itself.
Chapter 9, “Localizing Databases,” explains how to create and edit STR# resources used in place of static text in your menus, buttons, and forms when you localize an application for another language.
Chapter 10, “Printing and Exporting,” explains how to print or export information about database objects.
Appendix A, “Keyboard Shortcuts,” lists the keyboard command
shortcuts used in 4D Insider.

Hypertext Navigation

Appendix B, “Customizer Plus Utility” describes how you can customize 4D Insider using the Customizer Plus program.
If you are reading this manual in electronic format (Adobe™ Acrobat PDF), you can take advantage of the hypertext links that it contains. Each word that appears in blue has a hypertext link. However, this principle does not apply to the “Table of Contents” and “Index” because each entry already has a hypertext link.
When you click a hypertext link, you immediately move to the page that contains more information. To return to your original page, click the Previous page button .
You can also navigate the document by clicking the bookmarks, which are located to the left of the window that displays the manual pages.
4D Insider Reference Manual
x
About this Manual

Conventions

Note
4D Server
This manual uses certain conventions to help you understand the material.
The following explanatory notes are used:
Text emphasized like this provides annotations and shortcuts that will help you use 4
th
Dimension more productively.
Throughout the manual, 4th Dimension and 4D Server/4D Client are referred to simply as 4th Dimension. Differences between the operation of the two products are explained in 4D Server notes, which provide information about using 4D Server/4D Client. This information is provided only when the operation of 4D Server/4D Client differs from that of 4th Dimension.
Notes like this alert you to important pieces of information and alert you to situations where data might be lost.
In addition, all table names are shown in brackets in the text to help distinguish them from the names of fields, forms, and other items. For instance, the Companies table is written as the [Companies] table.
4D Insider Reference Manual
xi
Preface
4D Insider Reference Manual
xii
1

Introduction

4D Insider allows you to cross-reference objects in your databases. You can select any database object — table, form, method, menu, and so on — and view its relationship to other objects in the database. You can also view the objects themselves as well as change their names. You can also modify STR# resources, by replacing the names of objects and modifying STR# resources which are collections of text strings that are used for menus, button text, and static text on forms.
In many cases, you will find that you use the same objects in more than one database. You can use 4D Insider to move objects from one database or library to another. A create within 4D Insider to store elements commonly used in your databases.
library
is a special file that you can
For new databases, you can accelerate the creation of new databases by reusing objects that you have created in other databases. You can also modify the objects in one database and then update all the databases that use these objects.

Object Relationships

By their nature, objects in a database are interrelated. At the highest level, a table is related to its fields. A table is also related to at least one form. In turn, that form is related to the objects that it uses (fields, scripts, and so on).
4D Insider Reference Manual
13
Chapter 1 Introduction
The following figure shows the relationship between a form and the objects that it uses:
Form method
Field
Form
Object method
Menu bar
This form is also used by other objects. A form is always used by a table, but it may also be used in procedural statements. For example, the name of the form may be used in a method as a parameter to the
INPUT FORM
command.
Form method
Table
Project Method
These types of relationships between objects are called
Field
Object method
Menu bar
cross-references
because they show which objects refer to or use each other. You can view the cross-references in the 4D Insider browser windows.
By default, the lists in the browser show every type of object identified by 4D Insider. You can also define your own object types.
4D Insider Reference Manual
14

The Browser Window

The 4D Insider browser window is divided into three sections. The top section displays lists of the database objects and their relationships. The three lists are:
Main
: Displays the database object.
The Browser Window
Lists
Information area
Object Contents area
Used by
: Displays the objects that use the object selected in the Main
list.
Uses
: Displays the objects used by the object selected in the Main list.
The middle section of the screen is the Information area. Information about the object selected in the Main list is displayed in this section of the window.
The bottom of the screen is the Object Contents area in which the contents of an object are displayed.
4D Insider Reference Manual
15
Chapter 1 Introduction
Customizing 4D Insider
You can use Customizer Plus to change the Font, Script Manager, Translation, Methods, and Conversions settings for 4D Insider.
You can change the fonts and font sizes used in the 4D Insider application itself, in the pop-up menus, and those used for printing.
The Script Manager allows you to disable the styles in the method editor, and to modify the comparison table used for searching and sorting.
The Translation resource lets you specify the language used to display 4th Dimension commands in 4D Insider.
The Methods resource allows you to specify the colors in which different procedural elements are displayed.
The Conversions resource allows you to modify the internal table used by 4D Insider to convert strings and texts from one platform to another.
For more information about customizing these resources, refer to
Appendix B of this manual and the
Customizer Plus Reference
.

STR# Resources

4D Insider Reference Manual
16
STR# resources are collections of text strings that are used for menus, button text, and static text on forms. Instead of hard-coding text for menus, buttons and forms, you can reference an STR# resource by number.
Localizing databases is much easier when you use STR# resources. Instead of modifying each form, menu or button, you just modify the STR# resource.
You use 4D Insider to create and edit STR# resources on either the Macintosh or in Windows. You can also use a resource editor, such as ResEdit™ to edit on the Macintosh.
For information about using, creating, and modifying STR# resources with 4D Insider, refer to Chapter 9.

2 Opening a Database

To examine a database with 4D Insider, you must first open it. If you open more than one database, you can copy objects between them.
In many cases, you will find that you use the same objects in more than one database. A library is a special file that you can create within 4D Insider to store elements commonly used in your databases. Using libraries, you can maintain a copy of a set of objects, which can later be reused in other databases. When you update objects, you can copy the updated objects to the library and then use the library to update your other databases.
This chapter describes how to:
Run 4D Insider
Open a database
Create a new database
Reparse a database
Maintain a list of preferred databases that can be opened from a menu
Create a database from an SQL description file
Set a start-up option
Close a database
Create and save a library
Open a library
Use libraries in a multi-platform environment
4D Insider Reference Manual
17
Chapter 2 Opening a Database
Running 4D Insider
For complete information about how to install 4D Insider, please refer to the Installation Guide. Once the 4D Insider installation is complete, the following files will have been installed onto your hard disk :
Installation Folder Windows\ACI Folder Installation Folder
4Dinsid.exe Insv65Prf.rsr 4D Insider® 6.5 4Dinsid.rsr \Network : contains Asifont.fon ASINTPPC.DLL Asiport.rsr QTDP32.dll
¨¨
¨¨
To run 4D Insider:
Double-click the 4D Insider application icon, or
Drag a database structure file to the 4D Insider application icon.
The 4D Insider Welcome window appears.
Windows MacOS
System Folder:Prefe-
the network compo­nents files (required for the use of 4D Insider with a 4D Server Database)
rences:ACI
Insv65Prf

Opening Databases

You can open any uncompiled database created with 4th Dimension or 4D Server v.6.5 or higher with 4D Insider v.6.5. If your database was created with an earlier version, you must convert the database to either 4th Dimension or 4D Server 6.5, or higher.
Note You cannot open a database that is currently open in another
application such as 4th Dimension or 4D Runtime.
¨¨
¨¨
To open a database:
1 Choose Open from the File menu. On the Macintosh, choose a menu
command from the submenu. In Windows, Open on 4D Server and Open are separate menu items.
On the Macintosh, the submenu offers you submenu options for opening a database located on your hard disk (locally) or for opening a database published on the network by 4D Server (on 4D Server...).
4D Insider Reference Manual
18
Opening Databases
MacintoshWindows
2 Follow the steps for “Opening a Database Locally” or “Opening a
Database on the Server.”
After opening the database, 4D Insider builds a cross-reference table of the objects contained in the database. A window appears, displaying the operation’s progress.
When 4D Insider has finished cross-referencing the database, it displays the database objects in a browser window.
You can open as many local databases as your memory permits. Each database you open will have its own browser windows.
4D Insider Reference Manual
19
Chapter 2 Opening a Database

Memory Management

Windows In Windows, 4D Insider manages memory by itself, allocating and
Macintosh
Memory Settings When 4D Insider parses your database, it needs to keep track of all
If the database contains a large number of objects, you may need to increase the memory allocated to 4D Insider.
purging additional memory as needed.
¨¨
¨¨
To allocate memory on the Macintosh:
1 Quit 4D Insider.
2 Select its application icon at the Finder level.
3 Choose Get Info from the Finder File Menu.
4 Change Memory Requirements at your convenience.
references to and from each object in the database. At times, this can be a lot of information. In general, memory settings for 4D Insider should follow this formula:
900K for 4D Insider + (Number of objects * 0.5K) + the size of the largest object
This formula is based on 50 references per object. Also, be aware that if you intend to open two structure files simultaneously, the formula applies to each structure. In addition, if you plan to open a structure and move several or all of the objects to another structure or to a library, the formula applies to each structure or library.

Opening a Database Locally

Windows
4D Insider Reference Manual
20
If you choose to open a database located on your hard disk, the standard Open File dialog box appears, allowing you to select a database.
Macintosh
Opening Databases
Select the database that you want to open and click Open. If a password is required to open the structure of your database, you will be asked to enter it. Only the Designer is allowed to open the database using 4D Insider.

Opening a Database on a Server

Windows
TCP/IP connection dialog box
With 4D Insider you can open one 4D Server database at a time on both Windows and Macintosh platforms.
4D Insider can connect to 4D Server using one of the following network protocols: AppleTalk, TCP/IP or IPX (Windows only). To make a connection, 4D Insider must have the proper network components installed.
If a password is required to open the structure of your database, you will be asked to enter it. Only the Designer password will allow you to open the database using 4D Insider.
If you choose to open a database served on the network with 4D Server, a dialog box similar to the following is displayed.
This dialog box allows you to choose the server to which you want to connect.
Make sure that the network component corresponding to the network protocol you want to use is installed in 4D Insider. For example, if you want to use the TCP/IP network protocol, you need to install the appropriate network component for your platform. Please refer to the 4D Server Reference as well as the Network Components for 4D Server documentation for complete information about installing network components and connecting to a 4D Server database.
4D Insider Reference Manual
21
Chapter 2 Opening a Database
.tex and .tes Files When you connect to a 4D Server database with 4D Insider, 4D Insider
copies the structure file’s resources to a database “.tex” file and the structure objects to a database “.tes” file. These files will contain the same information that 4D Client stores in its “.res” and “.rex” files. The reason that 4D Insider must create its own files is to allow you to connect to a database using 4D Client and, at the same time and from the same machine, open the structure using 4D Insider.
4D Insider operates like a 4D Client in Read Only access mode. Consequently, with 4D Insider you cannot modify any object (at the exception of comments) of a database running on 4D Server.

Creating a New Database

In addition to opening an existing database locally, 4D Insider enables you to create a new empty database. Once you have created a new database, you add objects to it by moving objects from other databases or libraries. Eventually, you can work with this new database using 4th Dimension or 4D Server as if it were originally created by one of these applications.
4D Insider Reference Manual
22
¨¨
¨¨
To create a new database:
1 Select New Database... in the File menu.
A new, untitled browser window appears.
At this point, if you choose Save as... from the File menu, you will be prompted with the following confirmation dialog box.
The reason for this is that a database needs to contain at least one table definition in order to be operable with 4th Dimension or 4D Server.
If you click Cancel, nothing happens. If you click OK, the new window will be saved as a 4D Insider library instead of a 4D database.
2 Move objects from another database or library to the new database.
Once you have moved at least one table from another database or from a library to the new database, the confirmation dialog is no longer shown when you save or close the browser window.

Reparsing a Database

Reparsing a Database
If you are using 4D Insider with a database published by 4D Server, other users may be modifying the structure or the objects in the database during your work session. In this case, the table of cross­references constructed by 4D Insider may be obsolete.
On MacOS, if the table of cross-references needs to be updated, the word “Reparse” flashes in the upper-left portion of the current window’s title bar.
In order to update the information displayed by 4D Insider, you can request that 4D Insider analyze the database again.
4D Insider Reference Manual
23
Chapter 2 Opening a Database
¨¨
¨¨
To do so:
Choose Reparse from the Tools menu.
4D Insider reanalyzes the structure of the database, displaying the progress of the operation.

Opening Preferred Files (Mac OS only)

If you frequently work on the same database structures or libraries, you may wish to make them preferred files. The advantage to doing this is that you can quickly open a preferred file by choosing its name from a submenu.
Note You can only use this option for local databases. You cannot make a
4D Server database a preferred file.
¨¨
¨¨
To open a preferred file:
Choose Preferred Files from the File menu, and then choose a file
name from the submenu.
4D Insider Reference Manual
24
Opening Preferred Files (Mac OS only)
Choosing a file from this list automatically opens the corresponding database.
¨¨
¨¨
To personalize your list of preferred files:
Choose Preferred Files from the File menu, and then choose Modify...
from the submenu.
The following dialog box appears:
Files in the directory
Files in the submenu
The Eject, Desktop, and Open buttons at the center of the window allow you to locate and select the files to be placed in the submenu. When you select a structure file from the scrollable list on the left, the Open button becomes an Add button so that you can add the structure file to the list of files in the submenu.
4D Insider Reference Manual
25
Chapter 2 Opening a Database
¨¨
¨¨
To add a file to the submenu:
Select a file and click the Add button.
The file appears in the list on the right and will appear in the submenu when you click OK to save your changes.
¨¨
¨¨
To remove a database from the submenu:
Select the file from the list on the right and click the Remove button.
¨¨
¨¨
To associate a keyboard equivalent with a database:
Select the file from the list on the right and type any character (except
for those already used by 4D Insider) in the Command Key area.
You can use this keyboard equivalent as a shortcut for opening the file. To open the database using the keyboard equivalent, press the q key and type the previously defined character.

Opening Recently Used Files (Windows only)

In Windows, the five most recently used databases are listed in the File menu.
4D Insider Reference Manual
26
¨¨
¨¨
To open a previously used database:
Select the database from the File menu.

Creating a Database from an SQL Description File

Creating a Database from an SQL Description File
4D Insider can parse an SQL description file generated by a case tool and create a 4D database matching the SQL description. 4D Insider parses the file, ignoring unsupported verbs, and creates the 4D structure sequentially. The generated 4D database contains the tables, typed fields, and manual relations between tables. If it encounters an SQL syntax error, 4D Insider terminates the parsing.

Supported Verbs 4D supports two SQL verbs, CREATE TABLE and CREATE INDEX:

CREATE TABLE Supported options are:
PRIMARY KEY - A Primary key declaration indexes the created field
with a Unique property.
FOREIGN KEY () REFERENCES - A foreign key declaration creates a
many-to-one manual relation and indexes the created field.
Supported constraints are:
NOT NULL - A NOT NULL constraint will make the field Mandatory.
Supported data types are:
ODBC SQL and SQL92 Data Types 4D Data Types
CHAR, NCHAR Alpha(2) CHAR(x)*, NCHAR(x)* Alpha(x) VARCHAR(x) Text CHAR VARYING, NCHAR VARYING Text LONG VARCHAR Text TINYINT, SMALLINT Integer INT, INTEGER Long Integer BIGINT, DOUBLE, DOUBLE PRECISION Real NUMERIC, NUMERIC(x), NUMERIC(x,y) Real DECIMAL, DECIMAL (x), DECIMAL (x,y) Real DEC, DEC (x), DEC (x,y), REAL, FLOAT Real BIT Boolean BIT(x), BIT VARYING BLOB BINARY(x), VARBINARY(x) BLOB LONG VARBINARY BLOB DATE Date TIME, TIMESTAMP, TIME WITH TIME ZONE Time TIMESTAMP WITH TIME ZONE Time
4D Insider Reference Manual
27
Chapter 2 Opening a Database
* When the number of characters is greater than 80 (x>80), 4D Insider truncates the Alpha field to 80 characters.
CREATE INDEX Supported options are:
UNIQUE
Creating an index on a column indexes the equivalent 4D field. Creating a Unique index on a column indexes the equivalent 4D field
with a Unique property
Example:
CREATE TABLE COMPANIES ( REF INTEGER, NAME CHAR (25) NOT NULL, ADDRESS VARCHAR (200), ZIP_CODE CHAR (5), PHONE CHAR (15), FAX CHAR (15), CREDIT_LINE FLOAT, EXPIRES DATE,
PRIMARY KEY (REF) );
CREATE TABLE CONTACTS (
REF INTEGER, REF_COMPANY INTEGER NOT NULL, NAME CHAR (20), F_NAME CHAR (20), EXTENSION CHAR (3),
PRIMARY KEY (REF), FOREIGN KEY (REF_COMPANY) REFERENCES COMPANIES (REF) ); CREATE UNIQUE INDEX COMP_IDX ON COMPANIES (REF);
CREATE INDEX COMPNAME_IDX ON COMPANIES (NAME);
CREATE UNIQUE INDEX CONT_IDX ON CONTACTS (REF);
CREATE INDEX CONTNAME_IDX ON CONTACTS (NAME);
¨¨
¨¨
To create a database from an SQL description file:
1 Select Open SQL File... from the File menu.
A standard Open File dialog box enables you to select the file.
2 Select the SQL file and click Open.
4D Insider Reference Manual
28
Creating a Database from an SQL Description File
The main window for the file opens.
The 4D Insider browser window reflects the manual relationships of the 4D structure file.

Log File When interpreting a SQL text file to create a new database, 4D Insider

creates a log file, in text format, in the database folder. This log file contains table names and columns in the order in which they were interpreted by 4D Insider.
4D Insider Reference Manual
29
Chapter 2 Opening a Database
If 4D Insider encounters an error, it stops and writes the error in the log file. Errors that 4D Insider may encounter are:
Duplicate filename Out of memory Initialization error Parsing error Yacc stack overflow Syntax error Unterminated string

General Preferences

Welcome Window When you run 4D Insider, the 4D Insider Welcome window appears by

default.
¨¨
¨¨
To show the Welcome window when you open 4D Insider:
1 Choose Preferences from the File menu, and then choose General...
from the submenu that appears to its right.
4D Insider Reference Manual
30
Loading...
+ 126 hidden pages