get contents of array returned by method in .Net Assembly

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

get contents of array returned by method in .Net Assembly

Postby ConvertFromOldNGs » Sat Aug 08, 2009 11:41 am

by John Munro >> Fri, 7 Aug 2009 20:52:37 GMT

I have imported a .NET dll. I will be creating an instance of an object
imported from the dll, and I need to be able to call a method on the
object that returns an array of other objects.

My problem is that the method imported into Jade has a return type of
JadeDotNetType, and I don't know how to turn that into an array.

Anyone have any ideas?

John

rangerdunadan
Posts: 6
Joined: Sat May 01, 2010 10:53 am

Re: get contents of array returned by method in .Net Assembl

Postby rangerdunadan » Fri Sep 24, 2010 4:36 am

Hey John,

Did you figure out how to do this? I have the same issue.... .NET is returning a System.String[] and Jade has returned a JadeDotNetType. I don't know how to use the JadeDotNetType to get the individual strings from the System.String[].

I'm wondering if I need to import the mscorlib into Jade??

What do you think?

Ranger.

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: get contents of array returned by method in .Net Assembl

Postby ghosttie » Fri Sep 24, 2010 5:21 am

String arrays aren't supported (NFS #52700). If you're writing the .NET dll, you could create a method to get the individual strings in the array e.g. get(index : Integer) : String;
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

rangerdunadan
Posts: 6
Joined: Sat May 01, 2010 10:53 am

Re: get contents of array returned by method in .Net Assembl

Postby rangerdunadan » Fri Sep 24, 2010 8:17 am

Thank you for the reply.

Do you know if a byte[] is supported or is the recommended way to return individual bytes?

Thanks again for you quick reply.

Ranger.

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: get contents of array returned by method in .Net Assembl

Postby ghosttie » Fri Sep 24, 2010 8:43 am

I don't know for sure, but I don't think any primitive arrays are suported
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

User avatar
Jade Support
Posts: 103
Joined: Mon Aug 17, 2009 10:27 am
Location: Jade Software Corporation, Christchurch

Re: get contents of array returned by method in .Net Assembl

Postby Jade Support » Fri Sep 24, 2010 2:04 pm

@rangerdunadan, ghosttie is correct, no primitive array types are supported. The aforementioned NFS (#52700) is open to address this.

An alternate solution could be to create a small .NET component with a method that takes a string and returns a string array. In JADE this would be imported as a method that takes a StringUtf8 and returns a JadeDotNetType. This returned value could then be used wherever a .NET string array is required.

If you don't want to create your own component, then you may want to consider importing part of mscorlib which contains the definition of the .NET String type. String has a method, 'Split' which divides a string up into an array of substrings.

I hope this helps.

Regards,
Jade Support
Jade Software Corporation Ltd

Email: jadesupport@jadeworld.com
Web: http://www.jadeworld.com

Jade Software – complex business problems solved beautifully.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 40 guests