Harbour Reference Guide

 

DO()

Calls a procedure or a function

Syntax

DO( <xFuncProc> [, <xArguments...>] )

Arguments

<xFuncProc> = Either a string with a function/procedure name to be called or a codeblock to evaluate.
<xArguments> = arguments passed to a called function/procedure or to a codeblock.

Returns

A value that was returned from called function.

Description

This function can be called either by the harbour compiler or by user. The compiler always passes the item of IT_SYMBOL type that stores the name of procedure specified in DO <proc> WITH ... statement.
If called procedure/function doesn't exist then a runtime error is generated.
This function can be used as replacement of macro operator. It is also used internally to implement DO <proc> WITH <args...> In this case <xFuncProc> is of type HB_SYMB.
Examples
      cbCode ={|x| MyFunc( x )}
      DO( cbCode, 1 )

      cFunction := "MyFunc"
      xRetVal :=DO( cFunction, 2 )

      Old style (slower):
      DO &cFunction WITH 3

Files

Library is rtl

 




[Source Forge]

Other Docs Categories

Advantage Database RDD
Array
Binary conversion
Classes
Code Block
Console input
Conversion
Conversion Tools
DOS
Data input and output
Database
Database Tools
Date
Dos Tools
Environment
Error recovery
Events
File management
GT
Harbour Tools
Internal
Low Level
Math
Misc
Miscellaneous
Nation
Object manipulation
Operating System Specific
Parameter Checks
String Tools
Strings
TBrowse Method
TBrowse class
Terminal
Time
Utility
Variable Management

 

Last updated on 2001/07/30