StrIsEmpty Function

Action

Checks whether a string is empty.

注: BDL strings implement null pointer semantics, i.e. BDL differentiates between a null string and an empty string.

Include file

Kernel.bdh

Syntax

StrIsEmpty( in sString : string allownull ): boolean;

Return value

  • true if string is empty or null

  • false otherwise

Parameter Description
sString String to be checked.

Example

dcltrans
  transaction TMain
  var
    sString : string;
  begin
    if StrIsNull(sString) then
      Print("sString is null");
    else
      Print("sString is not null");
    end;

    if StrIsEmpty(sString)then
      Print("sString is empty");
    else
      Print("sString is not empty");
    end;

    StrSetNull(sString);

    if StrIsNull(sString) then
      Print("sString is null");
    else
      Print("sString is not null");
    end;

    if StrIsEmpty(sString) then
      Print("sString is empty");
    else
      Print("sString is not empty");
    end;
  end TMain;

Output

sString is not null
sString is empty
sString is null
sString is empty