Hi there folks! Since winter is on the way, I wanted to add some snow to an app for the students. Get them in the Christmas spirit! So, I found a snippet of code on the net..

VB Code:
  1. Dim x(150), y(150), ptimer
  2.  
  3. Private Sub Form_KeyPress(KeyAscii As Integer)
  4. If KeyAscii = 27 Then
  5. Unload Me
  6. End If
  7. End Sub
  8.  
  9. Private Sub Form_Load()
  10. Form1.Width = 15360
  11. For Var = 0 To 150
  12. x(Var) = Form1.ScaleHeight * Rnd
  13. y(Var) = Form1.ScaleWidth * Rnd
  14. Form1.Circle (x(Var), y(Var)), 10, QBColor(15)
  15. Next Var
  16. End Sub
  17.  
  18. Private Sub Snow_Timer()
  19. If Timer < ptimer + 0.01 Then Exit Sub
  20. Form1.Cls
  21.  
  22. For Var = 0 To 150
  23. 'x(Var) = Form1.ScaleHeight * Rnd
  24. 'y(Var) = Form1.ScaleWidth * Rnd
  25. s = Int(Rnd * 50)
  26. x(Var) = Val(x(Var) + s)
  27. r = Int(Rnd * 50)
  28. y(Var) = Val(y(Var) + r)
  29. If x(Var) > Form1.ScaleHeight Then
  30. x(Var) = -1
  31. End If
  32. If y(Var) > Form1.ScaleWidth Then
  33. y(Var) = -1
  34. End If
  35. Form1.Circle (x(Var), y(Var)), 15, QBColor(15)
  36. ptimer = Timer
  37. Next
  38. End Sub

The problem is now that I integrated it, it is saying I need to define "var", but it didn't need to be in the example code by itself?

Where did I go wrong?

Thanks!!