Cannot Graduate a simple program from Small Basic to Visual Basic, missing Microsoft.SmallBasic.Library, help please? RRS feed

  • Question

  • Well its 35 years since I last wrote any code, at that time it was assembler and C for Intel 8085 and Zilog Z80, and reading Dr Dobbs journal.  As I approach retirement I thought I'd start again with Microsoft Basic and then see how I progress.  I know I have a lot of catching up to do.  Anyway, I tried to "Graduate" the following Small Basic code segment into Visual Basic 2008 Express:

    GraphicsWindow.BackgroundColor = "Black"
    i = 1
    While i < 1000
      x = Math.GetRandomNumber(640)
      y = Math.GetRandomNumber(480)
      For z = 200 To 10 Step -10
        GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()
        GraphicsWindow.FillEllipse(x-z/2, y-z/2, z, z)

    Within Visual Basic 2008 Express the following code was generated:

    Module Rob_Circles_18th_Nov_09Module
        Dim i, x, y, z As Primitive
        Sub Main()
            GraphicsWindow.BackgroundColor = "Black"
            i = 1
            While i < 1000
                x = Microsoft.SmallBasic.Library.Math.GetRandomNumber(640)
                y = Microsoft.SmallBasic.Library.Math.GetRandomNumber(480)
                For z = 200 To 10 Step -10
                    GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()
                    GraphicsWindow.FillEllipse(x - (z / 2), y - (z / 2), z, z)
            End While

        End Sub
    End Module

    I then tried to build the application and run it from the Visual Basic 2008 environment, and the basic problem is this:

    Warning    1    Namespace or type specified in the project-level Imports 'Microsoft.SmallBasic.Library' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.    Rob_Circles_18th_Nov_09

    I'm stuck at this point because I can't find any Microsoft.Smallbasic.Library extension for the Visual Basic 2008 environment.   Please can anyone help me?


    Wednesday, November 18, 2009 12:49 AM


  • This is interesting.  For some reason, the library reference is broken. 

    1. In VB IDE, right click your project and choose Properties
    2. In the references tab, add reference.
    3. Select SmallBasicLibrary.dll from Small Basic's install location
    4. Try building again.
    Wednesday, November 18, 2009 1:33 AM