.01234567899 四个为一组 需要几组

#1楼 得分:0
回复于:2004-09-29 20:24:58
b(0),b(1),b(2),b(3)
(doxob)
等 级:
#2楼 得分:0
回复于:2004-09-29 21:15:51
b(3),b(2),b(1),b(0)
(路人甲)
等 级:
#3楼 得分:0
回复于:2004-09-29 21:28:15
Dim strTemp As String
Dim i As intger
for i=1 to 4 strtemp=strtemp+b(i)
(路人甲)
等 级:
#4楼 得分:0
回复于:2004-09-29 21:29:55
不好意思,上面错了
Dim strTemp As Byte
for i=1 to 4 strtemp=strtemp+b(i)
等 级:
#5楼 得分:0
回复于:2004-09-30 09:36:20
路人甲,可以这么加吗?
那如果我想在一组字节数组前边加四个字节的话,应该怎么办?
等 级:
#6楼 得分:0
回复于:2004-09-30 09:37:18
或者说是把两个字节数组合并成一个字节数组
等 级:
#7楼 得分:0
回复于:2004-09-30 11:35:48
路人甲,你这是给我出的骚主意! 根本不能这样写. 语法都是错误的.
(静子)
等 级:
#8楼 得分:0
回复于:2004-09-30 12:03:39
不知道你所说的两个字节数组合并成一个字节数组是什么意思呢?
以下只是把前4个字节数的内容取出来
Dim strem As string
dim i as integer
for i=0 to 3 strem = strem &am Str(b(i)) next i
(狼行天下)
等 级:
#9楼 得分:0
回复于:2004-09-30 13:09:27
USE API: copymemory ,搜搜用法
(狼行天下)
等 级:
#10楼 得分:0
回复于:2004-09-30 13:13:31
这样也可以:
Private Sub Command1_Click()
Dim a() As Byte, b() As Byte
a = 中华人民共和国
ReDim Preserve b(3)
MsgBox b
End Sub
(狼行天下)
等 级:
#11楼 得分:0
回复于:2004-09-30 13:19:51
Private Declare Sub CopyMemory Lib kernel32.dll Alias RtlMoveMemory (Destination As Any, Source As Any, ByVal Length As Long)
Private Sub Command1_Click()
Dim a() As Byte, b(3) As Byte
a = 中华人民共和国
copybyte a, 4, b
MsgBox b
End Sub
Sub copybyte(ByRef s() As Byte, n As Long, ByRef result() As Byte)
CopyMemory result(0), s(0), n
End Sub
(狼行天下)
等 级:
#12楼 得分:0
回复于:2004-09-30 13:25:47
Private Declare Sub CopyMemory Lib kernel32.dll Alias RtlMoveMemory (Destination As Any, Source As Any, ByVal Length As Long)
Private Sub Command1_Click()
Dim a() As Byte, b() As Byte, c() As Byte
a = 中华人民共和国
b = 中国***
addbyte a, b, c
MsgBox c
End Sub
Sub addbyte(ByRef a() As Byte, ByRef b() As Byte, ByRef c() As Byte) ' add two byte array ,b before a,to be a new c
ReDim Preserve c(UBound(a) + UBound(b) + 1)
CopyMemory c(0), b(0), UBound(b) + 1
CopyMemory c(UBound(b) + 1), a(0), UBound(a) + 1
End Sub
(易风)
等 级:
#13楼 得分:0
回复于:2004-09-30 13:40:44
楼上的搞这么复杂干什么啊?
等 级:
#14楼 得分:0
回复于:2004-09-30 13:59:43
收藏 狼行天下的方法…….
等 级:
#15楼 得分:0
回复于:2004-09-30 15:43:08
(发飙玩命)
等 级:
#16楼 得分:0
回复于:2004-09-30 18:55:33
dim str1 as string
dim str2 as string
str1= 你取出的字符串
str2=mid(str1,1,4)
这样就可以取出前四个数据了
mid 就是取出指定字符串的函数
(trickster)
等 级:
#17楼 得分:0
回复于:2004-09-30 19:20:24
那个Redim的方法很好,呵呵,真没想过还可以这样用的,谢了。
(西文)
等 级:
#18楼 得分:0
回复于:2004-10-05 08:59:35
统一fabiaowanming(发飙玩命) northwolves(狼行天下) 的方法都很好,我最近有相同问题,也用的这两个方法信息提示
您的同一ip请求过于频繁,如果希望继续访问,请输入验证码:
Copyright 1998 – 2010 Tencent. All Rights Reserved.信息提示
您的同一ip请求过于频繁,如果希望继续访问,请输入验证码:
Copyright 1998 – 2010 Tencent. All Rights Reserved.

参考资料