Icon Defined

Unit: Internal

Available In: Client Applications

function Defined(<Object Property>): Boolean

Examples

The Defined function returns whether the object property input parameter is undefined, and is used with external JavaScript objects to determine if a given property exists in a JavaScript object. The input parameter must be a property reference for a valid object instance. The return value is a Boolean value.

Examples

type

   external TExternalText = class(TExternalObject)
      public
         property Text: String read write;
         property UseCount: Integer read write;
      end;

var
   MyObject: TExternalText;
begin
   MyObject := TExternalText(CreateObject('{ Text: "Hello World" }'));
   X := Defined(MyObject.Text);  // X is True
   X := Defined(MyObject.UseCount);  // X is False
end
Image