Cannot define METHOD param as .NET System.Data.DataRow, alth

Posted by slacroixak on 26-Apr-2018 09:47

Hi Forum,  using 11.6.2

This issue is so weird that I am wondering if I am just not missing an elephant in the room

On one hand I can do that fine:

DEFINE VARIABLE dataRow AS System.Data.DataRow NO-UNDO.

But on the other hand the following cannot compile:

METHOD MyMethod HANDLE (podatatable AS System.Data.DataTable):

with error : Invalid datatype specified: <type>. Specify a datatype such as 'character' or the name of a class. (5638)

Posted by Laura Stern on 26-Apr-2018 09:52

It don't think it is complaining about System.Data.DataTable.  You need to move the return type (HANDLE) to BEFORE the method name:

METHOD HANDLE MyMethod (podatatable AS System.Data.DataTable):

All Replies

Posted by Peter Judge on 26-Apr-2018 09:50

The return type must be before the method name.
 
METHOD HANDLE MyMEthod(poDataTable AS SystemData.DataTable)
 

Posted by Laura Stern on 26-Apr-2018 09:52

It don't think it is complaining about System.Data.DataTable.  You need to move the return type (HANDLE) to BEFORE the method name:

METHOD HANDLE MyMethod (podatatable AS System.Data.DataTable):

Posted by slacroixak on 26-Apr-2018 09:54

OOOpps, that was indeed an elephant in the room, sorry for the noise.

error 5638 was coming from the name of the method that was taken as a return type, because it was not at the right place regarding the ABL grammar

I was confused thinking it was coming from the definition of the 1st param, probably because it was at the same line

So this works fine

METHOD PUBLIC HANDLE dataRowsToTempTable (podatatable AS System.Data.DataRow ):

This thread is closed