Page 1 of 1

User Defined Data Properties

PostPosted: March 3rd, 2011, 1:31 pm
by Ajay Askoolum
I have not managed to assign an object to a user defined data property of the system object AND then use it as an object; the assignment works but any attempt to use it fails:

Code: Select all
⎕WI CREATION ERROR: Invalid object pointer

It would be handy to hold all instances of general purpose objects as children of the system object: this will make it possible to manage all the objects in specific functions e.g. initialization, error handler, application exit ec.

Can this be implemented?

PostPosted: March 3rd, 2011, 4:35 pm
by Tech Support
Please provide one or more examples of the enhancement you've requested.

PostPosted: March 3rd, 2011, 5:44 pm
by Ajay Askoolum
There are inumerable COM objects on the Windows platform that expose generic utilities that can be very useful (time-saving) for APL+Win application development.

Some examples are Scripting.FileSystemObject, Shell.Application, Shell.Explorer, IExplore.Application etc.

The methods and properties of any such COM object can be used/called from any context within an application. Each call has to establish whether the object exists and if not, it has to create it first; this adds an unnecessary overhead, I think, and introduces the likelihood of a name clash.

I am envisaging a scenario whereby a function at application startup creates any or all these objects; likewise at application exit, another function releases all of these objects.

This is possible now, obviously. However, each such object becomes a child of the system object ... to me this looks like clutter that requires management. I would like these objects to be contained within the '#' class itself and not be enumerated as its children.

I'd like to be able to do the following:

[code]'#' ⎕wi '∆sa' (⎕wi 'Create' 'Shell.Application') â

PostPosted: March 3rd, 2011, 6:56 pm
by Tech Support
When executing the first statement, you should have been able to tell from the error message reported by APL+Win:
Code: Select all
⎕WI OBJECT ERROR: Current object undefined
what was responsible for the failure, which is you hadn't given the name for the object to be created (in the argument).
The following:
Code: Select all
'#' ⎕wi '∆shell' ('shell' ⎕wi 'Create' 'Shell.Application')
does work as demonstrated below:
Code: Select all
      '#' ⎕wi '∆shell' ('shell' ⎕wi 'Create' 'Shell.Application')
      ('#' ⎕wi '∆shell') ⎕wi 'methods'
 Close Create Defer Delete EnumEnd EnumNext EnumStart Event Exec Info Modify New
       Open Ref Send Set SetLinks XExplorerPolicy XGetSetting XToggleDesktop XWi
      ('#' ⎕wi '∆shell') ⎕wi '?XToggleDesktop'
XToggleDesktop method:
  ⎕WI 'XToggleDesktop'
Raise/lower the desktop

PostPosted: March 4th, 2011, 2:09 am
by Ajay Askoolum
Code: Select all
 '#' ⎕wi '∆shell' ('shell' ⎕wi 'Create' 'Shell.Application')

Not quite what I had in mind because:

1 The udp holds a string value, namely the literal 'shell'.
2. As a result, if the object 'shell' is deleted,

Code: Select all
('#' ⎕wi '∆shell') ⎕wi 'methods'

no longer works.

I would like the udp to hold an object pointer without the need to create an object as a child of # when the udp is assigned.

In other words, I'd like a collections object in # that will hold object pointers.

PostPosted: March 6th, 2011, 11:53 pm
by Tech Support
Thanks for clarifying your enhancement request. The current implementation of the upd property doesn't support an object pointer. We will put this on the list to research and try to determine if there is broad appeal for this enhancement.