Archived Boards > COM Automation and dotNet

WB2013 and Convert Class

(1/2) > >>

stanl:
Just wanted to know the caveats associated with exploring the .net Convert Class, i.e. convert to/from Base64 etc..
 
 

Deana:

--- Quote from: stanl on June 11, 2013, 05:36:12 am ---Just wanted to know the caveats associated with exploring the .net Convert Class, i.e. convert to/from Base64 etc..

--- End quote ---

Not sure to be honest. I have never worked with that specific class. Maybe someone that has, will chime in.

stanl:

--- Quote from: Deana on June 11, 2013, 08:03:17 am ---Not sure to be honest. I have never worked with that specific class. Maybe someone that has, will chime in.

--- End quote ---
Thanks. It looks easy. The basic class has methods that convert stuff, but when I looked at some C# and PS code it seems there are bit and array variables that have to be initialized and that looked a little intimidating as you had mentioned in a previous post I made to stay away from the CLR arrays.

td:

--- Quote from: stanl on June 11, 2013, 08:12:09 am ---...
Thanks. It looks easy. The basic class has methods that convert stuff, but when I looked at some C# and PS code it seems there are bit and array variables that have to be initialized and that looked a little intimidating as you had mentioned in a previous post I made to stay away from the CLR arrays.

--- End quote ---

Generally, WIL arrays work as [in] parameters to CLR methods or property assignments.  If you have a WIL array of numbers and the CLR method parameter is expecting something other than 4 byte intenger elements you may have to use ObjectType. For example, if an parameter is expecting an array of signed bytes you might need to do something like the following


--- Code: Winbatch ---aBytes = ArrDimension(2)
aBytes[0] = 1
aBytes[1] = 2

saBytes = ObjectType("array|i1", aBytes)
 before you pass the array to the method. 

The only other caveat is you cannot call methods that fill an array parameter with values.  This is because WinBatch does not support [out] parameters for CLR class methods.

stanl:

--- Quote from: td on June 11, 2013, 09:25:01 am ---This is because WinBatch does not support [out] parameters for CLR class methods.

--- End quote ---

So this is a no-go?
http://msdn.microsoft.com/en-us/library/system.convert.frombase64string.aspx

Navigation

[0] Message Index

[#] Next page

Go to full version