Why does my .NET object now display as (NULL) ?

The Dyalog "Knowledgebase". This forum is read-only
Forum rules
The FAQ is a read-only forum which is in general updated only by employees of Dyalog Ltd. It replaces the FAQ page which existed under http://www.dyalog.com. Rather than rejecting other posts to this forum, such posts will be put in a moderation queue, and moved to a more appropriate forum.

Why does my .NET object now display as (NULL) ?

Postby AndyS|Dyalog on Wed Aug 20, 2014 4:22 pm

Supposing you create a .NET DateTime object:

      ⎕using←'System'
z←DateTime.Now
z
20/08/2014 12:56:57
z.GetType
System.DateTime


and then
      )save myws
)load myws


You will now see the following:
      z
(NULL)
z.GetType
VALUE ERROR
z.GetType


Similarly
      'andys'⎕ns''
andys.⎕using←'System'
andys.(sdt←DateTime.Now)
'parentns'⎕ns'andys'
parentns.andys.sdt
(NULL)
parentns.andys.sdt.GetType
VALUE ERROR
parentns.andys.sdt.GetType


During a )SAVE entities in the workspace are serialised and the serialised data is then written to file. On )LOAD each entity is recreated from the serialised data. .NET offers serialise/deserialise methods for many (but not all) .NET objects. However, Dyalog does not make use of these methods.

The mechanisms for cloning namespaces (or for writing entities to and reading them back from component files) involve very similar techniques and thus suffer from the same limitation.

In these situations, Dyalog preserves the name or reference that was associated with the .NET object, but since the original object is no longer available, displays it as (NULL).

This behaviour may be changed in future releases of Dyalog.

[I have posted this in Microsoft.NET, but I intend to move this into the FAQ section in due course]
User avatar
AndyS|Dyalog
 
Posts: 263
Joined: Tue May 12, 2009 6:06 pm

Return to Frequently Asked Questions (FAQ)

Who is online

Users browsing this forum: No registered users and 1 guest