vb無效字元

2023-01-30 19:10:27 字數 1243 閱讀 8531

1樓:匿名使用者

option explicit

option base 1

private sub command1_click()

dim i as long, j as long, m as integer, st as string

dim a() as integer

for i = 100 to 999

'continue

for j = 2 to i - 1

if i mod j = 0 then

m = m + 1

abc (i) +1

a(m) =j

end if

next j

if m > o then

if yzh(a, st) then i & st

end if

erase a

next i

end sub

private function yzh(a() as integer, st as string) as bocllean

dim i as integer, j as integer

dim suml as long, sum2 as long, stl as string, st2 as string

for i = 1 to ubound(a)

for j = 2 to sqr(a(i))

if a(i) mod j = 0 then exit for

next j

if pageno then

sum1 = sum1 + a(i)

st1 = st1 & a(i) &

eisesum2 = sum2 + a(i)

st2 = st2 & a(i) &

end if

next i

if sum1 * 2 = sum2 then

end if

end function

'1.註釋行前 沒有 '

'2.逗號用中文,要用英文逗號。

2樓:寒信

第7行 continue vb裡沒有這玩意。

第11行有問題 abc(i)+1 這不是完整語句。

3樓:勢廣君

無效字元?說的是錯誤提示嗎?

vb獲取字串中字元,vb獲取字串中字元

private sub command1 click dim b as integer,a as string,i as integer,c as string,d as string a text1.text c d for i 1 to len a b asc mid a,i,1 if b 65...

VB特殊字元過濾,VB中一些特殊字元都怎麼表示

public function deletechars text as string as string dim s as string s chr 34 dim result as string result text dim i as long for i 1 to len s result r...

vb提取字串問題,急,VB中如何提取字串中的部分數字

你弄的太複雜了,看懂它比較累,看看下面 比較精簡了。const kout public function takeword str as string,n as long as string dim p1 as long p1 0dim p2 as long dim count as long do...