Array expression on the fly

View previous topic View next topic Go down

Array expression on the fly

Post  rsdunlapiv on Thu Nov 10, 2011 2:03 am

I have created a user-defined data type in C# that accepts integer arrays as a parameter. Is there a way in the CSP to create an array "on the fly" and pass it to my data type?

For example:
Code:
var <IntArrayList> intList;
...
intList.Add([1, 2, 3, 4, 5]);

It seems that the only way to do it is to create a CSP array variable, initialize it, and pass the variable to the C# data type.

rsdunlapiv

Posts : 1
Join date : 2011-11-10

View user profile

Back to top Go down

Re: Array expression on the fly

Post  pat team on Thu Nov 10, 2011 10:08 pm

You are right. It is not supported.
One workaround is to use a global variable and declare it as hvar.
hvar will not be part of the system state, so you can use it as the temporary variable.

I will check whether I can support it in CSP module. If yes, I will let you know.
Please pass us your email. in case of any issue, I can email immediately.

rsdunlapiv wrote:I have created a user-defined data type in C# that accepts integer arrays as a parameter. Is there a way in the CSP to create an array "on the fly" and pass it to my data type?

For example:
Code:
var <IntArrayList> intList;
...
intList.Add([1, 2, 3, 4, 5]);

It seems that the only way to do it is to create a CSP array variable, initialize it, and pass the variable to the C# data type.

pat team
Admin

Posts : 17
Join date : 2010-02-15

View user profile http://www.comp.nus.edu.sg/~pat/

Back to top Go down

Re: Array expression on the fly

Post  pat team on Fri Nov 11, 2011 2:09 am

I released a testing version to support this feature.
you can now put array as process arguments and call arguments.
http://www.comp.nus.edu.sg/~pat/PAT3.Setup.Test.msi

I didn't make it as generic type due to too many type checking

Let me know if anything wrong or more suggestions of the language.

rsdunlapiv wrote:I have created a user-defined data type in C# that accepts integer arrays as a parameter. Is there a way in the CSP to create an array "on the fly" and pass it to my data type?

For example:
Code:
var <IntArrayList> intList;
...
intList.Add([1, 2, 3, 4, 5]);

It seems that the only way to do it is to create a CSP array variable, initialize it, and pass the variable to the C# data type.

pat team
Admin

Posts : 17
Join date : 2010-02-15

View user profile http://www.comp.nus.edu.sg/~pat/

Back to top Go down

Re: Array expression on the fly

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum