KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Distinguishing between null and empty objects
PRODUCT: 4D | VERSION: 17 | PLATFORM: Mac & Win
Published On: June 27, 2019

When working with objects, it is important to distinguish the difference between a null and empty object. A null object means that the object was never initially defined in the first place or set to the value Null while an empty object is an object without any attributes.

Shown below is some simple code to distinguish whether an object is null or empty.

C_OBJECT($test_ob)

If ($test_ob=Null)
   ALERT("is null")
Else
   If (OB Is empty($test_ob))
      ALERT("is empty")
   End if
End if