How to Create a Small Basic Extension Using C#
Today's featured article comes from Liam McSherry:
Here is a sample of the article...
Microsoft Small Basic, while a good language for a beginner, is rather limited once you really get into programming. If you feel you're rather advanced with Small Basic, but you also feel that you're being limited by it, you may want to write an extension. You may also wish to write an extension simply to help the Small Basic community by expanding what they have available to them.
To write an extension for Small Basic, you'll have to select a CLR-compatible language to write in. This tutorial will be using Microsoft C#, but there is a large selection of languages compatible with the CLR which can be used to write a Small Basic extension (and we have a tutorial for writing an extension in Visual Basic.NET here). This tutorial will assume that you have a grasp of using Visual Studio, which is the preferred environment for developing for the CLR. Microsoft Visual Studio 2012 Professional will be used in this tutorial.
Setting up your Visual Studio Project
Small Basic is built for version 3.5 SP1 of the .NET Framework, and won't be compatible with extensions in any other versions of it. You will want to create a class library (as outside of Small Basic "extensions" are generally referred to as libraries, or libs for short). You'll have to select ".NET Framework 3.5" from a dropdown at the top of the "New Project" window, and you'll have to select "Class Library", as shown below.
You will also need to add a reference to SmallBasicLibrary.dll, which can be found inside the directory you installed Small Basic to. We need this library because it allows us to flag classes with an attribute that makes the Small Basic IDE show them. Once you have added the reference. you'll also want to include the namespace in your code file.
To read the rest, including instructions about how to program your extension, check out Liam's article on TechNet Wiki:
Thanks to Liam and everyone who has made Small Basic articles on TechNet Wiki!
Go to http://blogs.msdn.com/SmallBasic to download Small Basic for free and learn all about it!
Small and Basically yours,
- User Ed