none
Bugs and Suggestions (v0.6 to v0.7) RRS feed

  • General discussion

  • First v0.6 "problems" :

    * There's no documentation for Shapes.Zoom.

    * When GraphicsWindow is hidden, Width/Height = 0 (they should return actual size if would be shown)

       à System.Windows.Rect..ctor(Double x, Double y, Double width, Double height)
       à Microsoft.SmallBasic.Library.GraphicsWindow.<>c__DisplayClass8.<FillRectangle>b__7()

    * ImageList seems to rasterize animated gifs :-(

    Few others remarks :

    * GraphicsWindows.SetCursor is very great !
    * Would it be possible to split SmallBasicLibrary in two DLL ? One would contains Primitive, SmallBasicCallBack, ... and the other the rest of the library. So it would be possible to update the library and still having extensions working whithout update (this is not possible for my extension because I rely on the library, but other extensions could not have the problem), at least if you don't need to change Primitive or other important type.
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Thursday, August 20, 2009 3:00 PM

All replies

  • * There's no documentation for Shapes.Zoom.
    The problem seems to be the French localisation of the documentation. English - in Reflector - seems to be fine.

    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Thursday, August 20, 2009 3:17 PM
  • Fremy, even if I were to split the library in two, the version would still change and that would affect your extension.  Also, every release has had changes to the Primitive type. 
    Thursday, August 20, 2009 4:06 PM
    Moderator
  • the # bug... or did it get fixed already?
    http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/3fccfa0b-af38-4c1f-a5ca-08ff7c168967
    Live for nothing, OR CODE FOR SOMETHING! (Happy now vijaye?^^)
    Thursday, August 20, 2009 4:24 PM
  • german also..
    Live for nothing, OR CODE FOR SOMETHING! (Happy now vijaye?^^)
    Thursday, August 20, 2009 8:54 PM
  • A Volume option for sounds... like sounds.volume = 100 ? would be pretty useful...
    Live for nothing, OR CODE FOR SOMETHING! (Happy now vijaye?^^)
    Friday, August 21, 2009 12:41 AM
  • If an image doesn't exist, it crashes with a DrawImage

    bg = ImageList.LoadImage("C:\doesntexist.jpg")
    GraphicsWindow.DrawImage(bg,0,0)

    Also a different colour for comments to distinguish from keywords would improve code readability.
    Sunday, August 23, 2009 9:59 PM
    Moderator
  • If an image doesn't exist, it crashes with a DrawImage

    bg = ImageList.LoadImage("C:\doesntexist.jpg")
    GraphicsWindow.DrawImage(bg,0,0)

    Also a different colour for comments to distinguish from keywords would improve code readability.

    I'll have that crash fixed for v0.7.

    Litdev, the colors are actually different.  Are you asking for more contrast?

    Monday, August 24, 2009 1:49 AM
    Moderator
  • ... the colors are actually different.  Are you asking for more contrast?




    TextWindow.Clear() 'clears the TextWindow

    I think Litdev is referring to Objects and Comments, both appear green.
    Monday, August 24, 2009 3:33 AM
  • I think Litdev is referring to Objects and Comments, both appear green.
    We could use Colors.Teal for Objects, and Colors.Green for Comments. Will that be OK ?

    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Monday, August 24, 2009 2:17 PM
  • http://en.wikipedia.org/wiki/3D_projection

    If it's needed for your projects, you should make that as an extension. Small Basic don't need that by default, at least at my eyes...
    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Monday, August 24, 2009 2:19 PM
  • Any suitable colour distinction between objects and comments would be great - I'm not colour blind, but for those that are there may be standard sets of colours that are usually distinguishable.
    Monday, August 24, 2009 5:34 PM
    Moderator
  • I've encountered this since version 4, I thought it was intentional

    Tuesday, August 25, 2009 3:29 AM
  • I am sorely missing functions and parameter passing, though I can deal with that, just have to get used to things. I wouldn't mind having a bit of documentation on how to add extensions and libraries and such, also maybe the ability to change the color of an image that has been loaded as a shape. so that you can load a basic image into a shape, and alter its color somewhat if you want to use it for different things.

    I honestly can't find any huge errors though, I'm loving this language, its easy to learn, easy to implement, and yet quite powerful. As I continue to explore it I'll came back with any bugs I find or suggestions I have. I'm going to work with a couple of my programming friends on thursday on gamedev, and we'll explore this language fully for that purpose then and on various future dates
    Wednesday, August 26, 2009 2:55 AM
  • pan9t0n9, check out http://blogs.msdn.com/smallbasic/archive/2008/10/27/extending-small-basic.aspx for some documentation on extensions.
    Wednesday, August 26, 2009 3:01 AM
    Moderator
  • ahh, thanks a ton. this will make life so much easier.
    Wednesday, August 26, 2009 3:16 AM

  • Suggestions:
    - Opacity
    settings for Shapes would be great (should be easy as graphics seems to rely on WPF)
    - ToTheTop/Bottom setting for Shapes, as they were drawn in the order of initialisation.
    - sth. like a break or leave statement to exit loops (WHILE/FOR)

    strange behaviors:
    Program.delay sometimes stops an Animation that startet before and sometimes not (cant reproduce yet)
    initialising a lot of shapes and moving them immediately outside the screen (eg for flying inside the screen later) - they are showing up (flickering) at 0,0 first.


    I just started this weekend with sb, but i think it has potential.
    Maybe some of my remarks are already solved or i am just too dumb. ;-)

     
    Sunday, August 30, 2009 10:07 PM
  • Opacity can be handled with hex colour codes eg. GraphicsWindow.BrushColor = "#33ff0000" is transparent red.

    The depth order of shapes and their initialisation flicker at 0,0 is known and for the most part isn't a big issue for the intended SmallBasic users, where the point is to provide a small environment to learn how to program.

    By small, I mean a limited number of keywords without a multitude of different ways of doing similar things to choose from.

    Since it is designed to be as small as possible, the break/leave ideas wouldn't probably be high priority, and can be achieved with the dreaded GoTo or ending loops by setting the conditional/iterator to be false.

    For i = 1 To 10
      TextWindow.WriteLine(i)
      If (i*i > 20) Then
        Goto finished
      EndIf
    EndFor
    finished:

    Or

    For i = 1 To 10
      TextWindow.WriteLine(i)
      If (i*i > 20) Then
        i = 10
      EndIf
    EndFor

    Or

    loop = "True"
    i = 1
    While (loop)
      TextWindow.WriteLine(i)
      If (i*i > 20) Then
        loop = "False"
      EndIf
      i = i+1
    EndWhile
    Monday, August 31, 2009 10:18 AM
    Moderator
  • Opacity can be handled with hex colour codes eg. GraphicsWindow.BrushColor = "#33ff0000" is transparent red.

    The depth order of shapes and their initialisation flicker at 0,0 is known and for the most part isn't a big issue for the intended SmallBasic users, where the point is to provide a small environment to learn how to program.

    By small, I mean a limited number of keywords without a multitude of different ways of doing similar things to choose from.

    Since it is designed to be as small as possible, the break/leave ideas wouldn't probably be high priority, and can be achieved with the dreaded GoTo or ending loops by setting the conditional/iterator to be false.
    Personnaly, I think Opacity is good to implement. I've implemented it in my extension. You then can modify the opacity of an object whithout having to delete it and reinsert it with new parameters. BTW, your trick just fails for images, buttons, textboxes, ...

    The problem of the order of the shapes should be solved too. It's an annoying thing that we can't add a shape below another after the first beeing inserted.

    I agree with litdev % break/continue. It's not needed.

    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Monday, August 31, 2009 11:13 AM
  • I know performance is not a real issue in SmallBasic. But I notice heavy performance drops when moving the mouse. Especially games with mouse movement and a couples of shapes in it are dying on older hardware. In a test scenario I have drops form 70fps to 33fps. Its even more annyoing in games where you dont need mouse, but moving it still affects the frame rate.

    Reading attributes from objects like Shapes is incredibly slow. In my test scenario I have also performance drops from about 50%. But I can live with that.

    Have a look at listing ZVW013 for these 2 scenarios.
    Wednesday, September 2, 2009 7:34 PM
  • Another related performance test on Writing and Reading arrays (i.e. indexing speed since SB arrays are really dictionary lists I think).  On my PC I get the following timings for the code below.  Writing arrays slows dramatically with array size, while reading is roughly proportional to array size.

    Keep arrays small and avoid large multi-dimensional arrays as already suggested elsewhere.

    Write Test time = 15.00 ms for 100
    Read Test time = 1.00 ms for 100
    Write Test time = 895.00 ms for 1000
    Read Test time = 3.00 ms for 1000
    Write Test time = 74575.00 ms for 10000
    Read Test time = 30.00 ms for 10000
    Press any key to continue...

    size = 100
    x = ""
    WriteTest()
    ReadTest()
    size = 1000
    x = ""
    WriteTest()
    ReadTest()
    size = 10000
    x = ""
    WriteTest()
    ReadTest()

    Sub WriteTest
      start = Clock.ElapsedMilliseconds
      For i = 1 To size
        x[i] = i
      EndFor
      elapse = Clock.ElapsedMilliseconds-start
      TextWindow.WriteLine("Write Test time = "+elapse+" ms for "+size)
    EndSub

    Sub ReadTest
      start = Clock.ElapsedMilliseconds
      For i = 1 To size
        y = x[i]
      EndFor
      elapse = Clock.ElapsedMilliseconds-start
      TextWindow.WriteLine("Read Test time = "+elapse+" ms for "+size)
    EndSub


    Wednesday, September 2, 2009 8:30 PM
    Moderator
  • Writing arrays slows dramatically with array size, while reading is roughly proportional to array size.
    It's linked the way Arrays work in Small Basic. You can't modify an array due to the Primitive type that's a value type.

    In consequence, you end up by creating a whole new dictionnary at eatch modification. This is way Writing is no proportionnal, while reading is.

    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Thursday, September 3, 2009 5:49 AM
  • I would really appreciate a better timer resolution. Anything below 16ms seems not to be able to measure.

    Bug?
    Sometimes the Dictionary doesn't propose the correct statements anymore -> http://www.crew99.com/smallbasic01.jpg

    Friday, September 4, 2009 7:52 AM
  • Something like
    Shapes.Hide(shapeName)
    would be nice. At the moment I have to remember the position, move the Shape out of the Window and later restore it at the old position.
    Monday, September 7, 2009 8:51 PM
  • I would really appreciate a better timer resolution. Anything below 16ms seems not to be able to measure.

    In liu of a compiler change, check out STARGATES to see how a filtered version of the timer is done.  It may be a bit strange but works more or less.

    The timer resolution I think you figured out is also why there seems to be a huge frame rate drop.  It only takes a little bit of loading to drop from 1/0.016 FPS to 1/(2*0.016) FPS, equivalently 62 and 31 FPS.  There's very little precision on measuring FPS.
    Wednesday, September 9, 2009 7:06 PM
  • I would really appreciate a better timer resolution. Anything below 16ms seems not to be able to measure.

    In liu of a compiler change, check out STARGATES to see how a filtered version of the timer is done.  It may be a bit strange but works more or less.

    The timer resolution I think you figured out is also why there seems to be a huge frame rate drop.  It only takes a little bit of loading to drop from 1/0.016 FPS to 1/(2*0.016) FPS, equivalently 62 and 31 FPS.  There's very little precision on measuring FPS.
    You are right, there is a workaround. Meanwhile I do something similar like STARGATE. But as Small Basic should be as easy as it could be, there should be a better option. Sure there is very little precision in measuring fps, but its not only the measurement, the drop is real  ;-)
    Rasterization consumes a lot of time in Small Basic and is heavily influenced by input (mouse/keyboard). A bit too much for my opinion.

    Thursday, September 10, 2009 5:18 AM
  • GraphicsWindow.Hide()
    GraphicsWindow.Width = 1024
    GraphicsWindow.Height = 768
    TextWindow.WriteLine(GraphicsWindow.Width)
    GraphicsWindow.Show()
    TextWindow.WriteLine(GraphicsWindow.Width)

    Attributes from GraphicsWindow can only be read after the window is shown. The first output from GraphicsWindow.Height/Width will be 0. After the Show()-Command I will get the correct value 1024.
    Saturday, September 19, 2009 8:34 AM
  • I would love to see that with double-click on the top of the Edit-Window it sizes automatically into the full LeftHand part of the screen.
    Now you need to manually resize by 1st moving the window to the top-left corner and then pulling on the bottom-right corner.
    Also I would like to see that one can jump to the error line/position indicated in the bottom error-log rather then manually scrolling.
    Btw even the line-pos indicator does not change with scrolling.

    I'm aware that it's not a full high-tech development environment but this would make things more easy and does not overload new and young users.

    Regards
    Tuesday, September 22, 2009 7:22 PM
  • You can jump to an error by double clicking on the error message.
    Tuesday, September 22, 2009 7:28 PM
    Moderator
  • You can jump to an error by double clicking on the error message.
    @Vijaye
      Maybe you could write a section on errors and some tips on how to deal with them in the Introducing Small Basic.pdf.  Its a big topic all beginners all programmers:) have to deal with.

    Tuesday, September 22, 2009 8:59 PM
  • I have an idea: a way to call a Sub by a function using a variable:

    GoSub(var1)
    Sub Foo
    ...
    EndSub

    Sub Bar
    ...
    EndSub

    Where var1 is the name of a specific subroutine.
    It would make branching easy and extremely simple. However, not being fluent in the extension making process, I have no idea how long or advanced it would be to implement.
    Wednesday, September 23, 2009 8:46 PM
  • I am missing joystick support. We have keyboard and mouse input, but no joystick. It would be a nice feature.
    Tuesday, September 29, 2009 9:06 AM
  • how about something like bookmarks? for example i mark a subroutine named "jumping" with the bookmark tool. then it appears in a list. so i can just klick on "jumping" in the list and the code window scrolls down to the position where the "jumping" subroutine is. that would make coding much more organized and faster.. (but just if you get the idea^^)
    Live for nothing, OR CODE FOR SOMETHING!
    • Edited by Dudeson Friday, October 2, 2009 4:58 PM
    Thursday, October 1, 2009 5:01 PM
  • I like it!
    Thursday, October 1, 2009 6:10 PM
  • The Save As... in the tool bar stays active, even if there is no active document. Attempting to use it brings up a save as dialog, and then reports an error when the file is "saved"
    Wednesday, October 7, 2009 3:11 PM
  • GraphicsWindow.GetPixel does not work correctly in 0.6.
    Example: GraphicsWindow.Show()
    GraphicsWindow.BackgroundColor = "Gray"
    GraphicsWindow.DrawText(20, 20, GraphicsWindow.GetPixel(1,1))
    Wednesday, October 14, 2009 11:47 AM
  • We could have a listbox below the toolbar with all the subroutines created, so that clicking on an item in the list you stand on the subroutine in code area instead of a manual subroutine marking!

    I have read that it is not a priority but, I would like to have the "break" instruction to stop the cycle and "continue" to get the next iteration. Only these are acceptable controlled jumps  in order to write more readable code. Where is the logical "Not" for conditions? It's useful the instruction "repeat...until(cond)".
    Stop "GOTO" abuse!
    If someone learns to program, is better not learn to write spaghetti code!


    The variable scope is necessary (at least global and subroutine). There are no languages that have not this concept!

    Bye
    Wednesday, October 14, 2009 7:33 PM
  • yeah. a list with subroutines would be nice. i didnt mean them to be manually marked. i was just explaining the idea..
    Live for nothing, OR CODE FOR SOMETHING!
    Wednesday, October 14, 2009 7:36 PM
  • There is a problem with the program listing... see this
    http://smallbasic.com/program/?MNJ272

    above the code
    if(c>a)then

    there is a comment where I wrote
    ' it's necessary that a<b or I swap...

    but <b causes a problem

    Wednesday, October 14, 2009 8:37 PM
  • Enjoying Small Basic so far, however there are a few bugs/omissions I'd like to see changed:

    * You can create a line by Shapes.AddLine, but Shapes.Move etc. do not appear to affect it

    * It seems that Shape objects are a more effficient solution than redrawing the graphics window, is there any possibility of some kind of TextBox shape that can be moved/have the text inside changed without having to redraw; would be good for say a score counter in games

    * There is a NatualLog function, but no constant e, so using using Power to get e^x seems to be impossible; can we have an e value along with pi
    Wednesday, October 14, 2009 10:38 PM
  • theres another bug i found, wich is pretty annoying in my opinion.

    for example when i try to write "graphicswindow" (without the "") that little list pops up with "graphicswindow" selected. so i can just write "gr" and hit enter and "graphicswindow" will be written for example.

    but sometimes this doesnt work. instead it jumps to a new line..
    Live for nothing, OR CODE FOR SOMETHING!
    Thursday, October 15, 2009 3:45 PM
  • Hungarian keyboard does not write "*". Insted of changing letter size.
    * on the button <AltGr></>.
    Thursday, October 15, 2009 6:57 PM
  • SUGGESTION for TEXT. methods

    please implement RIGHT$() function.  It not so easy for use for beginers with the TEXT.GETSUBTEXT method.

    Thursday, October 15, 2009 7:38 PM
  • 'If you normally write subroutines before your main code block,
    'this causes a 'variable used, but not assigned' error.

    Sub OKD 
      Program.End()
    EndSub

    GraphicsWindow.KeyDown = OKD

    Sunday, October 18, 2009 12:25 AM
  • 1. Start Small Basic with clean editor screen.
    2. Type anything.
    3. Press Ctrl+A and delete what you typed.
    4. Type "$" symbol and then any letter you want.

    Small Basic will crash.

    Impossible is nothing
    Tuesday, October 20, 2009 12:08 AM
  • Thanks Auren.  I've noted this bug down - it will be fixed for v0.8.

    Tuesday, October 20, 2009 1:19 AM
    Moderator
  • Try simply turning the pen on and off.  In the cubes sample program when you create a cube Smallbasic first puts it in the top left corner.  If you really want the cube to first appear somewhere else turn the pen off, create the cube, move it to where you want, then turn the pen on.

    Copy and paste the following into the SmallBasic code window, then run it:

    'modified by Robert W Jones

    cubesize = 40
    GraphicRows = 10
    GraphicColumns = 15

    GraphicsWindowHeight = (GraphicRows * cubesize)
    GraphicsWindowHeight = GraphicsWindowHeight + ( 6 * cubesize)
    GrapicsWindowWidth  = (GraphicColumns * cubesize) + ( 6 * cubesize)
    GraphicsWindow.Width = GrapicsWindowWidth
    GraphicsWindow.Height = GraphicsWindowHeight

    GraphicsWindow.BackgroundColor = "Blue"
    GraphicsWindow.BrushColor = "yellow"
    GraphicsWindow.DrawBoundText(50,5,200,"Grid size = " + GraphicsWindowHeight + " by " + GrapicsWindowWidth)

    rows = GraphicRows
    columns = GraphicColumns
    GraphicsWindow.DrawBoundText(50,20,200,"Grid size = " + rows + " by " + columns)
    GraphicsWindow.BrushColor = "black"
    GraphicsWindow.fillRectangle(0,0,cubesize,cubesize)
    DrawCubes()
    'MoveCubes()

    RotateCubeAngle = 45
    RotateCubes()

    MoveCubes2()

    RotateCubeAngle = 90
    RotateCubes()

    MoveCubes()
    MoveCubesOut()

    'GraphicsWindow.Clear()
    GraphicsWindow.BrushColor = "black"
    GraphicsWindow.fillEllipse(GrapicsWindowWidth * .5 - 60, GraphicsWindowHeight * 2 / 3 + 20, 120, 40)
    DrawBalls()
    MoveCubes()

    Sub DrawCubes
      For r = 1 To rows
        For c = 1 To columns
          GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()
          boxes[r][c] = Shapes.AddRectangle(cubesize, cubesize)
          Shapes.Animate(boxes[r][c], c * cubesize, r * cubesize, 1000)
          Program.Delay(300)
        EndFor
      EndFor
    EndSub
     
     
    Sub MoveCubesOut
      For r = rows To 1 step -1
        For c = columns To 1 Step -1
          'GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()
          'boxes[r][c] = Shapes.AddRectangle(cubesize, cubesize)
          Shapes.Animate(boxes[r][c], c * cubesize, r * cubesize, 1000)
          Program.Delay(300)
        EndFor
      EndFor
    EndSub
     

     
    Sub DrawBalls
      For r = 1 To rows
        For c = 1 To columns
          GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()
          Shapes.Remove(boxes[r][c])
          boxes[r][c] = Shapes.AddEllipse(cubesize, cubesize)
          Shapes.Move(boxes[r][c], GrapicsWindowWidth * .5, GraphicsWindowHeight * 2 / 3)
          Shapes.Animate(boxes[r][c], c * cubesize, r * cubesize, 1000)
          Program.Delay(300)
        EndFor
      EndFor
    EndSub
     
    Sub MoveCubes
      For r = 1 To rows
        For c = 1 To columns
          Shapes.Animate(boxes[r][c], (c-1) * cubesize, (r-1)*cubesize, 1000)
          Program.Delay(300)
        EndFor
      EndFor
    EndSub

    Sub MoveCubes2
      cubesize = cubesize + 15
      For r = 1 To rows
        For c = 1 To columns
          Shapes.Animate(boxes[r][c], (c-1) * cubesize + 8, (r-1)*cubesize + 8, 1000)
          Program.Delay(300)
        EndFor
      EndFor
      cubesize  = cubesize - 15
    EndSub

    Sub RotateCubes
      For r = 1 To rows
        For c = 1 To columns
          Shapes.Rotate(boxes[r][c], RotateCubeAngle)
          Program.Delay(300)
        EndFor
      EndFor
    EndSub
     
    Tuesday, October 20, 2009 4:20 AM
  • If you divide by 0 the .exe program are crashing. The .Net not resolve it?
    Tuesday, October 20, 2009 7:38 AM
  • a way to set the layer for each shape would be great!

    something like this:
    "shapes.setlayer(shapename)"

    and this:
    "shapes.getlayer(shapename)"


    and what really important is for smallbasic to have is a search and replace function! cuz manually searching and changing a variable is a real pain in the ____...

    something like this in the right click menu (context menu):

    "search and replace"

    there you can enter what you want to find, like this:

    "Text to find: XXXXX"
    "Replace with: YYYYY"

    and then it replaces what you entered (xxx) with the other thing you entered (yyyy)..

    i hope you know what i mean.

    Live for nothing, OR CODE FOR SOMETHING!
    Friday, October 23, 2009 7:44 PM
  • Thanks Auren.  I've noted this bug down - it will be fixed for v0.8.

    This 'bug' doesn't cause my SB to crash. Actually, I see no effect other than the expected one.
    Saturday, November 21, 2009 3:42 PM
  • theres another bug i found, wich is pretty annoying in my opinion.

    for example when i try to write "graphicswindow" (without the "") that little list pops up with "graphicswindow" selected. so i can just write "gr" and hit enter and "graphicswindow" will be written for example.

    but sometimes this doesnt work. instead it jumps to a new line..
    Live for nothing, OR CODE FOR SOMETHING!

    Dudeson, this happens when you are inserting a command into an existing line of code - and it is a bit irritating, yeah. It happens when there is no space between your cursor and the next piece of text on the line (which causes intellisense to get confused as to what command to look for). To get around it you have to click where you want to start typing, press space, press left cursor, then start typing. Or, when you start typing, manually scroll through until you find the GraphicsWindow command, then hit enter.
    Saturday, November 21, 2009 3:49 PM
  • I have an idea: a way to call a Sub by a function using a variable:

    GoSub(var1)
    Sub Foo
    ...
    EndSub

    Sub Bar
    ...
    EndSub

    Where var1 is the name of a specific subroutine.
    It would make branching easy and extremely simple. However, not being fluent in the extension making process, I have no idea how long or advanced it would be to implement.

    Isn't this already easy and uncomplicated enough just using IF statements?  
    Saturday, November 21, 2009 3:56 PM
  • Oops, just noticed this was bugs for 0.6. 
    Saturday, November 21, 2009 4:08 PM