4D v17 R5 marked the start of beta testing for a new type of 4D database: project databases. In 4D v18, we’re thrilled to announce that project databases are now in final release. It’s time to take advantage of the power of the 4D development platform combined with the versatility of a lightweight and distributed format!
Project databases let you develop in 4D using a text-based files rather than the traditional binary format. To create a project database:
- Create a new, blank project database, or
- Export an existing binary structure file (.4db) to a project.
Convert an existing database
Converting a binary database to a project is very simple, simply click the “File > Export > Structure to project” menu item.
Once the conversion of the binary database has finished, a message is displayed to inform you of its successful completion. 4D also lets you know if any errors requiring your intervention have been detected (e.g., if there are some older form objects which are no longer supported).
For more details, take a look at this documentation.
A concrete example
In the video below, we’ll convert the “Contacts” database that you can download from the 4D website.
Using the “File > Export… > Structure to project” menu item, we convert the binary structure file (.4DB) into a project. 4D informs us that an error has ocurred during the conversion. When opening the log file, we notice that the database uses highlight buttons. As mentioned above, in project databases, some older objects are no longer supported.
In this case, we’ll simply change the button type from Highlight to Invisible. In your databases, if your “button” consists of an image, static text, and a Highlight button, we advise that you to replace these three objects with a single object: a 3D button. This may also require some code changes if you display or hide the buttons at runtime according to the context.
After some corrections, the “Contacts” database is exported again and this time successfully.
Now it’s your turn to play!