tag:blogger.com,1999:blog-1052670306871809954.post2831955252495854685..comments2023-04-16T10:39:38.097+02:00Comments on Do magic with IBM Notes: "Delete doc" vs "set doc = nothing"Yuriy Pastovenskyyhttp://www.blogger.com/profile/16282270056689636091noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-1052670306871809954.post-2043225345492833272014-08-26T13:37:42.917+02:002014-08-26T13:37:42.917+02:00This comment has been removed by a blog administrator.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1052670306871809954.post-57838715397132198892014-08-26T13:35:07.312+02:002014-08-26T13:35:07.312+02:00This comment has been removed by a blog administrator.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1052670306871809954.post-45504448573430619252014-08-26T13:14:30.424+02:002014-08-26T13:14:30.424+02:00Hi Ursus
Thank's for reply, I have removed my ...Hi Ursus<br />Thank's for reply, I have removed my first reply on your comment, I was wrong, sorry.<br />But let me explain.<br />I know what is the difference between 'Delete' and 'Set to Nothing'.<br />The reason (why I didn't expect it) was that I explicitly created a NEW instance of the class NotesUIWorkspace and I expected that all variables, children objects and references to such objects should be allocated in heap separately. But it seems that lotus run-time does not create a new instance of the same backend object (I mean the same notesdocument or notesdatabase) - it just creates a new reference to it but keep only one object in memory. that's why statement 'delete' affects on any reference to the same object.<br />On the other hand, there are other Notes classes which behave as I expected, like NotesStream, NotesDbDirectory, NotesName,....<br />So correct answer is that Notes run-time always keep only one instance of the same backend object in memory that's why 'Delete' statement affects on ALL references to this object no matter the scope. Yuriy Pastovenskyyhttps://www.blogger.com/profile/16282270056689636091noreply@blogger.comtag:blogger.com,1999:blog-1052670306871809954.post-35607523132130534332014-08-26T12:28:08.967+02:002014-08-26T12:28:08.967+02:00This comment has been removed by the author.Yuriy Pastovenskyyhttps://www.blogger.com/profile/16282270056689636091noreply@blogger.comtag:blogger.com,1999:blog-1052670306871809954.post-78067274853824036132014-08-26T09:57:39.888+02:002014-08-26T09:57:39.888+02:00That makes perfect sense though - Set note = nothi...That makes perfect sense though - Set note = nothing just clears your pointer to the note the you created outside the Sub, Delete note actually deletes the note. Nothing to see here, move along :o)Ursus Schneidernoreply@blogger.com