Project - SBASIC

SBASIC

SBASIC is a well featured port of BASIC for NETMF. This initial release have everything you’d find in QBASIC with the exception of Drawing & File methods; which will be added in the future.

Subroutines, functions and stacks are implemented as are the following commands:

ASC, BREAK, CASE, CHR, CLS, DO, DOUBLE, END FUNCTION, END IF, END SUB, END WHILE, FOR, FUNCTION, GOTO, GOSUB, IF, INKEY, INPUT, INSTR, INT, LCASE, LEFT, LEN, LOOP, LONG, MID, NEXT, PRINT, RETURN, RIGHT, RND, SCREEN, SELECT, SINGLE, SPACE, STR, STRING, SUB, TEXT, UCASE, VAL and WHILE.

A sample script is included in the resources; just run in the emulator.

1 Like

You are the master :slight_smile:

I’m currently wiring up a PS/2 keyboard to my Hydra. Want to make it play nice over a Gadgeteer Socket, I’ll be picking up a proper DIN6 connector & breakout set around Christmas. :smiley:

What is the state of this project? I can’t find it on Skewworks website, so I assume it is abandonned?

No, SBASIC lives and is being built into project ROME. There’s only one known bug with it, which is a pretty easy fix.

SBASIC will continue to be expanded with additional functionality. Was there something new you were looking for?

I am facing a need to implement some kind of scripting in NETMF. SBASIC might be both cool and useful :slight_smile: However, SBASIC in codeshare is still far from working perfectly, probably because it’s not the latest version.

I guess I’ll have to wait for ROME to evaluate SBASIC in it.

By the way, why it’s “INT variable” and not “DIM variable AS INTERGER”? :slight_smile:

There were several different flavors of BASIC (for example Q-BASIC), each of them had slightly different ways of doing things.

DIM X AS INTEGER
DEFINT X
INT X

All of those have seen use in one flavor of BASIC or another. INT X, is the one I chose to go with.

As for functionality of SBASIC in CodeShare it should be pretty solid minus one issue with doing loops where I codes <=, >= incorrectly.

Well, it’s been a while since I used QB, but “DIM variable AS INTEGER” would simply sound more BASIC’ish, IMHO :slight_smile:

Anyway, regarding the port on Codeshare, I was unable to make INKEY working. Also, when I see something like


case "LCASE":       // ToLower
case "LEFT":        // Left
case "LEN":         // Length
          break;

I automatically assume something is not finished.

All these issues are minor, and this port is good for playing around. But before making it really useful, I need SBASIC to somehow intreface with my hardware and higher level routines, already written in C#. Is this already on the plans or should I start thinking of it myself?

Whoops! Looks like that is out of date!

Integrating with higher-level stuff is part of what’s to come. S-BASIC already raises a few events and more will come as it’s geared specifically towards NETMF.

What about an updated version on codeshare to play with? :wink:

I saw the events, but the problem is they are not blocking. Procedure like INKEY should be blocking, that is, it should wait for user input. When calling my C# functions, I would also expect a blocking behaviour.