Saltar al contenido principal
Versión: Siguiente

On Startup database method

On Startup database method

Does not require any parameters

This command is not thread-safe, it cannot be used in preemptive code.

The On Startup database method is called once when you open a database.

This occurs in the following 4D environments:

  • 4D in local mode
  • 4D in remote mode (on the client side, after the connection has been accepted by 4D Server)
  • 4D application compiled and merged with 4D Volume Desktop

Note: The On Startup database method is NOT invoked by 4D Server.

The On Startup database method is automatically invoked by 4D; unlike project methods, you cannot call this database method yourself by programming. You can however execute it from the Method editor. You can also use subroutines.

The On Startup database method is the perfect place to:

  • Initialize interprocess variables that you will use during the whole working session.
  • Start processes automatically when a database is opened.
  • Load Preferences or Settings saved for this purpose during the previous working session.
  • Prevent the opening of the database if a condition is not met (i.e., missing system resources) by explicitly calling QUIT 4D.
  • Perform any other actions that you want to be performed automatically each time a database is opened.

However, we strongly recommend that you do NOT launch print jobs from the On Startup database method.

Example

See the example in the Semaphore section.

See also

Database Methods
On Exit database method
QUIT 4D