KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Switching between interpreted and compiled modes
PRODUCT: 4D | VERSION: 13.3 | PLATFORM: Mac & Win
Published On: November 13, 2013

A 4D database can be executed in either compiled mode or interpreted mode. There are several ways to switch between the two modes.

Note: A .4db file contains interpreted code. It *may* contain compiled code (only if you compile of course). A. 4dc file contains ONLY compiled code and can be opened only in the compiled mode.

From The Design Mode

The Run menu in the designed mode can be used to switch between the interpreted and compiled modes.



Note: Switching between the modes from the Run menu in a 4D client when connected to a 4D server displays a window with the message “The server will be restarted in the compiled or interpreted mode” depending on the mode chosen. Disconnecting from the server will switch between the two modes.



From The Open Database Dialog

4D databases can be opened in the desired mode through the open dialog.

On Mac it is available on open dialog when the user opens the database in 4D and clicks on the up and down arrows and chooses one of the options interpreted database or compiled database.



It is the same on Windows when opening an existing database from 4D. Click on the down arrow on the open button in the open dialog and choose compiled database or Interpreted database.



The 4DLINK Attribute

4D allows to switch between the interpreted and compiled modes by editing the .4dlink files.
A .4dlink connection file is an xml formatted file. For more details about the creation, location and use of .4dlink files refer to the techtip http://kb.4d.com/assetid=50815.

In .4dlink files changing the attribute structure_opening_mode to 1 opens the database in interpreted mode and changing the attribute to 2 opens it in compiled mode.

The structure_open_mode attribute in a 4dlink file can only be used for the .4db file and not for the .4dc structure file since it can only open in the compiled mode.


To edit the 4dlink file of an existing database move it from the favorites folder mentioned in the http://kb.4d.com/assetid=50815 techtip since 4d overwrites it every time the .4db structure file is opened.