xHarbour Reference Documentation > Statement Reference |
Declares a procedure to execeute when a program starts.
INIT PROCEDURE <procName> [FIELD <fieldName,...> [IN <aliasName>]] [MEMVAR <var_Dynamic,...>] [LOCAL <var_Local> [:= <expression>] ,... ] <Statements> [RETURN]
The INIT PROCEDURE statement declares a procedure that is automatically called when a program is started. There is one implicit INIT procedure named ErrorSys() that is invoked in all xHarbour applications. It installs the default error codeblock and is programmed in ERRORSYS.PRG.
INIT procedures do not have a list of arguments and no parameters are passed on program start. The execution order of INIT procedures is undetermined. It is only guaranteed that they are called when a program starts.
An INIT procedure cannot be called explicitely during the start sequence of a program since its symbolic name is resolved at compile time and does not exist at runtime.
See also: | EXIT PROCEDURE, PROCEDURE |
Category: | Declaration , Statements |
// See the example for EXIT PROCEDURE
http://www.xHarbour.com