PAT Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Array expression on the fly

2 posters

Go down

Array expression on the fly Empty Array expression on the fly

Post  rsdunlapiv 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

Back to top Go down

Array expression on the fly Empty Re: Array expression on the fly

Post  pat team 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

http://www.comp.nus.edu.sg/~pat/

Back to top Go down

Array expression on the fly Empty Re: Array expression on the fly

Post  pat team 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

http://www.comp.nus.edu.sg/~pat/

Back to top Go down

Array expression on the fly Empty Re: Array expression on the fly

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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