Try OpenEdge Now
skip to main content
ProDataSets
Dynamic ProDataSet Basics : Creating a dynamic ProDataSet : Passing ProDataSets
 

Passing ProDataSets

If you want to pass only the ProDataSet handle to another local procedure, which can then access methods and attributes through the handle, use the HANDLE parameter form. As with any other object, this form cannot be used in a remote call.
If you want to pass a reference to the entire ProDataSet structure and data to another procedure, whether local or remote, use the DATASET-HANDLE parameter form. In this case, the receiving procedure can also use the DATASET-HANDLE form to receive the ProDataSet as a dynamic object and access it through its handle.
If the receiving procedure has a static ProDataSet definition, then it can receive the ProDataSet as a static object using the DATASET parameter form, even though the ProDataSet was created dynamically.
In either of these latter two cases, where you pass the ProDataSet as a DATASET-HANDLE, you can pass it by reference when the call is local. Just like when you pass static ProDataSets, the call incurs no overhead from copying the ProDataSet.
Remember that when you pass a ProDataSet remotely or by value (the default), the AVM instantiates the ProDataSet, along with its temp-tables, buffer, relations, and all the temp-table data, in the procedure that receives the ProDataSet. If you use the dynamic DATASET-HANDLE form in the procedure that receives the ProDataSet, then the procedure can access all the ProDataSet elements through its attributes and methods.