EventArgs and Static Temp-Table (or ProDataSet)

Posted by jquerijero on 18-May-2012 16:05

If you want to follow .NET programming style for custom event, the input parameters are normally System.Object and System.EventArgs (or derived class). I know you can add the a HANDLE property to the derived System.EventArgs and assign it with the static temp-table handle, but this forces the event handler to process the temp-table in dynamic mode. Is there a preferred way of passing along static temp-table when publishing an event? 

All Replies

Posted by Peter Judge on 21-May-2012 07:41

You can add a method which takes a static temp-table. Something to consider here is that you're making a deep copy every time you do this (unless you pass BY-REFERENCE).

You could also wrap the TT in a class, and set that wrapper class as a property. Single deep copy here, although more complex to work with.

I've used the plain handle for simplicity's sake.

-- peter

Posted by jquerijero on 21-May-2012 09:41

Is there a trick to convert the handle back to static temp-table?

Posted by Admin on 21-May-2012 09:46

Is there a trick to convert the handle back to static temp-table?

Map an OUTPUT TABLE to an OUTPUT PARAMETER TABLE-HANDLE and vice versa.

Posted by jquerijero on 21-May-2012 13:30

Something like this;

EventHandler(sender, e as DerivedEventArgs):

  ConvertHandle(e:TableHandle, OUTPUT TABLE myTable).

End.

Private ConvertHandle(myHandle, OUTPUT TABLE-HANDLE myTableHandle ):

  myTableHandle = myHandle.

End.

This thread is closed