Do()

DO()

Calls a procedure or a function

Syntax

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

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

<xRetVal> 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

Compliance

Clipper

Files

Library is rtl

3 responses to “Do()

  1. Pingback: Harbour All Functions – D | Viva Clipper !

  2. Pingback: Harbour hvm Functions | Viva Clipper !

  3. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.