xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

DO

Executes a function or procedure.

Syntax

DO <ProcedureName> [WITH <params,...>]

Arguments

<ProcedureName>
This is the symbolic name of the function or procedure to execute.
WITH <params,...>
Optionally, a comma separated list of parameters to pass to the function or procedure can be specified following the WITH option.

Description

The DO command exists for compatibility reasons. It executes the function or procedure having the symbolic name <ProcedureName> and passes the parameters specified as <params,...> on to it.

Note:  it is recommended to use the execution operator instead of the DO command.

Info

See also:( ), FUNCTION, PROCEDURE
Category: Statements
Source:vm\do.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates two possibilities of calling
// a subroutine. The first uses the DO command while the
// second uses the () execution operator.

   PROCEDURE Main

      // Procedural syntax
      DO Test WITH "Hello", "World"

      // Functional syntax
      Test( "Hi", "There" )

   RETURN


   PROCEDURE Test( c1, c2 )
      ? c1, c2
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe