none
Features & Bug Fixes for v0.5 RRS feed

  • General discussion

  • I'm starting work on v0.5 and would like to gather ideas from you all.  So, please post your favorite feature request here and if it gets a lot of votes and doable in the time I have (1 month), I'll do it!

    Tuesday, April 28, 2009 8:36 PM
    Moderator

All replies

    1. A "Save As" button.
    2. Two dimensional arrays.
    3. A collision detection method.
    4. The ability to import shapes to use in #3.
    5. A better debugger with a step through feature.
    6. A version of old Logo had a window that would show the value of the variables as the program was being stepped through.  This was great for finding run-time and logical errors.

    I count #1 as a must.  The others would be cool and really useful for teaching but I can live without them.

    Tuesday, April 28, 2009 9:23 PM
  • I agree with Loyola IT about "Save As", but 2D arrays could make things more complicated - 1D arrays (or collections) are difficult enough in the context of SB.  You could keep the Array object as it is and add a new 2DArray object that takes 2 index parameters, but I would worry about feature creep.

    Collision detection is tricky.  You can already detect collisions by checking the distance between shape centres, but how they interact requires a bit of physics that a user really needs set up to use effectively, since parameters such as gravity, mass, time-step size, initial velocity vectors, elasticity, boundaries and shape dependent interactions need to be defined first.  This would be nice if it was intuitive (and fast) enough.

    More math functions:

    ArcSin
    ArcCos
    ArcTan
    Exp
    Possibly Mod

    For the interface:

    Find/Replace (<controlF>/<control>H)
    Allow the mouse to scroll and select the intellisense options

    For the future:

    Allow debugging - I imagine a bit of work to get the interface for this right.

    And Great Work - me and my kids love it - I enjoy trying to write efficient code in a small environment, it brings back the Sincalir Spectrum days - and I like working with my children to encourage their interest in how it all works.
    Tuesday, April 28, 2009 11:06 PM
    Moderator
  • Well, since we're dreaming it would be nice if we had a line continuation character _ just like Visual Basic.  Some of the lines of code can get awfully long and we can't split them.  Also, it would be great if we could comment out multiple lines of code rather than goto each line and insert an apostrophe.  It would make debugging a lot easier.  Other languages sometimes use character sequences to accomplish this, like:
    /*  Then a bunch of lines */ That ends the commenting.  Or, it could be implemented like it was done in Visual Basic.

    Also, I was wondering why Small Basic doesn't use the right mouse key for things like copy and paste?  Just seems like it would be more natural if it did because most of Microsoft's other programs do.

    JR 
    Tuesday, April 28, 2009 11:43 PM
    Answerer
  • Hello All,

    Adding a HELP button which includes:

    1- Explain the meaning of Class, Object, Property, Method, keyword.......and how to use them with examples.
    2- list of all objects, methods and keywords used in Small Basic......with exambles.
     
    I think this will help people who wants to learn programing.

    All i want to say is making somthing like MSDN library ( but this time is small library...just for Small Basic ) and attach it with Small Basic.

    I am sure that a lot of people will be happy.....



    Yasser Jamil
    Wednesday, April 29, 2009 2:44 AM
  • Yes to "Save As", continuation character and context (right button) menu for cut, copy, paste and delete.

    Also,
    Auto adjustment to screen resolution on SB startup.
    Normal Minimise, Maximise buttons on source code windows.
    Debugger features. Breakpoints, run to cursor, single step, Watch Window for variable values.
    Wednesday, April 29, 2009 7:24 PM
  • Il agree with most of already given ideas (even if 1D arrays would be better than 2D arrays), but here's my two cent :

    * Context menu on the text editor 
    This is my most important request for the UI, because I always try to get a context menu and wonder why I don't get them.

    * Local variables (two possibles implementations)

     a) Using 

       Local X
          ' ...
       EndLocal

     b) Automatic scopes

       Sub X
         X.Var1 = ...
       EndSub


    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Wednesday, April 29, 2009 8:05 PM
  • Small Basic is pure fun - and a fine piece of software! Just keep it simple, then it will always be a winner.


    I have the following proposals:

    1.
    Show the current line number and column somewhere on the screen.
    With current I mean the line where the cursor is.

    2.
    I would be happy if the errors in the error window looked like links (just like Close).
    Then there would no doubt whether you can click on them or not.

    3.
    A new button in the menu that can structure the program.
    For example

    sub test
    for n=1 to 100
    total = total + n
    endfor
    endsub

    will be structured something like this

    sub test
        for n=1 to 100
            total = total + n
        endfor
    endsub

    4.
    Show a few examples of a statement in the right side of the screen together with the other help about the statement.
    Maybe you should be able to drag the example into the program, so that you don't have to type it.

    5.
    TextWindows.Read() reads a line of text.
    I wish GraphicsWindow could have something like it - for example GraphicsWindow.ReadMessage(text, title, message) - so that you can enter some information.

    6.
    Some sort of a debugger.

    7.
    A new button in the menu so that we can search the program for a string. A search and replace would be even nicer.

    8.
    A Save As button.
    Wednesday, April 29, 2009 8:29 PM
  • I disagree with scoping for this level - it could confuse complete beginners - keep it simple, though I can see the advantages.
     
    And I don't understand the comment about arrays - if you have 2D arrays you must have 1D arrays and using 2D arrays does not have to be compulsory.

    Signatoriomalcolmfw
    Thursday, April 30, 2009 11:40 AM
  • I agree with all of these points, and would like to add 1 more:

    A File Rename facility would be useful.


    Signatoriomalcolmfw
    Thursday, April 30, 2009 11:59 AM
  • I disagree with scoping for this level - it could confuse complete beginners - keep it simple, though I can see the advantages.
    As any feature : you're not forced to use it :-)
    The main arguments to say array are not good for Small Basic is "it could confute complete beginners - keep it simpe, though I can see the advantages".

    By thinking this way you'll not add anyting to Small Basic. And having local variables (and a good syntax) would be better, I think, than end up by mixing things.
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Thursday, April 30, 2009 2:39 PM
  • Another thing that would be great :

    Create a Snippet WebSite that allow users to put a code between 5 an 25 lines that do a specific stub.
    This is a good way to propagate short samples that can respond to technical problems that beginners have difficulties to solve.

    Such sites exists in French for VB/C#/... languages :
    http://www.codyx.org/
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Thursday, April 30, 2009 6:41 PM
  • I strongly agree with Loyola IT's points, and am strongly in favor of multi-dimensional arrays.  I see no reason why this is thought to be confusing to beginners - it certainly never has seemed confusing to me.  And as Fremy so aptly states, if you don't like it, you don't have to use it, or teach it.
    Thursday, April 30, 2009 7:39 PM
  • 1.
    When I'm using a computer, I prefer to keep my hands on the keyboard and use keyboard shortcuts whenever I can.
    So I have this big wish: as many keyboard shortcuts as possible. There are some already (Run, Save), but more, please!
    One that come to my mind is being able to switch between the open programs by using Ctrl+Tab.

    It would also be nice, for me at least, to be able to easily access a list with all the available shortcuts.

    2.
    Vijaye Raji, you started a thread somewhere with tips about using Small Basic, for example being able to see through the object carrousel when holding down CTRL. They enhance the positive experience with Small Basic, so maybe the list should be easily available.

    3.
    Pacolaco came up with the suggestion of using some sort of Include, so that you can include external subroutines and variables into a program.
    My yes to that idea.
    It makes it possible for groups to cooperate on a common project. I imagine that a teacher could split a project into small parts and then let the pupils contribute by being responsible - either alone or in groups - of writing their part. When the pupils has finished, the main program can be run and the teacher and the pupils can see the result of their cooperation.

    4.
    I also say yes to 2-dimensional arrays.
     
     
     
    There is a problem, though, with adding more advanced features to SB. There is a risk that the people that SB are intended for - young people and beginners - will be split into two groups; one group understand and use the advanced features and another group find the advanced features (like 2D-arrays) difficult and therefore discard them. A third group using the advanced features is the pros.

    Now, suddenly the second group that find the advanced features difficult is left behind. Suddenly they will see code on the net or written by their class mates that they find difficult and off putting, they might even feel intimidated. So by keeping SB simple there is a bigger chance that more people will enjoy SB. I certainly enjoy SB as it is, the simplicity simply fuels my imagination.

    Well, all this is of course speculations, I do not know what goes on in a beginners head. Maybe it is best to keep SB simple in the beginning and then see how it works for those the language is intended for.
    Friday, May 1, 2009 8:36 AM
  • Bug:

    a =

    This will throw "Object reference not set to an instance of an object." error, but when you double-click error message, the cursor does not jump to the error.

    ----------

    How about a method to draw polygons
    Saturday, May 2, 2009 3:35 AM
  • How about parameters for subroutines. This would be consistent with  the built-in operations which do take parameters.
    Saturday, May 2, 2009 10:33 AM
  • Bug in v0.4 :

    GraphicsWindow.Hide()
    GraphicsWindow.Width = 300
    GraphicsWindow.Height = 500
    
    ' GraphicsWindow.Width/Height will return 0, until we show the window
    
    ' Demonstration using a button that will not be visible because its position will be (-165, -39)
    Btt = Controls.AddButton(150, 24, "Close")
    Controls.Move(Btt, GraphicsWindow.Width-150-15, GraphicsWindow.Height-24-15)

    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Saturday, May 2, 2009 3:01 PM
  • Another problem, with GraphicsWindow.CanResize

    You never say that we need to use "True" / "False", so an user may try to use "Yes", "No" (or "Oui", "Non" in French). The problem is that "Yes" is computed as "False"...  You should specify in the description that the property needs "True" or "False" as value.
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Saturday, May 2, 2009 3:04 PM
  • Some methods that would be great too :
    - Text.SplitAsArray(Text, SplitChar, ResultArrayName)
    - Text.GetTextBefore(Text, TextToFind)
    - Text.GetTextAfter(Text, TextToFind)
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Saturday, May 2, 2009 3:29 PM
  • Would it be possible for an extension to have something like that ?

    <SmallBasicType><SBObsoleteFunctionAttribute("SetText", "Use SetContent instead")> _
    Public Module ....
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Saturday, May 2, 2009 7:00 PM
  • I would love to see some implementations with the webcam.

    Such as WebCam.Snap() and maybe some fun image functions like Inverse and other color tweaks. 
    Saturday, May 2, 2009 10:56 PM
  • There is a bug in the editor. It is possible to pull the borders of a source code window below the Task Bar and underneath the toolbar. This makes it impossible to reduce the size again and the close button cannot be pressed.
    Sunday, May 3, 2009 9:05 AM
  • Small Basic Suggestions (in no particular order)

    • In keeping with the single scope environment (a plus in my opinion), Methods/Operations that have parameters lists should compile without the parameters (passing null/zero values to the routines).
      Example: TextWindow.WriteLine() 'should compile and only print a line feed.
    • The terminology should better reflect that of object oriented standards. Method/Field should be used in place of Operation/Property.
    • Auto fill for the intelli-type system should automatically add the () to operations and subroutines.
    • The zoom for the intelli-type help system should work independently of the zoom for the editor. When I have the editor zoomed to allow students in the back of the class to see the text, the help system takes up half of the screen, making typing difficult.
    • The additional of the arc trig functions to the Math object: ArcSin, ArcCos, ArcTan
    • Discarding the current DOSesk textwindow in favor of a non-scrolling graphics based textwindow. Some that would allow the user to develop decent looking text based applications.
    • Errors displayed as links (in the same way close is). When the link is clicked, highlight the line in addition to placing the cursor on that line.
    • Stronger intelligence to the Auto-Indent feature. The current implementation is a little flaky. In addition a "Format/Indent" button to do the formal indenting would also go a long way to encouraging good coding standards (as described by Smolna above).
    • Add the ability to change the standard text-window application icon for the exe file.
    • Allow for dragging and dropping of source files into IDE to open them.
    • When opening new windows, the cascade needs to reset at the edge of the application window as it is currently sized. As it is, after grading about 25 files, I am no longer able to grab the window to move it and have to restart SB.
    The last two are the important suggestions:

    • Sub Program Parameter Lists:
      Without violating the single scope environment (again, great idea), Sub-programs should still have parameters lists. Variables passed to the Sub-program would simply have their values copied to the "local" variable name.

      Example: a, b, x, and y would all be in the same single scope.
          definition --  Sub mysub(x, y) 'the values of a and b would be copied to x and y
          usage -- mysub(a,b) 'without changing the single scope nature of SB
    • And most importantly: Arrays

      I don't agree that Small Basic needs the classic bracketed [ ] style arrays. But, the more I work with arrays in SmallBasic and the more experience I get teaching my Introduction to Programming class, the more I'm convinced that the current array structure is too confusing to beginners.

      Here is my big suggestion for the next release of Small Basic: Rename the current array structure to something like Map (it is very useful in its current form). Then develop a wrapper for Map with a little "Syntactical Sugar" to make it function more like a standard array. Examples: myArray = Array.new(), myArray.set(index,value), value = myArray.get(index).

      That may be a little too Object Oriented for SmallBasic, but the current structure is too far from what arrays are thought of in other languages to be a good teaching tool. I am of the opinion that a wrapper is needed that makes the grid/index structure of an array more obvious.
    Tuesday, May 5, 2009 6:05 PM
    Answerer
  • @CodingCat :

    Hum... myArray.get/set seems odd since Small Basic is defined as a non-POO language...
    The problem is solved by using [x]. And it gives the possibility to extend to 1+ indexes if the people want, what a get/set would not permise.

    Anyway, I agree with you about parameters and arrays.

    At implementation level, I propose to modify SmallBasicCallback() to SmallBasicCallback(ParamArray args) and then having local variables that reprensent the indexes of the args object (thout the args object is hidden to the user, it's implementation only).
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Tuesday, May 5, 2009 7:09 PM
  • [litle request] When importing a program, any leading space should be trimmed so that pasting "WMX007 " would work as pasting "WMX007".
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Tuesday, May 5, 2009 7:11 PM
  • Fremy, I know you are very hot for standard Array syntax. My understanding of the discussions on this forum suggests that the standard bracket [ ] syntax is not an option. What my proposal does is provide the idea of a grid/matrix style structure without all of the work of having to adjust the syntax of the language.

    And, while Small Basic may not be truly Object Oriented itself, it does make use of Object Oriented ideas, and I see no harm in making use of one to implement the class idea of an array without bothering with the hassle of the classic array syntax.

    myAry = Array.New()
    myAry.add(value) 'Add to the end of the array (next available index)
    myAry.set(index,value) 'change the value at the specified index
    value = myAry.Get(index) 'return the value at the specified index.
    size = myAry.length

    The following suggests a syntax closer to that of the current array:

    Array.New(myAry)
    Array.Add(myAry,value)
    Array.Set(myAry,index,value)
    value = Array.Get(myAry,indx)
    size = Array.length(myAry)

    Because of the complexity of the the Set method, I'm not as big a fan of this version


    In the end, what breaks the current version of array in my mind, is the free form nature of its Map structure. I would like to see numbers only accepted as indexes, and be able to get a meaningful length or size value.

    Tuesday, May 5, 2009 7:40 PM
    Answerer
  • Bug:

    Program.Delay in the following standalone code fragment does not generate sequential delay between the display of the graphics elements.

    KZH765
    Tuesday, May 5, 2009 10:07 PM
  • Fremy, I know you are very hot for standard Array syntax. My understanding of the discussions on this forum suggests that the standard bracket [ ] syntax is not an option. What my proposal does is provide the idea of a grid/matrix style structure without all of the work of having to adjust the syntax of the language.

    You're not right here. What you ask to the Small Basic compiler is to make the diference between an Class (called object in Small Basic), a Primitive variable (a string, a number, ...) and an Array instance...

    It's cleary more difficult than simply adding [] as an alias for Array.Get/Set. I already have modified the code of the Small Basic compiler to show how it could work, and it's quite easy.

    Now consider that the compiler works as the following :

    [abc] ==> [abc] is a variable
    [abc]( ==>[abc] is a (subroutine) method
    [abc].[cde] ==>[abc] is a static class (object), and [cde] is a (static) property
    [abc].[cde]( ==> [abc] is a static class (object), and [cde] is a (static) method

    How can you do, based on the text, know if "myArray.Set" is valid (myArray is an array) or not (myArray is a primitve of nothing of that) ?

    And you can have something like :

    If (...) Then
    
       MyArray = Array.Create()
    
    Else
    
       MyArray = "I'm not an array"
    
    EndIf
    
    
    
    MyArray.Get ????????

    If you have something like [], it's simple. You call Array.InternalGet/InternalSet with the content of the variable "MyArray", and you've it.
    InternalGet would work as the following :
    ==> If MyArray contains a valid name for an array, return the Array.Get(...), otherwhise, return ""

    To obtain a valid name for an array, I propose Array.Create (or Array.New, it's not a bad idea as it's more conventional)

    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Wednesday, May 6, 2009 3:15 PM
  • I understand an Array syntax sugar is pretty hot on the most wanted list.  Here are just a few thoughts that have been brewing in my mind based on the conversations in this forum:

    I'd separate the implementation concern from the actual usability.  It's important to land on a good intuitive and usable syntax for arrays.  I strongly believe technical issues can be solved - but an unintuitive or an unusable array syntax might break or kill this feature completely (so much so that people actively discourage the use of the feature).

    Also, being part of the "BASIC" family of languages, I'd prefer to stick to similar syntax - as long as it makes sense.  We do have some pretty sharp departures from the original BASIC, but those were very intentional and done after plenty of deliberation.

    Wednesday, May 6, 2009 5:52 PM
    Moderator
  • There is no formatting available for text output. To get monetry values for example to display to two decimal places, you have to mess around with Math.Floor() and multiplying and dividing. Perhaps formatting could be added to TextWindow.Write() in the form of optional parameters. e.g.

    TextWindow.Write(x, fieldwidth, decimalplaces)

    This would not complicate the language as the extra parameters need not be used and is compatible with existing programs.
    Friday, May 8, 2009 5:19 PM
  • For what it's worth my opinion is that the commands and syntax should not really be extended too much for these reasons.

    1] Looking at the questions from the target users (first time programmers) of SmallBasic:

    some are struggling trying to remember the current commands or
    asking for detailed documentation on what there already is, or
    grappling with the logic of stucture. 

    Limiting the commands and their syntax is important to keep these people.

    2] Since SB is a learning language - writing subroutines that perform some of the functions described - multi-dimensional arrays, text formatting etc is part of the leaning process and can be achieved using the small set of commands available.  If we want a language with all of these already existing in extensive libraries that totally confuse a new programmer, there are plenty of options.

    3] We can all think of lots of things we cannot do with SB, but rather we should think what we can do with it - a lot.  The scope is sufficient to achieve plenty, in particular learning the important basics of programming.

    I would prefer more extensive documentation and other structured example driven material showing how to program effectively and with fun using the small command set in an intuative environment.
    Friday, May 8, 2009 6:34 PM
    Moderator
  • Is there anyway to change the tab spacing for the textwindow.  It is currently set at 8. Meaning if I am at position 1 and if I issue a tab it will move over to position 9.  Then 8 more would be position 17.  Here's a snippet that will show what it tabs to:

    TextWindow.WriteLine("Ja"+Text.GetCharacter(9)+"me" +Text.GetCharacter(9)+"s")
    TextWindow.WriteLine("12345678901234567890")
    TextWindow.CursorLeft=8
    TextWindow.Read()

    I would like to be able to change the tab spacing to whatever I need, but I don't see a way to do that.  Maybe it could be an added feature in V 0.5. 

    JR
    Friday, May 8, 2009 6:57 PM
    Answerer
  • It would be great if there were methods to set the physical size (width and height) of the textwindow.  Current methods allow you to move the textwindow to any position on the display and change the cursor position to anywhere in the buffer.  The only way to change the textwindow size is to manually pull it or use the maximize button after the window is displayed.

    JR

    Saturday, May 9, 2009 2:25 AM
    Answerer
  • 1) I agree with a Save As feature in the Small Basic editor.

    2) Sounds like a multi array is too difficult to do?  Well, i have been getting around it (as suggested in some of the other posts) creating an array name that includes the numbers, like this:
    For a, let's say, Map location 1,2
    Array.SetValue("maplocation1,2",1,"Gold Coin"

    You could perform a for-next loop like this:
     For X = 1 to 10
       For Y = 1 to 10
         Array.SetValue("maplocation"+X+","+Y,1,"Gold Coin"
       EndFor
     EndFor

    Having said all of that, though, I think a minimum of a 2 dimension array would be good to have - to allow at least a X and Y axis for doing graph plotting and the like, without beginners having to figure out how and why my example above works.

    3) I have problems with the automatic indentions.
    I almost always have to go back and ethier delete the preceeding spaces or add the preceeding spaces.
    I have even come to the end of the program where the last line was a EndWhile, all the way against the left side.
    I press Enter key and the next line's cursor is against the left, like you would expect.
    Press the Enter key to leave a bank line and the new line seems to be correct too - until I try entering a command.
    Once I enter a command, the line indents 2 spaces.

    4) syntax examples in the context help, like in the Array commands, it doesn't show that you need to have quotes around the "arrayName".
    For the properties - like GraphicsWindow.BackgroundColor, the syntax for "gets" and for "sets" the background color would be nice for beginers.

    5) a step-through debuggger would be nice, instead of either commenting out code to debug and/or inserting code to print variables at certain lines.
    ...but i wonder if, for a begining coder, that isn't a good thing.  I mean I didn't have anything like that in Applesoft BASIC but I did just fine and maybe manually debugging your code helps you with understanding your code more by 'getting your hands dirty'.

    6) this doesn't have anything to do directly with upgrading Small Basic itself, but with the support - more and detailed instructions on Small Basic's commands.
    That is how I learned Applesoft BASIC.  A book with all the commands, syntax, description, and Examples.
    Saturday, May 9, 2009 7:48 PM
  • The "Text" object should contains properties like "TabCharacther", "NewLineCharacther", ...
    Newbies don't care about Text.GetCharacther(13) + Text.GetCharacther(10)

    Also, here's a little code that can be used to implements arrays :

     
    Imports Microsoft.SmallBasic.Library
    
    Public Structure Primitive
        Public Type As PrimitiveType
        Public Value As String
        ' Constructors
        ' Conversions
        ' Operations
        ' ...
    End Structure
    
    Public Enum PrimitiveType
        TString = 0 : TNumber : TBoolean : TDate : TArray : THandle
    End Enum
    
    ''' <summary>
    ''' The Array object provides support for ...
    ''' </summary>
    <SmallBasicType()> _
    Public Module Array
    
        Private _Arrays As New Dictionary(Of String, Dictionary(Of String, Primitive))
    
        Public Function CreateNew() As Primitive
            ' Number of existing ArrayNames
            Static ArrayNameCount As Integer = 0
            ArrayNameCount += 1
    
            ' Create the new ArrayName
            Dim ArrayName As String = "ArrayName" & ArrayNameCount
            _Arrays.Add(ArrayName, New Dictionary(Of String, Primitive))
    
            ' Return the new generated ArrayName
            Return New Primitive(ArrayName, PrimitiveType.TArray)
        End Function
    
        Public Function Exists(ByVal ArrayName As Primitive) As Primitive
            Return _Arrays.ContainsKey(ArrayName)
        End Function
    
        Public Function Clear(ByVal ArrayName As Primitive) As Primitive
            Try
                _Arrays(ArrayName).Clear()
            Catch : End Try
        End Function
    
        Public Function DeleteArrayName(ByVal ArrayName As Primitive) As Primitive
            Try
                _Arrays.Remove(ArrayName)
            Catch : End Try
        End Function
    
        Public Function [Get](ByRef ArrayName As Primitive, ByVal Key As Primitive) As Primitive
            Dim Arr As Dictionary(Of String, Primitive)
            If Exists(ArrayName) Then
                Arr = _Arrays(ArrayName)
            Else
                ' Create the new ArrayName
                Arr = New Dictionary(Of String, Primitive)
                _Arrays.Add(ArrayName, Arr)
    
                ' Modify the type of ArrayName
                ArrayName = New Primitive(ArrayName.Value, PrimitiveType.TArrayName)
            End If
    
            If Arr.ContainsKey(Key) Then
                Return Arr(Key)
            Else
                ' Perform the Set operation
                Dim Value As Primitive = ""
                [Set](ArrayName, Key, Value)
    
                Return Value
            End If
        End Function
    
        Public Sub [Set](ByRef ArrayName As Primitive, ByVal Key As Primitive, ByVal Value As Primitive)
            If Exists(ArrayName) Then
                Dim Arr = _Arrays(ArrayName)
                If Arr.ContainsKey(Key) Then
                    Arr(Key) = Value
                Else
                    Arr.Add(Key, Value)
                End If
            Else
                ' Create the new ArrayName
                Dim Arr As New Dictionary(Of String, Primitive)
                _Arrays.Add(ArrayName, Arr)
    
                ' Modify the type of ArrayName
                ArrayName = New Primitive(ArrayName.Value, PrimitiveType.TArrayName)
    
                ' Perform the Set operation
                [Set](ArrayName, Key, Value)
            End If
        End Sub
    
        Public Function Push(ByVal ArrayName As Primitive, ByVal Value As Primitive) As Primitive
            If Exists(ArrayName) Then
                Dim X As Integer = 0
                Do While _Arrays(ArrayName).ContainsKey(X) : X += 1 : Loop
                [Set](ArrayName, X, Value)
            End If
        End Function
    
        ' Used in << Value = ArrayName[Key] >>
        Public Function _InternalGet(ByVal ArrayName As Primitive, ByVal Key As Primitive) As Primitive
            Return [Get](ArrayName, Key)
        End Function
    
        ' Used in << ArrayName[Key] = Value >>
        Public Sub _InternalSet(ByRef ArrayName As Primitive, ByVal Key As Primitive, ByVal Value As Primitive)
            If ArrayName.Type = PrimitiveType.TArray
                [Set](ArrayName, Key, Value)
            End If
        End Sub
    
    End Module

    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Sunday, May 10, 2009 12:35 PM
  • This is clarifying one of the suggestions from my previous suggestion list:

    A fix to the intelli-type help system is needed to keep the spinner box out of the way off text being typed. As it is now, when you get to the bottom of the application window, the system pops up and blocks what you are typing. A small fix is all that is needed to place the help window above the text being typed when the active line is near the bottom of the application window.
    Monday, May 11, 2009 1:16 PM
    Answerer
  • Utilize the <example> tag in xml documentation for an extension. Nothing better than giving the user a real example of how to use it.

    Here's an example of the comment in my extension (using for my talk tomorrow)
            /// <summary>
            /// Loads shapes from specified xml file and randomly places them on the screen
            /// </summary>
            /// <param name="file">Path to xml file containing the shape definitions</param>
            /// <returns>On success returns ShapeLoader.Success. On Failure ShapeLoader.Failure</returns>
            /// <example>If (ShapeLoader.Success = ShapeLoader.LoadShapesFromFile("shapes.xml") Then
            ///     'Do Something
            /// EndIf
            /// </example>

    from the generated xml file
     <member name="M:SmallBasicShapeLoader.ShapeLoader.LoadShapesFromFile(Microsoft.SmallBasic.Library.Primitive)">
                <summary>
                Loads shapes from specified xml file and randomly places them on the screen
                </summary>
                <param name="file">Path to xml file containing the shape definitions</param>
                <returns>On success returns ShapeLoader.Success. On Failure ShapeLoader.Failure</returns>
                <example>If (ShapeLoader.Success = ShapeLoader.LoadShapesFromFile("shapes.xml") Then
                    'Do Something
                EndIf
                </example>
            </member>

    I'm not sure on where it should be placed, probably above or below the Returns in the small basic ide.

    Even better a button to insert the example code into the program

    Fix the Ctrl+s never seems to work for me to save the program
    Wednesday, May 13, 2009 10:16 PM
  • How about a two button option for the graphicwindow message box! currently there is just "OK" button, it would be nice if there was another programable button option like "cancel" or have two buttons that can trigger variable events.
    Thursday, May 14, 2009 6:04 PM
  • Would be nice to have a "Shell" class with static methods to start other applications.
    Friday, May 15, 2009 2:03 PM
  • I would like to add another million votes to one of the minor suggestions. A button that will do the indenting for the code.

    I am in the middle a grading a batch of projects, and the code is nearly indecipherable because of all the random indenting.

    Having a button to do the indenting would get at least two things. 1) It would encourage following a coding standard by showing newbies what properly formatted code should look like. 2) it would allow someone; a teach say, like myself; to format code from another source, cutting down on the insanity the comes from reading spaghetti code.

    Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please Please

    It should be an easy additon, and I would rate its importance right up there with "Save as" and "Search and Replace".

    Please.
    Saturday, May 16, 2009 5:10 PM
    Answerer
  • Overall Small Basic is a wonderful teach language for children, and the introduction to Small Basic is very well written. Congratulations. Just a few suggestions for further improvement. Add a remove or delete line command to "File." Currently, we can insert line, overright line, and append. It woudlbe nice to have a "File.RevoveLine(n)" command. Also a simple 'find' command in the editor would make it a lot fast to get to code which needs to be edited.
    Monday, May 18, 2009 7:09 PM
  • What about adding an simple 'export' button that exports into a *.exe or *.msi? Another idea is to add a new namespace for Twitter? You could write an app to update your status, or get updates.
    Monday, May 18, 2009 10:17 PM
  • How about a way to bookmark code lines so if a programmer has the need to go to a code line for reference, you just click on the bookmark. code can get quite long so if there was a mechanism for bookmarking a line so a programmer can look at it for reference then return and continue writing code.
    Wednesday, May 20, 2009 10:45 PM
  • I hesitate to ask for another keyword and I do appreciate the need to keep the language small, but would it be possible to include a logical "Not" to complement the "And" and "Or"? Negation is a vital part of logic and the alternative (using the Else part of If Then Else with an empty true part before the Else) just seems contrived.
    Sunday, June 7, 2009 7:25 AM
  • I had put the Not keywoard in initial builds.  I later decided to take it out because I realized that anywhere you use a Not, you could actually make the code more readable by comparing the result with something concrete.

    For example:

    If a <> b + 3 Then
    ...
    EndIf

    and

    If result <> "True" Then
    ...
    EndIf

    Thoughts?
    Sunday, June 7, 2009 6:11 PM
    Moderator
  • I mostly use the logical operator NOT to reverse a line of logic. Quite often it is easier to state a decision positively and then negate it, rather then trying to decide how to write the logic in a negative fashion. Example:

    If ( ((a = 5) And (b = 4 Or c = d) ) or ((b = 5) and (c = 6)) ) Then

    Now reversing that logic with a NOT is a lot easier to code then swapping out Ands for Ors and Ors for Ands; especially since this doesn't always result in reversed logic. Plus, in this case Not would be easier to follow then comparing to <> "True".

    If Not ( ((a = 5) And (b = 4 Or c = d) ) or ((b = 5) and (c = 6)) ) Then

    Is a little easier to follow then:

    If ( ((a = 5) And (b = 4 Or c = d) ) or ((b = 5) and (c = 6)) ) <> "True" Then
    Sunday, June 7, 2009 10:15 PM
    Answerer
  • +1 for Not.

    Not "True" ==> "False"
    Not "" ==> "True"
    Not null ==> "True" (please note I find it strange that null and "" are not equals each other, maybe you should fix it for v0.5)
    Not "0" ==> "True"
    Not "{str}" ==> "False"

    So, we also can transform anything into a Boolean by using XBool = Not (Not (x))
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Monday, June 8, 2009 2:57 PM
  • I'm sorry, I've been doing too much C recently and completely overlooked the "<>" comparison (I was thinking of != which of course is not available, pun intended) hence my comment about using the else part of an if test. Having said that, I still think negation is an important operation to learn (I am not a teacher and am prepared to accept that I am wrong on this, but I would take some convincing).
    Monday, June 8, 2009 7:38 PM
  • A suggestion or question about Small Basic in general: could it been made possible programming in Small Basic on a website? One could write Small Basic programs on every computer with access to the internet, on a smartphone ect.
    Tuesday, June 9, 2009 3:05 PM
  • A suggestion or question about Small Basic in general: could it been made possible programming in Small Basic on a website? One could write Small Basic programs on every computer with access to the internet, on a smartphone ect.

    That would be great ! It should be possible to be able edit the program we put on the smallbasic website either on our computer, either on the website (by using password ?)

    Naturally, the web editor could be less good than the normal editor, but it's not a great problem, as we would usually use the normal editor.

    If you want, I even can programm a JScript Compilator for console apps.
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Tuesday, June 9, 2009 4:05 PM
  • So.... When?

    I am eager to get my hands on SB0.5 for two big reasons. First is out of sense of innate curiosity on what is new and different. But mostly because it is rapidly approaching the date where we need to re-image the computers in the lab for next year and I want the latest and greatest to start things out with.
    Friday, June 12, 2009 4:40 PM
    Answerer
  • Very soon.  I'm finishing up the last of the tests and localization updates.  It'll be up on the download center sometime next week.

     

    Friday, June 12, 2009 4:45 PM
    Moderator
  • Divide by zero is unhandled and crashes your program.  Also if someone were to model things like the sun, this'll crash:

    Array.SetValue("planetMass", 1, 1989000000000000000000000000000)

    Any way to enter exponential numbers?  Maybe I'm pushing the intent of this compiler, but I think it really should handle such things, they'll be tried.

    I want a logical 'maybe' function, to increase my troubleshooting skills.  It's called fuzzy logic?!  Something like If x = true Maybe do something haha.

    Programming IS fun!
    Friday, June 12, 2009 8:52 PM
  • Something that used to be alot of fun was a hardware audio synthesizer you could program on the Atari computers.  I could make an algorithm for a simple one for you with something like ADSR (attack/decay/sustain/release) envelope, FM, & noise if you want.  It just needs to be processed periodically at maybe 10x a second so that it can periodically fill up an audio buffer for playing to the soundcard.  I know people will enjoy it, and it'll make tons of neat sounds.

    Another step that'd really spark interest is voice synthesis, but you'll have to dig around for that.
    Sunday, June 14, 2009 1:12 AM
  • in the program listing if the sub WHATEVER had a different color that would be as helpful as indenting and stuff
    Monday, June 15, 2009 9:26 AM
  • Or at least a list of function names on the sidebar, clicking which brings you to the function.  It doesnt take very long to get a file that's difficult to navigate.
    Monday, June 15, 2009 8:09 PM
  • I would love to see the inclusion of the
    CaseWhere multiway selection and
    Repeat..Until post test repetition
    to complete the control struture set that Small Basic already has. As a teacher, having a single language that can be used for beginner programing to resonably advanced makes life so much easier. Even though i expose students to many languages, some less equiped teachers need a one stop shop and Small Basic could fit this model. However, without a formal post test repetition and a miltiway selection the language falls short of our syllabus requirements.
    Monday, June 15, 2009 11:19 PM