DevLabs > DevLabs Forums > Small Basic > Create extension for Small Basic in Small Basic
Ask a questionAsk a question
 

General DiscussionCreate extension for Small Basic in Small Basic

  • Friday, August 21, 2009 4:20 PMFremyCompanyAnswererUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    It's possible to create extensions for Small Basic in any DotNet language. This includes Visual Basic .NET and C#. But this also includes Small Basic itself.

    http://cid-201f3835d49587fe.skydrive.live.com/self.aspx/Public/Small%20Basic/SmallBasicExtensionCompiler.zip

    Creating an extension in Small Basic is very simple : Just create your program and compile it with this special compiler. You'll get two new files : <File>.dll and <File>.pdg. Copy those files in C:\Microsoft\Small Basic\lib\ and launch Small Basic. It's all you need !

    To create sub/variables that are not accessible for other apps, start their name by an underscore '_'.

    Sample (Test.sb) :

    MyField = "(No value)"
    _MyPrivateField = "Value of MyField : "

    Sub TestSub
      TextWindow.Write(_MyPrivateField)
      TextWindow.WriteLine(MyField)
    EndSub


    Application using Test.sb 

     

    Test.Testsub()
    Test.Myfield = 5
    Test.Testsub()

    ' Few remarks :
    ' ===========
    ' * Test._MyPrviateField isn't accessible, because it begins by a '_'
    ' * All sub/variable names are capitalized to Mmmm... (M: MAJ, m: min)
    ' * Your program (Extension) is run just before the first time you use the extension  object

    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension

All Replies

  • Thursday, October 29, 2009 11:00 PMRobert W Jones Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    How do you include  the test,dll in your code?  I think you missed a line?  This is a great help though!
  • Thursday, October 29, 2009 11:14 PMRushworksAnswererUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    How do you include  the test,dll in your code?  I think you missed a line?  This is a great help though!

    Are you trying to use this with Small Basic v0.7?  If so, it will not work.  It will only work with v0.6.  Fremy will have to update this program, as well as his other extension before they will work with v0.7.

  • Friday, October 30, 2009 2:51 PMFremyCompanyAnswererUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I'll perform an update soon. Please keep updated...
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
  • Saturday, November 07, 2009 4:33 PMFremyCompanyAnswererUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I'll try to perform the update tomorrow. If everyting goes right, it should be done for monday morning.
    If I face problems, I'll try to fix these before Wednesday.

    Keep updated,
    Fremy


    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
  • 10 hours 56 minutes agoDaCodeDude Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Just to find out, have you made this to work for v0.7 yet?

    31337 - everything can be solved... the impossible just takes longer.