如题
解决方案 »
- 如何结束指定应用程序
- 各位大哥,100份求救!处理一excel数据文件,怎样将这个excel中的某一行在满.....
- 关于用create table创建数据表时,表名问题
- 有关动太创建非MDI CHILD窗口欺骗MDI CLIENT窗口的问题.解决问题者送1000分.
- 安装工厂生成的安装程序能支持多语言安装吗?
- 救救!到底什么地方出现问题?(一个ActiveX Exe 例子)
- VBA是什么?能否举个例子说明一下
- 如何实现这样的联合查询?急!
- access自动增加类型字段最大值为多少?会不会用完?
- 有一个按扭,点一下后运行别的exe文件,代码怎么编啊?
- datagird
- 如何产生给定范围内的呈正态分布的随机数据
dim b1(1) as byte
dim b2(0) as byte
dim b3(0) as byte
b1(0)=b1(0)
b1(1)=b3(0)
比较长的则用copymemory
b3=b1+b2
是这个意思吗?
具体怎么用,没看明白
dim b1 as byte,b2 as byte,b3 as byte
b3=b1+b2
是一种
还有b1=b1+b2怎么相加
dim b1() as byte
dim b2() as byte
dim b3() as byte
dim m as integer,n as integer,L as integerredim b2(1 to m)
redim b3(1 to n)
L=m+n
redim b1(1 to L)
copymemory b1(1),b2(1),m '复制b2到b1
copymemory b2(m+1),b3(1),n '复制b3到b1,加到b2后面
copymemory b1(m+1),b3(1),n '复制b3到b1,加到b2后面
应该是
copymemory b1(m+1),b3(1),n '复制b3到b1,加到b2后面吧
i=b1 * &h100 +b2
如下数据源
Byte1(0)=84
Byte1(1)=101
Byte1(2)=120
Byte1(3)=116
Byte1(4)=49Byte2(0)=226
Byte2(1)=70
Byte2(2)=188
实现效果为
Byte1(0)=84
Byte1(1)=101
Byte1(2)=120
Byte1(3)=116
Byte1(4)=49
Byte1(5)=226
Byte1(6)=70
Byte1(7)=188
dim b2 as byte
dim b3 as byte
b3 = (b1 and &hf0) + (b2 and &h0f)就是这样 取b1的高4位和b2的低4位合并到b3
dim b1 as byte
dim b2 as byte
dim b3 as byte
b3 = (b1 and &hf0) + (b2 and &h0f)就是这样 取b1的高4位和b2的低4位合并到b3
提示错误:在and处提示类型不匹配
dim b1() as byte
dim b2() as byte
dim b3() as byte
dim m as integer,n as integer,L as integerredim b2(1 to m)
redim b3(1 to n)
L=m+n
redim b1(1 to L)
copymemory b1(1),b2(1),m '复制b2到b1
copymemory b2(m+1),b3(1),n '复制b3到b1,加到b2后面m、n的初始值为多少?你试过吗?不成功啊
copymemory b2(m+1),b3(1),n '复制b3到b1,加到b2后面
应该是
copymemory b1(m+1),b3(1),n '复制b3到b1,加到b2后面
dim b2() as byte
dim b3() as byte
dim m as integer,n as integer,L as integerredim b2(1 to m)
redim b3(1 to n)
L=m+n
redim b1(1 to L)
copymemory b1(m+1),b3(1),n '复制b3到b1,加到b2后面m、n需要赋值的吧,运行通不过,出错了
对吗 通过数组完成 数组在内存中是连续的第二 是通过VC中的双字节完成 我不知道VB有没有
str = chrb(byte1) & chrb(byte2)
msgbox str
msgbox strconv(str, vbunicode)
Destination As Any, _
Source As Any, _
ByVal Length As Long)
Public Function ArrayLink(ByRef a1() As Byte, _
ByRef a2() As Byte, _
ByRef r() As Byte) As Boolean
On Error GoTo Proc_Error
ArrayLink = True
Dim lLength1 As Long, lLength2 As Long, lLength3 As Long
Dim pWritePoint As Long
pWritePoint = 0
lLength1 = UBound(a1) + 1
lLength2 = UBound(a2) + 1
lLength3 = lLength1 + lLength2
ReDim r(lLength3 - 1)
CopyMemory r(pWritePoint), a1(0), lLength1
pWritePoint = lLength1
CopyMemory r(pWritePoint), a2(0), lLength2
Exit Function
Proc_Error:
ArrayLink = False
End FunctionPublic Function ArrayInsert(ByRef a1() As Byte, _
ByRef a2() As Byte, _
ByRef r() As Byte, _
ByVal lStart As Long) As Boolean
On Error GoTo Proc_Error
ArrayInsert = True
Dim lLength1 As Long, lLength2 As Long, lLength3 As Long
Dim pWritePoint As Long
pWritePoint = 0
lLength1 = UBound(a1) + 1
lLength2 = UBound(a2) + 1
lLength3 = lLength1 + lLength2
If lStart > lLength1 Then GoTo Proc_Error
ReDim r(lLength3 - 1)
CopyMemory r(pWritePoint), a1(0), lStart
pWritePoint = lStart
CopyMemory r(pWritePoint), a2(0), lLength2
pWritePoint = pWritePoint + lLength2
CopyMemory r(pWritePoint), a1(lStart), lLength1 - lStart
Exit Function
Proc_Error:
ArrayInsert = False
End FunctionPublic Function ArrayReplace(ByRef a1() As Byte, _
ByRef a2() As Byte, _
ByRef r() As Byte, _
ByVal lStart As Long, _
ByVal lLength As Long) As Boolean
On Error GoTo Proc_Error
ArrayReplace = True
Dim lLength1 As Long, lLength2 As Long, lLength3 As Long
Dim pWritePoint As Long
pWritePoint = 0
lLength1 = UBound(a1) + 1
lLength2 = UBound(a2) + 1
lLength3 = lLength1 + lLength2 - lLength
If lStart + lLength > lLength1 Then GoTo Proc_Error
ReDim r(lLength3 - 1)
CopyMemory r(pWritePoint), a1(0), lStart
pWritePoint = lStart
CopyMemory r(pWritePoint), a2(0), lLength2
pWritePoint = pWritePoint + lLength2
CopyMemory r(pWritePoint), a1(lStart + lLength), lLength1 - lStart - lLength
Exit Function
Proc_Error:
ArrayReplace = False
End FunctionPublic Function ArrayCopy(ByRef aDestination() As Byte, _
ByRef aSource() As Byte, _
Optional ByVal lStart As Long = -1, _
Optional ByVal lLength As Long = -1) As Boolean
On Error GoTo Proc_Error
ArrayCopy = True
If lStart = -1 Then lStart = 0
If lLength = -1 Then lLength = UBound(aSource) + 1
If lStart + lLength > UBound(aSource) + 1 Then GoTo Proc_Error
ReDim aDestination(lLength - 1)
CopyMemory aDestination(0), aSource(lStart), lLength
Exit Function
Proc_Error:
ArrayCopy = False
End Function'=====================================================================其中ArrayLink()函数就是你想要的连接功能了dim a() as byte
dim b() as byte
dim c() as byte
........
.......
........
arraylink a,b,c将A和B连接起来用C返回
dim b2() as byte
Dim n As Long, j As Long
n = UBound(b1) + 1
j = UBound(b2) + 1 ReDim Preserve b1(n + j - 1)
CopyMemory b1(n), b2(0), j将b2追加到b1