Page 1 of 1

Some questions

PostPosted: October 20th, 2013, 6:41 am
by Ajay Askoolum
1. Having defined function(s) using ExecStmt:
- Is there a way of enumerating those functions?
- How do I call a particular function?

2. Does []cse permit calls with arguments? E.g.

Rather than obj []cse 'ExecStmt" 'string abc = myfunction(arg1,arg2);'
- How can I abc<- obj []cse 'Exec' 'myfunction(arg1,arg2);' ?
- How can I abc<- obj []cse 'Exec' 'myfunction(arg1,arg2)' (arg1 arg2) ?

Re: Some questions

PostPosted: October 20th, 2013, 6:47 am
by Ajay Askoolum
Do not respond - found the answers around page 35 of the CSE manual.

Re: Some questions

PostPosted: October 23rd, 2013, 5:47 pm
by joe_blaze
Hi Ajay,

A reply is provided here because the CSE documentation is an on-going project and the page numbers change.
See the attached pdf-format document for a few examples.
Not exactly what you were doing, but provides the same functionality.

Note that the []CSE is not designed to mimic the []WI interface of APL+Win.

Joe

Re: Some questions

PostPosted: October 27th, 2013, 5:54 am
by joe_blaze
Ajay asks:
Having defined function(s) [C# method(s)] using ExecStmt:
Is there a way of enumerating those functions?

Joe comments:
Yes, if the C# method, 'result_type M1(...)' is defined within a C# class definition, 'Class1':
    Use []CSE 'ExecStmt' 'Class1 c1 = new Class1();' to create an instance of the class containing the definition of the C# method 'M1(...)'.
    Use []CSE 'GetValue ' 'c1.M1(...)' to execute the method and return the result to APL+WIn, or
    Use []CSE 'ExecStmt' 'result_type res = c1.M1(...)' to execute the method and put that value into a C# field
    that

Currently No, if the C# method is defined directly in the CSE instance and not in a C# class definition:
e.g. []CSE 'ExecStmt' 'result_type M1(...){...}'
However a future version of the CSE will enhance the CSE 'GetMethods' and 'GetProperties' and provide a 'GetFields' method
so that C# methods, properties and fields defined directly in a C# instance without a containing C# class definition can be listed.

Re: Some questions

PostPosted: May 22nd, 2014, 11:34 am
by joe_blaze
The CSE 'GetVariables', 'GetMethods' and 'GetProperties' methods have been enhanced to provide this information.