liangx85

VBA使用的Randomize和DoEvents

Randomize

private function getInt()

  dim n,m as integer

  Randomize

  n=1

     m=3

  getInt=Int((m+1-n)*rnd + n)

 end function

 

DoEvents

dim c as Boolean

private sub gameMain()

  while c

    Do Until z <> iNew

      iNew = getnt

    loop

    z = iNew

           Image1.Picture = LoadPicture(path)

    doEvents

  Wend

end sub

private sub do()

  dim str as String

  str = iif(str = "s","L","S")

  c = not c

  gameMain

end sub

posted on 2013-12-21 09:48  liangx85  阅读(1116)  评论(0编辑  收藏  举报

导航