I tried to replicate Fred’s demo from the January 5th (or 12th) screen cast where he enabled C# methods with APL attributes. See my C# code below.
I was unable to reference the APLadd function from Cielo using the, a APLadd b , notation it worked just like the CSadd. So [APLNext.APL.Objects.AplFunctions()] did not seem to work. My C# class library project has APLNext.APL listed as a reference. I was able to use C# funcitions: APLadd, CSadd and dltb from Cielo if they were referenced using the C# notation func(). Executing
10 APLadd 21 from Cielo returned:
10 <built-in function APLadd> 21
Here is the C# Class code:
public class CStestClass1
{
[APLNext.APL.Objects.AplFunction()]
public static object APLadd(object a, object b)
{
if ((a is int) && (b is int))
{
return (int)a + (int)b;
}
throw new ApplicationException("Domain Error - interger expected");
}
public static int CSadd(int a, int b)
{
return a + b;
}
public static object dltb(object a)
{
if (a is string)
{
return ((string)a).Trim();
}
throw new ApplicationException("Domain Error - string expected");
}
}