Teaching Extensions for Small Basic Recipes
This is a site to work with extensions to the SmallBasic language

This project is used along with the courseware at www.TeachingKidsProgramming.org
These are a set of small extensions to Small Basic to support the use of learning via Recipes, as shown on the Small Basic Wiki (recipes) http://j.mp/basic_recipes
An example of why this is useful is the addition of a MessageBox object.


age = MessageBox.AskForInput("How old are you?")

To see a recipe in action check out this youtube video:
http://www.youtube.com/watch?v=7ivcutYEF_I

Features - here is a list of the objects we've added
See the Documentation Tab for more detail about these objects

Colors
ColorWheel
MessageBox
ProgramWindow
ShapeMaker
Tortoise
Quiz
Font

Requirements
.NET Framework 3.5 or better http://msdn.microsoft.com/en-us/netframework/aa569263.aspx
SmallBasic http://msdn.microsoft.com/en-us/devlabs/cc950524.aspx
SmallBasic Recipes (optional, however these recipes use these extension objects http://smallbasic.com/smallbasic.com/wiki/Recipes.ashx

Instructions
Unzip SmallBasicFun.zip, two files will be created. Create a folder named 'lib' in C:\Program Files\Microsoft\SmallBasic
Copy SmallBasicFun.dll and SmallBasicFun.xml into a folder named 'lib' at C:\Program Files\Microsoft\SmallBasic\lib

Future Plans
As we write more recipes, we anticipate creating more new objects

Additional Information
How to write SmallBasic extensions (copied from the SmallBasic Wiki)

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.”

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. http://blogs.msdn.com/smallbasic/archive/2008/10/27/extending-small-basic.aspx

Here's some other information
SmallBasic Wiki - http://smallbasic.com/smallbasic.com/wiki/
SmallBasic Wiki Extensibility - http://smallbasic.com/smallbasic.com/wiki/extensibility.ashx

Last edited Jun 21, 2010 at 8:09 AM by isidore_us, version 9