| Welcome, Guest |
You have to register before you can post on our site.
|
| Online Users |
There are currently 37 online users. » 1 Member(s) | 34 Guest(s) Bing, Applebot, KennethFem
|
| Latest Threads |
ZScript
Forum: Discussion
Last Post: z-s
01-22-2026, 03:31 AM
» Replies: 0
» Views: 24
|
I think that no more Smal...
Forum: Discussion
Last Post: eddylo
01-20-2026, 11:02 PM
» Replies: 0
» Views: 21
|
Small Basic Coder-A New G...
Forum: Discussion
Last Post: AbsoluteBeginner
01-17-2026, 07:57 PM
» Replies: 1
» Views: 416
|
ZS Small Basic Coder GPT.
Forum: Discussion
Last Post: z-s
01-13-2026, 03:32 AM
» Replies: 4
» Views: 132
|
3D maze in browser contro...
Forum: Discussion
Last Post: stevantosic
01-08-2026, 12:51 PM
» Replies: 128
» Views: 33,311
|
ZS Extension.
Forum: Extensions
Last Post: AbsoluteBeginner
01-04-2026, 02:50 PM
» Replies: 109
» Views: 28,285
|
Happy New Year!
Forum: Discussion
Last Post: AbsoluteBeginner
12-31-2025, 10:08 AM
» Replies: 0
» Views: 71
|
Six different 8-bit emula...
Forum: Discussion
Last Post: stevantosic
12-28-2025, 06:02 PM
» Replies: 2
» Views: 87
|
Challenge-Command Line GW
Forum: Challenges
Last Post: WhTurner
12-22-2025, 06:24 PM
» Replies: 7
» Views: 2,263
|
Google Search Terminal SB...
Forum: Standard Small Basic
Last Post: z-s
12-17-2025, 09:09 AM
» Replies: 1
» Views: 337
|
|
|
| SmallBasic Open Edition |
|
Posted by: KristianVirtanen - 10-13-2024, 04:41 PM - Forum: C# Moving from Small Basic
- Replies (21)
|
 |
Hi,
This project (SmallBasic Open Edition) is part of a larger whole, where the goal is to recreate Microsoft SmallBasic, at least in its main features.
The first phase of the project, which is exactly this, is to create the same classes as in SmallBasic: Text, Math, GraphicsWindow, and so on. The project is mostly complete, although types for variables, some small tests, and so on are still required.
Note: The classes Array, Flickr, and Dictionary have not been created.
Array is missing because I have not yet decided on the final way the future compiler will handle arrays. I have a couple of different solutions for this, but I haven’t had time to decide yet.
Flickr is missing because I am simply not very familiar with this service, and their API is completely unknown to me.
Dictionary is a class I’m not sure if I want to spend time on, at least not personally.
Unlike the original SmallBasic, Open Edition converts SmallBasic code into the C# programming language and compiles it afterward. This brings significant advantages in terms of memory management, speed, and extensibility.
Variables will function mostly the same way as in the original SmallBasic. This is made possible by C#’s dynamic. However, the idea is that variables will require a suffix of "$" at the end of their names. Not only does this make the programs easier to compile, but I also believe it helps distinguish variables and makes coding a bit easier.
The program that tokenizes and converts SmallBasic code into C# is also mostly done. However, at the moment, it's more like a pile of sticks rather than a well-designed and structured program, so its release will be more appropriate at a later time.
Example SmallBasic program:
Code: ' Example Smallbasic program
x$ = 1
y$ = 2
c$ = "Foo"
TextWindow.WriteLine(x$ + y$ + c$)
SayHello()
Goto MyLabel:
TextWindow.WriteLine("I'm never printed.")
MyLabel:
Program.End()
Sub SayHello
TextWindow.WriteLine("Hello")
EndSub
Converted to C#:
Code: // Converted as C#
namespace SmallBasicOpenEditionDll
{
public static class SB_Program
{
// Declare dynamic variables (similar to Smallbasic's dynamic typing)
public static dynamic x = 1;
public static dynamic y = 2;
public static dynamic c = "Foo";
// Entry point of the program
public static void Main()
{
// Equivalent of TextWindow.WriteLine(x$ + y$ + c$)
TextWindow.WriteLine(x + y + c);
// Call the method SayHello()
SayHello();
// This line will not be executed
Goto MyLabel:
TextWindow.WriteLine("I'm never printed.");
MyLabel:
Program.End();
}
// The equivalent of SmallBasic's subroutine 'SayHello'
public static void SayHello()
{
TextWindow.WriteLine("Hello");
}
}
}
Note: I work with this while I am working with two job's and such, so this will not move forward in fast speed. Help is appreciated here. Let me know
|
|
|
| LDController |
|
Posted by: GBHalford - 10-01-2024, 05:35 AM - Forum: Extensions
- Replies (12)
|
 |
