Happy Birthday Small Basic
- Exactly one year ago, we released the first version of Small Basic CTP to the world. Today, marking its first birthday, we're releasing the 7th installment of Small Basic CTP.
This version adds localized support to 4 new languages, broading the reach to Chinese, French, German, Italian, Korean, Russian, Spanish and Turkish.
Also, this version includes a new feature called "Graduate" that lets you port your Small Basic programs to Visual Basic.
In addition, this features contains the following bug-fixes and new features:- A helpful crash reporting dialog that pops-up whenever your program crashes
- Fixes to Scrollbar size to make it easier to find in huge documents
- Fixed crash when a specified image cannot be loaded
- Fix for foreign keyboards not being able to use AltGr
- Opacity and Visibility properties for Shapes
- Made comments and objects more differentiated in syntax color
- Made the resizer for help pane more discoverable
- Fixed Intellisense clipping issues
- Fixed error column offset issue in the compile errors list
- Disable SaveAs command when no programs are open
Check it out: http://smallbasic.com
Or download directly: http://download.microsoft.com/download/C/A/F/CAF9E062-94D3-4003-80D9-44CDF7EC7BD9/SmallBasic.msi
All Replies
- If the link downloads v0.6 still, please clear your browser cache and try again. If that doesn't work, wait a few hours and try again.
- Export to VB... what a great idea.
HAPPY BIRTHDAY! :)
Good job Vijaye.
Grzesio- Ditto bigdaddio,
This is a great idea to help people graduate to the next steps. Of course you need to install VB Express 2008 .
To use the interactive VB debugging new variables need to be set as required e.g.
ProgramDirectory = Program.Directory 'original SB converted to VB
Dim PD As String = ProgramDirectory 'inserted VB code line
PD can then be seen by the VB debugging - perhaps there is an easier way?
In this case Program.Directory is now the VB path, not the original SB path - so either copy any required files to the new path or reset the variable in the VB.
Also much faster in VB - and will this will be a great aid for some (Dudeson) struggling with performance and find starting with VB too big a hurdle - well done.
Only problem I have seen is SB files starting with non standard characters (e.g. '2shadows.sb').
Extensions can also be used by adding a reference (Project->Add Reference->Browse->Extension dll ) in VB, then importing MyExtensions .
Imports MyExtensions
Module SpeechTestModule
Sub Main()
Speech. Speak("Small Basic Speech Music extension converted to VB")
End Sub
End Module
If the link downloads v0.6 still, please clear your browser cache and try again. If that doesn't work, wait a few hours and try again.
I'm tried downloading in three browsers on two computers on two networks, and still get v0.6 each time. Is this the right address:
http://download.microsoft.com/download/C/A/F/CAF9E062-94D3-4003-80D9-44CDF7EC7BD9/SmallBasic.msi
Thanks.
Andrew Burton - http://profnano.org- That is the correct address. The binaries take a while to replicate to servers across the world. This could range from a few hours to, in some extreme cases, days. We pushed the bits last night - so please wait a bit and try again. Your ISP could also be caching the binaries and that could take a while to refresh.
- The easy way to tell which version you are about to download is by the file size. 0.7 is 4.33mb while 0.6 is 4.21mb.
A quick review of 0.7 shows it to be very exciting. Tried Graduate on a couple of programs! Works really well with the minor exception that the definition of an array doesn't translate properly to VB in the cubes demo. Appreciate it if someone could post the fix.
I think this is going to be a great product. It is very easy to learn, yet can take on some very complicated tasks.
Many Thanks to the developers! - Congrats SmallBasic, you have helped learn the ways (Not finished yet) programming. The new graduate option will be a success. But VisualStudio 2010 is comming soon will this be compatible on that. I have been using smallbasic to try to build to visualbasic (Small basic can only do so much but thats a good thing for me!) It will be a little easier making graphics programs becuase I dont know how to do the whole X and Y coordinates (Im 13 so only in 7th grade math). Ive used visualbasic before and know that you can drag and drop things (like buttons, text boxes, text, shapes, etc.) I am looking forward to download this tommorow (its 9:00 PM here and my computer is off for the day and im typing this on my parents computer). I hope that when I have problems with VisualBasic that I can have the same help as I do from this great community!
- Robert,
Multi dimensional arrays are handled differently in SmallBasic and VB.
VB of course can handle multi-dimensional arrays, and consequently the conversion requires some work in the VB.
The main limitation is that in VB, any array dimension greater than 1 requires to be indexed by numbers and its maximum size initially set at the start . There may be other issues as people try things - half the fun is investigating and understanding how it all works.
For example, consider the SB program
a[1][1] = "test11"
a[1][2] = "test12"
a[2][1] = "test21"
a[2][2] = "test22"
For i = 1 To 2
For j = 1 To 2
TextWindow.WriteLine(a[i][j])
EndFor
EndFor
This is converted to VB as:
Module arrayModule
Dim a, i, j As Primitive
Sub Main()
a(1)(1) = "test11"
a(1)(2) = "test12"
a(2)(1) = "test21"
a(2)(2) = "test22"
For i = 1 To 2
For j = 1 To 2
TextWindow.WriteLine(a(i)(j))
Next
Next
End Sub
End Module
And needs to be modified to the following - note the a(2) and the Program.Delay(1000) added to prevent the program from ending immediately.
Module arrayModule
Dim a(2) , i, j As Primitive
Sub Main()
a(1)(1) = "test11"
a(1)(2) = "test12"
a(2)(1) = "test21"
a(2)(2) = "test22"
For i = 1 To 2
For j = 1 To 2
TextWindow.WriteLine(a(i)(j))
Next
Next
Program.Delay(1000)
End Sub
End Module
I don't know where the cubes program is, so if you post a link or publish an import code we can help you with this. Also much faster in VB - and will this will be a great aid for some (Dudeson) struggling with performance and find starting with VB too big a hurdle - well done.
:D
yeah!
and that you can set the opacity, is very useful for my smokecode now!
but the download still says 0.6 for me atm...
Live for nothing, OR CODE FOR SOMETHING!Thanks Litdev. This is the program I was playing with. It is based on one of the samples and really was just a learning exercise. I tried your fix which worked but the program only draws two rows of cubes and then pops an error. I haven't had the time yet to explore it further.
'modified by Robert W Jonescubesize = 40
GraphicRows = 10
GraphicColumns = 15GraphicsWindowHeight = (GraphicRows * cubesize)
GraphicsWindowHeight = GraphicsWindowHeight + ( 6 * cubesize)
GrapicsWindowWidth = (GraphicColumns * cubesize) + ( 6 * cubesize)
GraphicsWindow.Width = GrapicsWindowWidth
GraphicsWindow.Height = GraphicsWindowHeightGraphicsWindow.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
EndSubSub 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
EndSubSub RotateCubes
For r = 1 To rows
For c = 1 To columns
Shapes.Rotate(boxes[r][c], RotateCubeAngle)
Program.Delay(300)
EndFor
EndFor
EndSub
- the strange thing about the download is:
i was at my friends house today, and downloaded small basic 0.7! but its still giving me 0.6 at home.. wtf??
Live for nothing, OR CODE FOR SOMETHING! - LitDev, you nailed the problem. The MultiDimensional array was one thing that I couldn't get working before the release. I will fix this for v0.8 (depending on how many people use the multi-dimensional array feature).
Dudeson, can you try clearing your browser's cache? - Okay, I figured this out. Take this simple example from the Book in Small Basic:
rows = 8
columns = 8
size = 40
For r = 1 To rows
For c = 1 To columns
GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()
boxes[r][c] = Shapes.AddRectangle(size, size)
Shapes.Move(boxes[r][c], c * size, r * size)
EndFor
EndFor
Rin this and you will get what looks like a rubiks cube on your screen. Now graduate this program to VB and you will get this
Module
BobCubes001aModule
Dim rows, columns, size, r, c, boxes(10, 10) As Primitive
Sub Main()
rows = 8
columns = 8
size = 40
For r As Integer = 1 To rows
For c As Integer = 1 To columns
GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()
boxes(r, c) = Shapes.AddRectangle(size, size)
Shapes.Move(boxes(r, c), c * size, r * size)
Next
Next
End Sub
End
Module
The bits that are bold and underlined are changes that you have to make in the VB Code to make this work.
1. In the dim statement look at boxes(10,10). The number of commas is one less then the number of dimensions in the array. We want a two dimension array so put one comma between the brackets. The maximum number of items in each dimension is the number, in this case we will create a 11 by 11 array. 0 is a valid position in the array thus it is 11 by 11 instead of 10 by 10.
2. Go down in the VB code to the line that begins For r = . VB wants you to add "As Integer" between r and the equals sign. It is a cute way of declaring that r is an intereger. Each for statement in VB is coded this way.
3. The third change is the way you code an array location in VB
In small basic you say boxes[r][c] for example. In VB it is coded as boxes(r,c).
The fixes are easy to make, although I did have to look up the VB code in VB help. :)
I am begining to wonder weather or not SB should called be Simple Basic because that is exactly what it is!
Dudeson, can you try clearing your browser's cache?
already did...
but i got his 0.7 version anyway now..
Live for nothing, OR CODE FOR SOMETHING!- Why the new version requests to remove the old?)
- Happy birthday!
Want to thank you for re-igniting my passion for programming.
I have started programming with C# 2008 Express Edition and it has been a steep learning experience, but I like it!
I have made a simple Tic-Tac-Toe game using a standard form and buttons. It keeps score for X's, O's, and ties and (currently) plays one sound sample for a win and a different sound sample for a tie.
One thing I need to point out.
C-sharp's Start Page, that connects to http://go.microsoft.com/fwlink/?linkid=85889&clcid=409 as the news channel, still shows;
"Small Basic V0.2 is Now Available!"
You might want to update that. :-) - Happy Belated Birthday to SB... but does this need to be a sticky thread still?Also, as it seems to be more useful in regard to details about importing to VB, it may want to be renamed.


