数组的最大下标*0.98,取整 dim x() n=100 redim x(1 to n) u =ubound(x) m=int(u*0.98) msgbox x(m)
dim num() as integer dim numall as integer Private Sub Text1_KeyPress(KeyAscii As Integer) if keyascii=13 then numall=numall+1 ReDim Preserve num(1 to numall) as integer num(numall)=val(text1.text) end if end sub private sub command1_click() int a as integer a=int(numall*98/100) magbox "%98处数据为" & num(a) end sub
dim x()
n=100
redim x(1 to n)
u =ubound(x)
m=int(u*0.98)
msgbox x(m)
dim numall as integer
Private Sub Text1_KeyPress(KeyAscii As Integer)
if keyascii=13 then
numall=numall+1
ReDim Preserve num(1 to numall) as integer
num(numall)=val(text1.text)
end if
end sub
private sub command1_click()
int a as integer
a=int(numall*98/100)
magbox "%98处数据为" & num(a)
end sub