Quantcast
Channel: Small Basic
Viewing all articles
Browse latest Browse all 669

Small Basic – Synchronous and Asynchronous Type Operations

$
0
0

The challenge of this month has Multitasking Challenge.  In Small Basic, there are two types of operations.  One is synchronous type, the other is asynchronous type.  Most of operations are synchronous type that wait the operations done before starting the next step.  But some operations are asynchronous type that don’t wait the operations done.

Asynchronous Type Operations

Following operations are asynchronous type:

  • Shape.Animation()
  • Sound.Play()
  • Sound.PlayBellRing()
  • Sound.PlayChime()
  • Sound.PlayChimes()
  • Sound.PlayClick()

Synchronous Type Operations

Other operations than listed above are synchronous type.  Especially, following operations may need much time.

  • File.ReadContents()
  • Flickr.GetRandomPicture()
  • ImageList.LoadImage()
  • Network.GetWebPageContents()
  • Sound.PlayMusic()
  • Turtle.Move()

If you want to do something while running synchronous type operations, you should use events such as timer, mouse, keyboard or controls events.  On the other side, be careful to use these slow asynchronous type operations in an event handler subroutine.  The next event will occur while running the last event handler.


Viewing all articles
Browse latest Browse all 669

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>