Microsoft Small Basic

Small Basic Extensibility

Modified: 2010/08/02 00:24 by 76.14.123.152 - Categorized as: Tips
Edit

Built in Libraries

Microsoft Small Basic comes with a default library that allows users to build really simple and fun programs and games. The default library contains the following objects, that are useful in creating these fun programs and games.

  1. GraphicsWindow
  2. TextWindow
  3. Turtle
  4. Flickr
download movies However, if the users want to do something other than what's offered by the default library, they can use Small Basic extensions.

Edit

Where to find extensions

Extensions are available here :http://smallbasic.com/smallbasic.com/wiki/Downloads.ashx

Edit

How to write Small Basic Extensions

The Small Basic compiler is designed to allow external libraries to be plugged in that enable it to be extended in interesting ways. These libraries can be built using any .Net based language and compiled to a .Net assembly. There are a few rules that the Small Basic compiler expects for a type to be identified as a Small Basic “object.” movie 2010 online

  1. The Type should be declared static
  2. The Type should be adorned with SmallBasicTypeAttribute
  3. Properties should be of type Microsoft.SmallBasic.Library.Primitive
  4. All the input and output parameters for Methods should be of type Microsoft.SmallBasic.Library.Primitive
  5. All events should be of type Microsoft.SmallBasic.Library.SmallBasicCallback

Once these conditions are met, you can compile your assembly and put it in a folder named “lib” in the Small Basic’s install location. For example, if Small Basic was installed on your “c:” drive and your library was called “myextensions”, you’d have to put myextensions.dll inside “c:\program files\microsoft\small basic\lib” folder.

Optionally, you can enable XML documentation in your build and copy over the Doc Xml file along with the library. This will automatically enable the help text inside Intellisense and the context help pane.

Check out Small Basic Blog for a sample.

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