Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

I ask my vendor regarding on some device operation. They return me a code but I'm not sure what is the meaning of some code eg: <<, %x. Please find below. Need help from you guys to translate to VB.NET.

VB
micrLen =  (rsp[3] & 0x0f);
micrLen <<= 4;
micrLen += (rsp[4] & 0x0f);
micrLen -=6;			
mlogger.Printf(TRUE, "micrLen : %x",micrLen);
Posted

Unless the vendor is using some language of their own, << is the bitwise left shift operator - http://en.wikipedia.org/wiki/Bitwise_operations_in_C[^].

%f stands for printing in float.
Try http://www.codingunit.com/printf-format-specifiers-format-conversions-and-formatted-output[^].
 
Share this answer
 
This could be any language implementing << as an operator. It normally is a bit shift operator. << for left and >> for shifting bits to the right. You can just use them in vb.net because it also has the same operators for bit shifting. You can look into String.Format for the printf equivelent.
http://msdn.microsoft.com/en-us/library/0c899ak8%28v=vs.110%29.aspx[^]

Good luck!
 
Share this answer
 

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