1樓:匿名使用者
private sub command1_click()
cutmask = "111100000000000000000000"
x1 = mid(cutmask, 1, 8)
x2 = mid(cutmask, 9, 8)
x3 = mid(cutmask, 17, 8)
a = 0
for i = 1 to 8
a = a + val(mid(x1, i, 1)) * 2 ^ (8 - i)
next i
b = 0
for i = 1 to 8
b = b + val(mid(x2, i, 1)) * 2 ^ (8 - i)
next i
c = 0
for i = 1 to 8
c = c + val(mid(x3, i, 1)) * 2 ^ (8 - i)
next i
print a; b; c
end sub
2樓:匿名使用者
private sub form_load()dim s as string
s = "111100000000000000000000"
a = aaa(left(s, 8))
b = aaa(mid(s, 9, 16))c = aaa(right(s, 8))
end sub
function aaa(byval num as string) as long
dim i as long
dim n as long
for i = 1 to len(num)n = n * 2 + val(mid(num, i, 1))next i
aaa = n
end function
java字串字串亂碼問題
jsp在地址裡直接傳漢字是有這個亂碼問題。可以採用public string tostring string s catch exception e public string ex chinese string str else catch exception ex return str 來轉換!...
回答正確 100分vb替換字串問題
private sub foo lptext as string 傳入原字串 dim temp as string,i as integer,result as string temp split lptext,vbcrlf 按回車換行分開 for i 0 to ubound temp 對於每行 i...
字串問題
你可以這樣處理 先查詢字串 得到它的地址以後,再往上搜尋,直到遇到字元 這樣就得到歌名的字串的位置了 將整個字串反轉,有個makereverse成員的函式可以直接實現這個功能.然後查詢第一個 找出是第幾個字元,假設是m,字串長度為n 將字串反轉回來後,取字串n,m 直接呼叫api lptstr pa...