[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| PROCEDURE |
+---------------------------------+
PROCEDURE <procedure name>
-----------------------------------
Defines start of subroutine that is named <procedure name>.
-----------------------------------
In many programs certain routines are frequently repeated. Define these
commonly used routines as separate procedures to reduce program size and
complexity and ease program maintenance.
PROCEDURE <procedure name> is a statement within a program. It
specifies the beginning of each procedure in a program and identifies
the procedure by name. Procedure names may be up to 10 characters long.
They must begin with a letter or underscore and may contain any
combination of letters, numbers and underscores.
The PROCEDURE <procedure name> statement is followed by a series of
commands that make up the procedure. You may optionally include RETURN
as the last line of a procedure although an implicit RETURN is
automatically executed following the last statement of a procedure.
When a procedure is executed with DO <procedure name>, the procedure is
searched for in a specific order. First the file containing DO
<procedure name> is searched. If the procedure is not found there, the
file opened with SET PROCEDURE (if one is set) is searched. Next,
FoxPro then looks through the programs in the execution chain. Program
files are searched beginning with the most recently executed program and
continues through the first executed program.
If the procedure is still not found, FoxPro searches for a stand-alone
program file. If a program file with the same name as the subroutine is
found the program is executed. If a matching program file is not found,
an error message "File does not exist" is returned.
+---------------------------------+
| Program Example |
+---------------------------------+
SET CENTURY ON
? longdate({08/19/89})
PROCEDURE longdate
PARAMETER mdate
RETURN CDOW(mdate) + ', ' + MDY(mdate)
-----------------------------------
See Also: FUNCTION, PARAMETERS, PARAMETERS(), RETURN, SET PROCEDURE,
SET UDFPARMS, USER-DEFINED FUNCTIONS (UDFs)
-----------------------------------
See Also:
FUNCTION
PARAMETERS
PARAMETERS()
RETURN
SET PROCEDURE
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson