Some questions

General discussions related to using the C# Script Engine in APL+Win.

Moderators: Tech Support, phpbb_admin

Some questions

Postby Ajay Askoolum » October 20th, 2013, 6:41 am

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) ?
Ajay Askoolum
 
Posts: 636
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom

Re: Some questions

Postby Ajay Askoolum » October 20th, 2013, 6:47 am

Do not respond - found the answers around page 35 of the CSE manual.
Ajay Askoolum
 
Posts: 636
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom

Re: Some questions

Postby joe_blaze » October 23rd, 2013, 5:47 pm

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
Attachments
Some examples of using the CSE with a Class Definition.pdf
(273.05 KiB) Downloaded 192 times
joe_blaze
 
Posts: 382
Joined: February 11th, 2007, 3:09 am
Location: Box 361 Brielle, NJ 08730-0361

Re: Some questions

Postby joe_blaze » October 27th, 2013, 5:54 am

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.
joe_blaze
 
Posts: 382
Joined: February 11th, 2007, 3:09 am
Location: Box 361 Brielle, NJ 08730-0361

Re: Some questions

Postby joe_blaze » May 22nd, 2014, 11:34 am

The CSE 'GetVariables', 'GetMethods' and 'GetProperties' methods have been enhanced to provide this information.
joe_blaze
 
Posts: 382
Joined: February 11th, 2007, 3:09 am
Location: Box 361 Brielle, NJ 08730-0361


Return to APL+Win & The C# Script Engine

Who is online

Users browsing this forum: No registered users and 1 guest

cron