Microsoft Small Basic
RSS

Navigation





Quick Search
»
Advanced Search »

PoweredBy

Events

RSS
Modified on 2012/01/21 17:12 by 69.108.234.26 Categorized as Uncategorized
Let's say we want a bell to ring when we click the mouse. It's easy enough to create a subroutine that rings the bell.

Sub PlayBell
  Sound.PlayBellRing()
EndSub

But how do we tell this subroutine to play when the mouse is clicked? We use something called 'events'.
This icon indicates an event

This icon indicates an event


Normally if you wanted to play the bell you would write
PlayBell()
However when setting an event, you leave off the parentheses to indicate that you are not calling the subroutine, but rather that you want the subroutine to be called.

GraphicsWindow.MouseDown = PlayBell

ScrewTurn Wiki version 3.0.5.600. Some of the icons created by FamFamFam.