Click here to Skip to main content
15,886,676 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm trying to convert this line in cs to vb, I understand it's a logical operator

To the best of my understanding, this is how I interpreted the cs code below
converted += (newByteArray[i] & 0x80) > 0 ? "1" : "0";


my best guess in vb
converted += if newByteArray[i] & &h80 = 0 then "1" or else "10"
Posted
Updated 20-Jun-12 12:20pm
v2
Comments
Sergey Alexandrovich Kryukov 20-Jun-12 17:24pm    
What's the concern? Did you compile your code? Run it? Tested? Why VB.NET, after all?
--SA
jkirkerx 20-Jun-12 17:33pm    
Because I want to use the code for a filebrowser that I'm writing for ckEditor, and I already wrote the full dll server control in vb, and I can't mix cs with my vb dll.

I just need to make sure that the swf file is less than 670px wide, or I need to change the size.
jkirkerx 20-Jun-12 18:13pm    
What's wrong with my question and why did you down vote it?
Do I need to rewrite the question?
ledtech3 20-Jun-12 23:55pm    
here is a code converter you can try In the future.
http://converter.telerik.com/
Remember not all C# converts well to VB.Net

converted += If((newByteArray(i) And &H80) > 0, "1", "0")
 
Share this answer
 
Comments
jkirkerx 20-Jun-12 19:34pm    
I ended up with this while trying to work it out. Quite a contrast from yours, but I think I see why my first version of the question got voted down, because I was so close to the anwser. Let me try it out.

<pre>
If (newByteArray(idx) And &H80) > 0 Then
converted = converted & "1"
Else
converted = converted & "0"
End If
</pre>
you could try this:
converted += if ( newByteArray[i] AND &h80 ) then "1" or else "10"

I'm not sure how this will test for px count. Use "AND" instead of "&"

-rwg
 
Share this answer
 
Comments
jkirkerx 20-Jun-12 20:23pm    
It's just one line I didn't understand in a much larger class written in CSharp.

I'm starting to wonder how it gets the dimensions of a swf or flv file as well. So far it's not looking that good here.

I started the project in vb, and I really don't ever write csharp.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900