exists Method

Class: Object

Description

This method returns an indication of whether an object instance (for reference datatypes) or value (for primitive datatypes, and including null) has been assigned to the variable.

Syntax

Object.exists()

Parameters

None

Returns

1 if the object instance or value has been assigned to the variable.
0 if the object instance or value has not yet been assigned to the variable.

When Became Available

Profile v7.0

Example

type RecordDEP dep

type OI iod

type String STR

type Boolean NO = dep.exists()

set NO = iod.exists()

set NO = STR.exists()

 

set iod = Class.new("IO")       // assigns new instance

type Boolean YES = iod.exists()

set dep = Db.getRecord("DEP", "CID=:CID") // new instance

set YES = dep.exists()

set STR = "ABCDEFG"            // assigns new value

set YES = STR.exists()