如何在 VBA 中将字节数组作为函数参数传递?
在 VB 功能中,将EPC HEX字写入RFID标签:
Public Shared Function WriteEPC_G2(ByRef ConAddr As Byte, **ByVal Password() As Byte**, **ByVal WriteEPC() As Byte**, ByVal WriteEPClen As Byte, ByRef errorcode As Integer, ByVal PortHandle As Ineger) As Integer
使用函数生成粗体参数,该函数从文本框生成字节数组(密码“00000000”和ECP写入“即1234”)
Private Function HexStringToByteArray(ByVal s As String) As Byte()
s = s.Replace(" ", "")
Dim buffer(s.Length / 2 - 1) As Byte
Dim i As Integer
For i = 0 To s.Length - 2 Step 2
buffer(i / 2) = Convert.ToByte(s.Substring(i, 2), 16)
Next
Return buffer
End Function
答案 0 :(得分:0)
VBA有一个内置函数可以做到这一点:
var isDown = false;
$(document).mousedown(function(e) {
isDown = true;
});
$(document).mousemove(function(e) {
if(isDown) {
console.log(e.pageX + ',' + e.pageY);
}
});
$(document).mouseup(function(e) {
isDown = false;
});