Next: , Previous: , Up: mpg-bpr   [Contents][Index]


11.3.195 runtime_entry/1   hook

Synopsis

user:runtime_entry(Event)

This predicate is called upon start-up of stand alone applications. Currently, Event will be start, and the hook is only called when the stand alone application starts (after any saved state etc. has been loaded). In the future, other events may be defined, e.g. when the application exits, so unknown values of Event should be ignored. See Mixing C and Prolog for details.

A typical definition just calls the user-defined code that should be run on startup:

user:runtime_entry(start) :-
   start_my_program.

% This is the "real" program code.
start_my_program :-
   write('Hello World\n').

Send feedback on this subject.