Recital

Login Register

Using the Recital REQUIRE( ) and REQUIRE_ONCE() statements

Recital 10 introduced the REQUIRE() and REQUIRE_ONCE() statement.

The REQUIRE() statement includes and executes the contents of the specified file at the current program execution level.

When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables, procedures, functions or classes declared in the included file will be available at the current program execution level.

The REQUIRE_ONCE() statement is identical to the REQUIRE() statement except that Recital will check to see if the file as already been included and if so ignore the command.

The full syntax is:
REQUIRE( expC )
REQUIRE_ONCE( expC )

e.g.

REQUIRE_ONCE( "myapp/myglobals.prg" )
Twitter

Copyright © 2024 Recital Software Inc.

Login

Register

User Registration
or Cancel