1
2
3
4
5
6
7
8
9
10
11
12
13
14
| [size=1em]Function [size=1em]Bytes2BStr(vin)[size=1em]'二进制转字串
[size=1em] [size=1em]strreturn = [size=1em]""
[size=1em] [size=1em]for i = 1 to lenb(vin)
[size=1em] [size=1em]thischarcode = ascb(midb(vin,i,1))
[size=1em] [size=1em]if thischarcode < &h80 then
[size=1em] [size=1em]strreturn = strreturn & chr(thischarcode)
[size=1em] [size=1em]else
[size=1em] [size=1em]nextcharcode = ascb(midb(vin,i+1,1))
[size=1em] [size=1em]strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode))
[size=1em] [size=1em]i = i + 1
[size=1em] [size=1em]end if
[size=1em] [size=1em]next
[size=1em] [size=1em]Bytes2BStr = strreturn
[size=1em]End [size=1em]Function
|