Page 1 of 1

Instance with no parent

Posted: Thu Dec 10, 2009 4:41 pm
by giangiquario
I met a condition where an instance had no parents.
In fact - inside a Destructor function -
⎕this
returned
.[myClass]
and
⎕this.##
returned
DOMAIN ERROR

Is it a possible state of an instance or did I do something wrong?

Re: Instance with no parent

Posted: Thu Dec 10, 2009 5:11 pm
by Morten|Dyalog
I can't think of a way in which this could happen - would be very interested to see code that could reproduce it!

Re: Instance with no parent

Posted: Fri Dec 11, 2009 9:32 am
by giangiquario
I squeezed the class that created that situation and prepared a simple .DWS
The workspace (dyalog 11.1) is attached.

Instructions:

(⎕NEW morten.first).Play

In form “first class” press button “Input data”.
In form “aaaaaaaaa” press button “Quit”
In form “fist class” press button “Quit”

DOMAIN ERROR
kill[3] parentName←⍕⎕THIS.##


PS. I'm sorry. I tried to upload the DWS but I cannot find it in this post.

Re: Instance with no parent

Posted: Sun Dec 13, 2009 8:14 am
by Morten|Dyalog
The forums have a pretty restrictive policy about the document types that can be uploaded. I have added both .DWS and .DYALOG to the list, and it now seems possible to attach workspaces. Yours is attached: We will investigate your problem, it does seem a little mysterious. Thanks for the report and the repro!

Re: Instance with no parent

Posted: Mon Apr 04, 2011 6:26 pm
by Erik.Friis
Is there a difference between using ##.[]THIS and []THIS.## ? I have been using the former im my code, but perhaps the latter more correct.

Re: Instance with no parent

Posted: Tue Apr 05, 2011 8:07 am
by JohnD|Dyalog
Hi Erik,

##.⎕this and ⎕this.## should be equivalent. It's entirely your preference which you choose to use.

Best Regards,
John Daintree