Show/Hide Toolbars

XSharp

A nameof expression produces the name of a variable, type, or member as the string constant:

 

You can use a nameof expression to make the argument-checking code more maintainable:

 

Syntax

NameOf( identifier )

 

FUNCTION Test(cName as STRING)
IF cName == null
  throw new ArgumentNullException(nameof(cName), i"{nameof(cName)} cannot be null");
endif