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.”
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.
Here’s a sample extension (written in C#) that exposes a Settings object to Small Basic and lets you store and retrieve name value pairs specific to a program.
Share your extensions in our forum.
Hi
Thanks for this post (useful to me)
It seems that in the line 2 of SetValue method, you meant
if (System.IO.File.Exists(FilePath))
but you've written
if (System.IO.File.Exists(name))
Thanks Mehdi - good catch. I've fixed it now.
Can you provide a compiled version of the dll for those of us who do not use C#? Thank you.
This following peace of code in Introducing Small Basic:
For i = 10 To 1 Step -1
TextWindow.WriteLine(i)
EndFor
is not working!
thanks!
Thanks for reporting that Thiago. That's a bug in the compiler which we'll fix for the next release.
(1) Small Basicでもお話ししましたが、Small Basic が公開されたのは 20...
DOES SMALL BASIC SUPPORT INTERACTION WITH MS OFFICE 2003 FILES ? (EXEL, WORD, ETC ?)
NOT IN THEORY, BUT IN PRACTICE, I MEAN.
THANKS
I can't find Microsoft.SmallBasic.Library anywhere.
Search in MSDN has no result.
How an where can I get this?
Horst
Microsoft.SmallBasic.Library is the namespace and you'll find the assembly containing the namespace (SmallBasicLibrary.dll) in your computer where Small Basic is installed. Typically it's "c:\program files\microsoft\small basic\smallbasiclibrary.dll"
how do i do that in vb.net
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
1. You cannot declare types static, but declare every member "Shared" instead. This should work.
2. Use <> instead of [], and use _ at the end if you put the "Public Class Name" on a separate line. Make sure you're Importing the Microsoft.SmallBasic.Library namespace
3. If you know how to write properties this should be easy
4. Same as #3
5. Declare your events as that type, and then just raise the events as normal. You cannot pass parameters into events so make sure to have properties in your class with the information event handlers will need.
Also, a caveat:
Make sure your namespace is the same as your library filename!
This is easy... keep the "Root namespace" in the settings for your project unchanged, and don't use the "namespace" keyword. Otherwise you will be unable to use your library,
I'm having trouble linking to the xml library (dll) generated in visual studio. What to do?
Exemple XMl:
<?xml version="1.0"?>
<doc>
<assembly>
<name>PrevisaoTempo</name>
</assembly>
<members>
<member name="T:PrevisaoTempo">
<summary>
Metodo de Previsão do tempo.
</summary>
</member>
<member name="M:PrevisaoTempo.Amanha">
Amanha.
</members>
</doc>
Hi All!
I'd like to play with FC.DLL, i've made a "lib" directory under "c:\program files\microsoft\smallbasic" and put there fc.dll and and fc.xml.
after that i'd liked to run FremyCompany's example, but it didn't run.
errors were e.g.: cannot find operation 'LoadTheme' in 'Shapes'
any suggestion?
thx
hi , where can i find fremycompany extension source code? i need to compile it on my system because otherwise it does not work . thankyou