Dim i As IntegerDim x As IntegerDim y As IntegerDim a As StringDim c As IntegerDim b As IntegerDim e As IntegerDim f As IntegerDim d As Integeri = 0Dim z As IntegerFor j = 1 To 15 Step 1f = Mid(Text1.Text, j, 1)If f = "/" Theny = y + 1If y <> 15 ThenText2.Text = "標(biāo)簽缺少數(shù)據(jù),請(qǐng)錄入數(shù)據(jù)后再試!"ElsePrint yEnd IfIf Trim(Text1.Text) = "" ThenText2.Text = "請(qǐng)輸入數(shù)據(jù)。"ElseFor i = 1 To 15 Step 1a = Text1.Textx = InStr(Text1.Text, "//")c = InStr(Text1.Text, "#/")d = InStr(Text1.Text, "/#")f = InStr(Text1.Text, "##")If x <> 0 Or d = 0 Or c <> 0 Or f <> 0 Or y <> 15 ThenText2.Text = "標(biāo)簽格式錯(cuò)誤或者缺少數(shù)據(jù),請(qǐng)重新輸入"c = InStr(Text1.Text, "#/")ElseText2.Text = "標(biāo)簽OK,可以出貨。"End IfNext iEnd Sub
1 回答

Qyouu
TA貢獻(xiàn)1786條經(jīng)驗(yàn) 獲得超11個(gè)贊
For與Next是成對(duì)使用的,你發(fā)的程序中有2個(gè)For、1個(gè)Next,不匹配。目測(cè),你丟了一個(gè)Next j。程序會(huì)報(bào)錯(cuò)。
If與EndIf也是成對(duì)使用的,程序中有4個(gè)If,可是只有2個(gè)EndIf。也會(huì)報(bào)錯(cuò)。
你只能根據(jù)程序的作用和邏輯關(guān)系,在適當(dāng)?shù)奈恢醚a(bǔ)充足夠數(shù)量的Next和EndIf,就能接近問(wèn)題。
希望能幫到你。
添加回答
舉報(bào)
0/150
提交
取消