Microsoft Developer Network > Forums Home > Learning Forums > Small Basic > Extension with Exponent function and GetCurrentDirectory function

Discussion Extension with Exponent function and GetCurrentDirectory function

  • Wednesday, November 26, 2008 7:31 PM
     
     
    A quick extender for some of the common needs I've seen lately

    You will need WinRAR (http://www.rarlabs.com/) to extract either of these files.

    This one contains a dll that you can use to extend smallbasic.  There is a bit of duplication with the built-in small basic Math object.  I took all of the math functions from Extended Color Basic and stuck them into a PDGMath class.  Of particular note is the Exp function, which is the inverse of the Log function.
    I also created another class called PDGFile which has a GetCurrentDirectory function.
    This needs to be placed into a lib subfolder of the small basic installed directory (C:\Program Files\Microsoft\Small Basic\lib). You will likely need to create the lib directory.
    None of the functions is error checking, so buyer beware.

    http://www.playdeez.com/smallbasic/pdgsbutilities.rar

    This one is the C# source code for the extension:

    http://www.playdeez.com/smallbasic/pdgsbutilities_src.rar

    Enjoy!

All Replies

  • Wednesday, November 26, 2008 8:30 PM
    Answerer
     
      Has Code
     PlayDeez,

        How about adding a desktop extension to get the width and height of the desktop

    public static class Desktop2  
            {  
                public static Primitive GetWidth()  
                {  
                    return System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;  
                }  
                  
                public static Primitive GetHeight()  
                {  
                    return System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;  
                }  
                  
            } 
  • Thursday, November 27, 2008 12:11 AM
     
     
    Great work with the addition of an exponent function, I'll have to try this out later. 
  • Thursday, November 27, 2008 3:06 PM
     
     
    Are we going to end up with different versions of Small Basic running around?