KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: The difference between Blob and 4D.Blob
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: April 17, 2023

BLOBs, or “binary large objects”, are scalar values of binary data that represent one of the data types that 4D is able to handle either in its database fields or within the 4D language.

4D.Blob, on the other hand, is an object that contains a BLOB value. This object is essentially the result of a concept known as “boxing”, where a primitive value is encapsulated in an object. There are two main components of the 4D.Blob object: the size of the BLOB value and the BLOB itself, separated into octets. The 4D.Blob class contains two functions (.new() and .slice()) that allow the developer to create a new 4D.Blob object and duplicate a subdivision of either a BLOB or 4D.Blob into another 4D.Blob object.

The debugger below shows the difference in what a BLOB vs. a 4D.Blob looks like when running in the background of a 4D application.