How to handle the null value

Pierre Rossel prossel2 at myrealbox.com
Thu Jun 22 22:22:53 CDT 2006


Hello,

I wonder where the <Null> value is documented in Director Help and how to
handle it.

Here is an example:

I'm creating a record using this code:

Using V4MD 1.11 on XP and OS X. I use the following code to add a record.
The #mediaData field value is not provided. It is a #Text field (not
nullable, indexed by words, ASCII, segment 128).

  curMediaItems = db.Query("SELECT RecID, * FROM MediaItem WHERE RecID=0",
[#LockType: #ReadWrite, #Direction: #Random])
  bRet = curMediaItems.AddRecord([#MediaFolderPtr: iMediaFolderId, #name:
sName, #mediaType: 1])

Later, this code is used to load the data. The result of the put commands
are merged under the commands.

  curItem = db.Query("SELECT * FROM MediaItem WHERE RecID=" &
p_iMediaItemId)
  p_lstData = curItem.GetRecordAsPropList()

  put p_lstData[#mediaData]
  -- <Null>

  put p_lstData[#mediaData] = void
  -- 1

  put voidP(p_lstData[#mediaData])
  -- 0

The <Null> value is something I have never seen documented. Is it the same
as void ? Seems not since the voidP() call return false. Usually the test
value = void should be avoided and the voidP() function used instead. In
this situation, it is just the opposite.

I am a bit confused.

Thanks for any help.

Pierre Rossel



More information about the Valentina mailing list