StrIsNull Function

Action

Checks whether a string is null.

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

Include file

Kernel.bdh

Syntax

StrIsNull( in sString : string ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sString String to be checked for null.

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