This article is contributed. See the original author and article here.
Today, I’d like to introduce current status of Small Basic Online. At first, I will introduce fixed issues this year. Second, I’ll tell what is the difference between Small Basic Online (SBO) and Small Basic Desktop (SBD). At last, I will show some ideas to write in SBO.
Fixed issues 2020 in SBO
Following issues have been fixed this year. SBO issues are managed in GitHub.
- #152 Array index is not case insensitive.
- #150 Array entry never removed
- #134 Level 2 Tutorial Should Work (same as #106 and #112)
- #133 Level 1 Tutorial should work
- #129 Some of spaces will be lost in text literals
- #127 Page does not load on Mac+Safari
- #126 Default of FontBold is “False”
- #122 TextWindow.ReadNumber Doesn’t allow negative or decimal numbers
- #121 Text.Append does not append all printable character strings
- #112 GraphicsWindow.KeyDown event never be called
- #107 Turtle appears not on the trailing line on Chrome & Edge browsers
- #106 GraphicsWindow.LastKey always return null
- #58 GraphicsWindow.DrawImage doesn’t show the image
- #14 Turtle graphic missing on Edge browser
Changes in SBO
There are many changes in SBO from SBD. SBO is still beta. So, some may be fixed but some will remain as the difference.
New features
- Most important point is SBO allows us to program with only browser such as Edge and Chrome. This means SBO runs in not only Windows but other operating systems.
- 11 new features (Libraries Pane, Debug Mode, Updated Sample Program, New Icon Designs, Advanced Error Handling, Auto Filling, Hover Hints, Save & Open, TXT File Format, Open Source on GitHub, Double Display) are described in Ed’s “NEW UPDATES: Small Basic Website 2.2 & Small Basic Online 1.0“.
- Error messages are detailed in here.
- Shortcuts for keyboard are detailed in here.
Extensions cannot be used
Extensions such as Kinect for Small Basic and LitDev cannot be used.
Initial value of variable
The initial value of the variable is “”. But reference to the variable without initializing causes compile error in SBD, while no error in SBO.
Array initialization
In SBD, Not = “False = True; True = False;” could initialize the array Not, but in SBO, the variable Not simply contains the above string.
Specifying transparent color
In Small Basic v1.2, the alpha value for opacity was specified as “#aarrggbb”, but in SBO v1.0 it becomes “#rrggbbaa”.
Features not implemented
The following functions cannot be implemented in SBO (online). Writing in code will result in a syntax error of The library member’ObjXXX.MbrXXX’ cannot be used in the online editor. Please download the desktop editor to use it..
- File.AppendContents()
- File.CopyFile()
- File.CreateDirectory()
- File.DeleteFile()
- File.DeleteDirectory()
- File.GetDirectories()
- File.GetFiles()
- File.GetTemporaryFilePath()
- File.InsertLine()
- File.LastError
- File.ReadContents()
- File.ReadLine()
- File.WriteContents()
- File.WriteLine()
- ImageList.LoadImage()
The following features are not yet implemented in SBO v1.0. I can’t press the button.
- Publish
- Import
The following features are not yet implemented in SBO v1.0. Writing in code results in a syntax error of The library member’ObjXXX.MbrXXX’ was available in older versions only, and has not been made available to this version yet..
- Desktop.Height
- Desktop.SetWallPaper()
- Desktop.Width
- Dictionary.GetDefinition()
- Dictionary.GetDefinitionEnglishToEnglish()
- Dictionary.GetDefinitionEnglishToFrench()
- Dictionary.GetDefinitionEnglishToGerman()
- Dictionary.GetDefinitionEnglishToItalian()
- Dictionary.GetDefinitionEnglishToJapanese()
- Dictionary.GetDefinitionEnglishToKorean()
- Dictionary.GetDefinitionEnglishToSimplifiedChinese()
- Dictionary.GetDefinitionEnglishToTraditionalChinese()
- Dictionary.GetDefinitionFrenchToEnglish()
- Dictionary.GetDefinitionGermanToEnglish()
- Dictionary.GetDefinitionItalianToEnglish()
- Dictionary.GetDefinitionJapaneseToEnglish()
- Dictionary.GetDefinitionKoreanToEnglish()
- Dictionary.GetDefinitionSimplifiedChineseToEnglish()
- Dictionary.GetDefinitionTraditionalChineseToEnglish()
- File.GetSettingsFilePath()
- File.ReadLine()
- File.WriteLine()
- Flickr.GetPictureOfMoment()
- Flickr.GetRandomPicture()
- Dictionary.GetDefinition()
- GraphicsWindow.CanResize
- GraphicsWindow.Left
- GraphicsWindow.Title
- GraphicsWindow.Top
- Program.ArgumentCount
- Program.Directory
- Program.GetArgument()
- TextWindow.CursorLeft
- TextWindow.CursorTop
- TextWindow.Left
- TextWindow.Pause()
- TextWindow.Title
- TextWindow.Top
Fonts
SBO has only Arial (Helvetica), Consolas, Courier New (Courier), Roboto and Times New Roman (Times). Details are described here.
Read-only GraphicsWindow size
The following properties are now read-only in SBO v1.0. Attempting to assign a value results in a syntax error Property’ObjXXX.PrpXXX’ cannot be assigned to. It is ready only..
- GraphicsWindow.Width
- GraphicsWindow.Height
Shapes size
When I made a square with Shapes.AddRectangle (100, 100), it was 100 x 100 pixels in size, including the thickness of the pen. On the other hand, when it was made with GraphicsWindow.DrawRectangle (10, 10, 100, 100), it was larger by the thickness of the pen. In SBO, the latter is unified, and if the pen thickness is 2 pixels, both will draw a square of 102 x 102 pixels.
Turtle design
The design of the turtle has changed. Especially the size has increased.
Turtle trails
The turtle trails are the same as Shapes in SBD, and the one created later was displayed in the foreground, but in SBO, the turtle trails are always in front of Shapes.
New programming style
Based on the above changes, I would like to explain the points about programming in the new Small Basic.
Make your own title
Neither GraphicsWindow.Title nor TextWindow.Title can be changed, so if you want to display the title, use Shapes.AddText, TextWindow.WriteLine, etc. to display it in the window.
Sample program XMC184-3 below has own title.
Ingenuity that does not depend on window size
There is a concept of responsive design so that the homepage can support devices of various sizes. Since SBO cannot specify GraphicsWindow.Width or GraphicsWindow.Height and is affected by the window size of the browser, it is a good idea to adopt the idea of responsive design. Specifically, it monitors GraphicsWindow.Width and GraphicsWindow.Height so that it will be repositioned on the screen when it changes.
Following program CVF012 will run in both SBO and SBD.
Conclusion
This time, as far as I know, I wrote about the changes in SBO and new programming styles based on it, but I will continue testing SBO and write a lot of programs for SBO from now on, so I will update this article as needed. Thanks.
Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.
Recent Comments