4th Dimension Learning Basics
Structures FILES AND TABLES FMP uses layouts for all input and output of data. With 4D there input and output forms. In 4D the data are stored in Tables. The Tables are stored in a Data file.
With FMP, both structure and data are stored in the same file for all files of the program. With FileMaker Pro each file can have a maximum size of 2 GB (that’s structure and data). Figure 1 - Comparison of FMP and 4D Files With 4D on the Mac, there are just two files, the Structure and Data files. The Data file can contain up to 255 Tables for a total of 128 GB of data.
Rumor has it that the next version of 4D (v7) will have a billion Tables with a billion records per Table. 4D Tables are similar to the data portion of the FMP files. Having separate structure and data files makes the whole database much more efficient with 4D.
On Windows 4D in addition to the Structure file (.4DB) and Data file (.4DD) there are one or two additional files. These are Resource files .RSR for the Structure and .4DR for the Data file. Note the .4DR is only used if the WEDD utility has been used on the Data file.
MODES AND ENVIRONMENTS FMP With FMP there are four modes, Brows e ( for data entry and on screen viewing), Find (for entering Find criteria and find matching records), Preview (for seeing how the layout will look when printed and also for summarizing reports) and Layout (for designing the file). 4D In 4D there are basically two modes or environments, Design and User .
The 4D Design environment is similar to the FMP Layout mode. The 4D User environment is similar to the FMP Browse mode. There is, however, a third environment with 4D called Custom Menus . There is nothing comparable in FMP.
Related: — A spreadsheet-simple interface sitting on top of a real , with automations, views, and shareable interfaces..
In fact, the Custom Menus environment is where the 4D user should be. The User environment is mainly for the developer’s benefit. A quick word about the Custom Menus environment.
Here is an area where you can develop complete control of your 4D program. 4D allows you to create custom menu bars that appear at the top of the window. You can modify the File Menu and create your own custom menus. You can add menu items to each menu including adding keyboard shortcuts.
Clicking those items can call a script/method to do just about anything you want. With FMP, you’re limited to the Menu Bar supplied by FMP. With 4D you can make your program look like it’s all yours.
If you are shopping: — A that plugs into the wider Zoho suite and prices per user rather than per app..
The user may not even have any idea the program was created with 4D. Custom Menus will be discussed in detail in a later part. Once you learn how to use them, they are not only very powerful, but a lot of fun.
When developing with 4D you start in the Design environment, check things in the User environment and further develop in the Custom Menus environment. When the program is ready for the user, only the Custom Menus environment is normally used.
DATA FIELDS AND CALCULATIONS There are more types of data fields with 4D, but you won’t find any Calculation, Summary or Global fields. Figure 2 - Comparison of FMP and 4D Data Fields The lack of calculation data fields in 4D takes some getting used to, however, it is actually more efficient. With 4D, you can create a complex calculation and store it and then assign it where you want and in many places. These “containers” with assigned calculations are called variables.
Variables are stored only in RAM whereas data fields are stored in the Data file on the hard drive. In 4D there are three types of variables, Local. Process and Interprocess.
These will be discussed in detail in a later part of this series. SCRIPTS AND METHODS FMP With FMP there is just one kind of script. FMP uses ScriptMaker which has a fairly large set of script steps. For many applications one only needs to click on the step from a selection window.
Little typing or remembering the exact syntax is required. Scripts can be called directly from the ScriptMaker menu, via the keyboard, via buttons, by opening the file and by closing the file. Data entry cannot trigger a script.
Scripts can call other scripts including external scripts in other files. There are both conditional and looping script steps available. The FMP scripting is very easy to use.
4D With 4D there is a comparable feature called Methods. The Methods of 4D are much more versatile and powerful than the FMP scripts. There are five types of Methods in 4D: Object Methods Form Methods Table Methods Database Methods Project Methods These will be discussed in detail in a later part of this series.
RELATIONSHIPS Both FMP and 4D use relationships. Relationships allow a program to group a set of records in a file or specify a specific record. For ease of discussion think of the file you are starting in as the Current file and the file with the related records as the Related file. With FMP you can create a relationship with another file or one within a given file.
This is known as a self-join. FMP allows portals based on a relationship. The portal in the Current file can show rows of data for records from the Related file.
Data from a related file can also be displayed in a Current file directly on a layout in individual data fields. New records can be created in the Related file from the Current file. Calculations in the Current file can use data from a Related file. FMP RELATIONSHIPS Figure 3a - Defining Relationships in FMP Figure 3b - Edit Relationships in FMP 4D RELATIONSHIPS In 4D there are no portals.
There are subforms which perform a function similar to the portals of FMP. 4D has a graphical way to set up relationships. Just drawing a line from the Many Table to the One Table creates the relationship.
Note: It’s very important to make sure you draw the line from the Many Table to the One Table. The direction of the line is important. When done you have your Entity Relationship (ER) diagram.
Figure 4 - Defining Relationships in 4D OTHER THINGS IN 4D NOT IN FMP With 4D you will hear of such things as Arrays, BLOBs (Binary Large OBjects, data fields capable of storing up to 2 GB of data), Pointers, Processes, Semaphores, Sets, Transactions and Triggers. All these will be discussed in detail later.
FMP PROGRAM STRUCTURE With FMP, you can have one file with everything in it. That file contains both the structure and the data. Such a file is known as a flat file. A FMP program can have many files (up to 50).
These files can be related and can share data. Data in
P.S. A few readers have asked which relational database platform we actually reach for — it's Claris FileMaker Pro; if you want the current details.
Try FileMaker Free for 45 Days
The long-running relational database platform for teams that need custom apps on desktop, web, and mobile from a single file.