Empty()

EMPTY()

Checks if the passed argument is empty.

Syntax

      EMPTY( <xExp> ) --> lIsEmpty

Arguments

<xExp> is any valid expression.

Returns

A logical value. It is true (.T.) if the passed argument is empty otherwise it is false (.F.).

Description

This function checks if an expression has empty value and returns a logical indicating whether it the expression is empty or not.

Note : Characters with ASCII code 9, 10 and 13 always treated as “white spaces”;

Examples

      ? EMPTY( "I'm not empty" )    // .F.

Tests

PROCEDURE Test()
         ? EMPTY( NIL )             // .T.
         ? EMPTY( 0 )               // .T.
         ? EMPTY( .F. )             // .T.
         ? EMPTY( "" )              // .T.
         ? EMPTY( 1 )               // .F.
         ? EMPTY( .T. )             // .F.
         ? EMPTY( "smile" )         // .F.
         ? EMPTY( Date() )          // .F.
         ? EMPTY( {} )              // .T.
         ? EMPTY( {''} )            // .F.
         ? EMPTY( {=>} ) )          // .T.
         ? EMPTY( CHR(8) )          // .F.
         ? EMPTY( CHR(9) )          // .T.
         ? EMPTY( CHR(10) )         // .T.
RETURN

Compliance

Clipper

Files

Library is rtl

Seealso

LEN()

3 responses to “Empty()

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

  2. Pingback: Harbour String 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.