Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>do</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
DO


Syntax:     DO <procedure> [WITH <parameter list>]

Purpose:    To execute a procedure.

Arguments:  <procedure> is the name of the procedure to execute.

Option:     With: Specifies a <parameter list> of up to 128
            parameters, separated by commas.  Each parameter may be
            either a single memory variable or an expression.  Memory
            variables may be passed either by reference or value.

Usage:      Passing parameters: Using the WITH clause passes
            parameters to the specified subprocedure.  If a parameter is
            a field or an expression, it is evaluated and the resulting
            value is passed to the subprocedure.  By default, a
            parameter consisting of a single memory variable is passed
            by reference.  (Memory variables passed by reference can be
            modified by the subprocedure.)  If the memory variable is
            enclosed in parentheses, it is treated as an expression, and
            is passed by value.  Note that fields are always passed by
            value and cannot be passed by reference.

            If a Clipper procedure wishes to access the passed
            parameters, it must contain a PARAMETERS statement followed
            by a list of variables to receive the passed values or
            references.

            Procedures written in other languages retrieve parameters by
            other means.

            See PARAMETERS for a more detailed discussion of passing
            parameters.

            Compiling: When Clipper encounters a DO statement and
            the specified procedure is not already known, it searches
            the current directory for a (.prg) file with the same name
            and compiles it if it is found.  Otherwise the called
            procedure is assumed to be an external.  Note that when you
            link, the linker will expect to resolve this external
            reference.

Library:    CLIPPER.LIB


----------------------------------- Examples -------------------------------

   DO AcctsRpt
   DO QtrRpt WITH "2nd", "Sales Division"

   number = 12
   DO YearRpt WITH number + 12, number


See Also: PARAMETERS PRIVATE PROCEDURE PUBLIC RETURN

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson