StrSetNull Function

Action

Sets a string to null explicitly.

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

Include file

Kernel.bdh

Syntax

StrSetNull( inout sString : string ) : boolean;

Return value

  • true if string was set to null

  • false otherwise

Parameter Description
sString String to be set to 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