# Re: 再问一个问题!!

Posted by daniel on October 03, 1999 at 12:34:45:

In Reply to: 再问一个问题!! posted by 康宝 on October 03, 1999 at 02:32:59:

: 程式中有一段叙述
: dim new1 as long
: dim new2 as long

: If Check1.Value = 1 Then
: New1 = "3"
: Else
: New1 = "0"
: End If
: If Check2.Value = 1 Then
: New2 = "3"
: Else
: New2 = "0"
: End If
: 请问
: 如果有三,四十个同样的判断,那要如何简化比较好呢?
: 能否举例说明一下!!
: 谢谢!!
把check1设为阵列,如check1(0),check1(1)..check1(n)
dim new(n) as integer n为阵列数

for i= 0 to n
new(i)=0
if check1(i).value=1 then
new(i)=3
end if
next

Follow Ups: