Futurebasic/Language/Reference/local

Description
This statement is an alternative way to indicate the beginning of the scope of a local function. If used, it must appear somewhere above the  statement. All non-global variables which are declared between the  statement and the   statement have a scope local to the function. Adding the  and/or  keywords has the following additional effects:

 The  keyword causes all of the function's local variables and arrays (except parameter-list variables) to be initialized to zeros, null strings or empty records, each time the function is called. Otherwise, the variables will have unpredictable initial values. You can accomplish the same effect by adding the  keyword to the   statement.

The  keyword prevents the use of global variables within the function. That is, all variables inside the function will be local variables, even those which have the same names as global variables. This is a good practice when you're writing a function that you might wish to use in a number of different projects, because it removes the possibility of the function's local variables being misinterpreted as globals.



Note: is the only kind of statement that you should put between the  statement and the   statement. Executable statements placed between  and   will never be executed.

You cannot declare any of the variables in the function's parameter list using a statement after the   statement.

A compiler preference allows you to fill s with   for debugging. With this item checked, all functions that do not begin with  have every variable filled with this value. It's a great debugging tool.