Hi folks, can anyone help me with some issues with the LDController actions ?
I have a generic USB SNES controller.
From the Windows Game Controller settings and properties, I can see that all the buttons are registering correctly, and continue to register whilst held down.
I have SlimDX runtime for .NET 4.0 installed .
In SB, using the LDController.Buttons query, the array returned is completely spasmodic. I have the following code in a While ("True") loop...
LDButtons = LDController.Buttons(1)
GraphicsWindow.Title = LDButtons
E.g. I press button 1 and hold it. For a few seconds there is no response, then Button 1 may register as "True" for a brief moment, and then return to "False" almost instantly.
All other buttons exhibit similar behaviour. Sometimes a button may not register "True" at all while being held down, even though the Controller settings show that the button is depressed.
Here's what the array looks like for a brief period while I am holding Button 1 down... Notice that it is registered as "True" for 2 loop passes.
1=False;2=False;3=False;4=False;5=False;6=False;7=False;8=False;9=False;10=False;
1=False;2=False;3=False;4=False;5=False;6=False;7=False;8=False;9=False;10=False;
1=True;2=False;3=False;4=False;5=False;6=False;7=False;8=False;9=False;10=False;
1=False;2=False;3=False;4=False;5=False;6=False;7=False;8=False;9=False;10=False;
1=False;2=False;3=False;4=False;5=False;6=False;7=False;8=False;9=False;10=False;
1=False;2=False;3=False;4=False;5=False;6=False;7=False;8=False;9=False;10=False;
1=False;2=False;3=False;4=False;5=False;6=False;7=False;8=False;9=False;10=False;
1=True;2=False;3=False;4=False;5=False;6=False;7=False;8=False;9=False;10=False;
1=False;2=False;3=False;4=False;5=False;6=False;7=False;8=False;9=False;10=False;
1=False;2=False;3=False;4=False;5=False;6=False;7=False;8=False;9=False;10=False;
Any help to resolve this so I can get a true reading of current buttons depressed will be much appreciated.
regards, Gordon
|
|
|
| Challenge 7 - Snap |
|
Posted by: litdev - 09-25-2024, 09:15 AM - Forum: Challenges
- Replies (1)
|
 |
Make a 2 player 'Snap' game - first player to press their key when 2 of the same are shown, could be shape, colour, size, image or a combination.
|
|
|
| Voice recognition? |
|
Posted by: Yumda - 09-19-2024, 05:33 AM - Forum: Extensions
- Replies (23)
|
 |
Hi there:
I am trying to write a simple program that can help my father learn to pronounce English better, specifically it will prompt him to pronounce a word and if not recognized then it will not move on to the next word, anyone know of any extensions that can help with voice recognitions for small basics? or any ideas how to go about it another way?
I know it is a big ask, but just hoping if anyone has any ideas.
|
|
|
| Updating SB |
|
Posted by: z-s - 09-09-2024, 12:31 PM - Forum: C# Moving from Small Basic
- Replies (2)
|
 |
Today I got an idea why someone can't help in updating SB.
We have a community here so any good csharp developer can do this but not me.
I could help in writing standard library for SB.
Making it a high-level programing language.
I have some goals that can be in SB
Addition of function like struct new keywords.
And large standard library seperate dll.
Many csharp functionality.
As I thought sb just use csc.exe to compile a small basic program after converting it to csharp am I right????.
|
|
|
|