Forum Post: AW: Converting c# code to Progress

Status
Not open for further replies.
M

Mike Fechner

Guest
Progress.Util.TypeHelper:GetType("System.Byte[]"). Von meinem Windows Phone gesendet Von: tbergman Gesendet: ‎21.‎03.‎2014 02:11 An: TU.OE.Development@community.progress.com Betreff: Converting c# code to Progress Converting c# code to Progress Thread created by tbergman I'm converting the following code snippet to Progress. I got it to work but my solution seems a bit inelegant. ImageConverter _imageConverter = new ImageConverter(); byte[] xByte = (byte[])_imageConverter.ConvertTo(x, typeof(byte[])); return xByte; Note that the second parameter of the ConvertTo method has to be a System.Type. What I ended up doing was defining a Byte[] and then using GetType against it. This works but I had to new a byte array and it seems like there should be a cleaner way. Is there something in Progress that's like the C# Typeof command, the Progress Type-Of statement returns a logical, not a System.Type. DEF VAR x AS "System.Byte[]" . x = NEW "System.Byte[]" ( 0 ). RETURN CAST (oConverter:ConvertTo(pImage, x :GetType()), "System.Byte[]" ). Stop receiving emails on this subject. Flag this post as spam/abuse.

Continue reading...
 
Status
Not open for further replies.
Top