Expert to Expert: The Basics of SmallBasic
- Posted: Jan 20, 2009 at 11:00 AM
- 85,913 Views
- 26 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
My 9 year old son loves it.
--
Furry cows moo and decompress.
And we now have proof that VB6 just doesn't want to die. I know this isn't VB6, but it's proof that VB.NET has too steep a learning curve for some of the very beginners.
Why not just create a newer version of VB6?
Daughter: Yes, Daddy, I have a program that will say "Good Morning" if it's the morning, and "Good Evening" if it's night.
Me: That's great, honey!
Daughter: Also, if you type in a word, it will display the definition.
Me: What??!! [with lots of confusion and a bit of disbelief] Was that in the same chapter???
Daughter: No. I was just playing around.
She showed me the program, and the Dictionary keyword. I had to disable networking and see it quietly fail (returns nothing for definition) before I could believe it was web-service based dictionary.
Congrats on thinking out of the box and including a web-service enabled uber-function as the 12th most important keyword.
My daughter and I are *both* learning what programming is!
C
You should add some Syntactic sugar to the language
1) So at least rename the TextWindow object to T ( i.e. the letter T )
and the graphics window to only G
and make the default window to selected automatically or by declaration
I don't want my kids to waste their time in typing long words
compare this :
n = T.Readnumber()
with this
n = TextWindows.Readnumber()
2) Remove redundant brackets ... for empty arguments !! so we'd have ...
Writeln "Hello World"
instead of
Writeln("Hello World"
4) add BASIC keywords and GWBASIC ... such as DATA , etc
5) How about simple file handling ( open , read , write ..) ??
What I really want is the C# 4+ eval loop that Anders demoed at PDC 2008 in a SmallBasic-esc IDE, not for in-anger work but just for code doodles.
GraphicsWindow.DrawText(20,50, "Loading images...")
For i = 0 To 10
pic = Flickr.GetRandomPicture("Channel9")
GraphicsWindow.DrawResizedImage(pic, 0, 0, 640, 480)
EndFor
GraphicsWindow.Clear()
GraphicsWindow.DrawText(20,50, "Done!")
I wonder what Anders or Paul Vick think of this?
With the regard to this being included in Windows, I for one would love it to be so. It is quite easy to SandBox a lot of the nefarious functionality anyway, so hopefully this can be included in Windows 8 or 9 if it matures well.
C
Great work Vijaye!
Years ago I decided programming wasn't for me, after picking up a C++ book in a college bookstore and realizing it was over my head. This stopped me from going beyond much more than writing simple HTML web pages. But this SmallBasic TRICKED me!! Suddenly I want to program stuff. SmallBasic = Brilliant!!! Thanks for creating it! x10000
Interesting Charles. Are you running on the public 7000 build of Windows 7 and using the public Dev Labs build of SmallBasic? I get the same install error on Windows 7 at home and at work - and both of these boxes are clean installations of Windows 7. Guess I'll have to try popping open the SmallBasic MSI and see if I can't figure out how to put it together by hand...
[Updated]
No need to pop the MSI. It seems that the problem is down to a issue with the CEIP in the Windows 7 Beta. After performing the following official incantations SmallBasic installs beautifully.
An issue with the Customer Experience Improvement Program (CEIP) client in Windows 7 beta is causing Explorer and some MSI-based installers to stop working properly.
To solve this problem, follow these steps:
Click the Start button , click All Programs, and then click Accessories.
Right-click Command Prompt, and then click Run as administrator. In the User Account Control window, verify that Program name is Windows Command Processor, and then click Yes.
In the Administrator: Command Prompt window, type or paste the following text at the prompt:
reg delete HKLM\SOFTWARE\Microsoft\SQMClient\Windows\DisabledSessions /va /f
Press Enter to install the solution.
If The operation completed successfully displays, close the Administrator: Command Prompt window to complete this procedure. If "ERROR: Access is denied" displays, repeat this procedure from the top, making sure you clicked Run as administrator in step two.
Like that!!
InsertLine
Opens the specified file and inserts the contents at the specified line number.
This operation will not overwrite any existing content at the specifid (sic) line.
Should say:
Opens the specified file and inserts the contents before the specified line number.
This operation will not overwrite any existing content at the specified line.
If the selected line number is greater than the number of lines in the file the line will be appended.
If the selected line number is 0 the line will be ignored - no alteration.
Example:
my_return = File.InsertLine("C:\my_file.txt",1,"This is a test " + 1)
TextWindow.WriteLine(my_return)
my_line = File.ReadLine("C:\my_file.txt",1)
TextWindow.WriteLine(my_line)
Well, i am used to write code in VS EE and/or other complex Development Environments but when i saw the SmallBasic IDE, i totally lost myself in its simplicity
ROFL Despite its simplicity, its a great approach for beginners! But what i miss is a compiler,...
I'm with you, in that I love the simplicity of Small Basic. However perhaps you're unaware that it is, in fact, a compiler! Just look in whatever folder you load your .SB files from, and you should see compiled forms of all your projects! For instance, I threw together a simple "Pong" clone ( Yeah, I know - why bother, right? ), and I named my project file "pong.sb", so next time I looked in the folder, sure enough - there was "pong.exe", all compiled & ready to go! I will say Small Basic leaves much to be desired in terms of performance - don't expect blistering execution speed - but it's whole purpose is to serve as a learning tool, not the next "bleeding-edge" C+++++ Uber- development tool. To that extent, I think it fits the purpose beautifully!
Computer Science For Kids has published several Microsoft Small Basic Tutorials that pick up where the Microsoft Small Basic Tutorial leaves off. You can find out more information about them at http://computerscienceforkids.com/MicrosoftSmallBasicTutorials.aspx
Remove this comment
Remove this thread
close