FEZ Timesharing System Announcement

OK. More information on SBASIC syntax.

The following syntax for an IF statement is NOT supported:

if x <= 10 then goto 20

The only supported IF statement format is:

[quote]if x <= 10 then
goto 20
end if[/quote]

Also, the comparison operator <= is not working correctly. The expression x <= 10 parses into pieces “x” “<” “=10”. Instead of “x” “<=” “10”.
Should be an easy fix. I will get to it later today, and post the correction.

@ Skewworks - Found the problem…

In case you have not already found the problem and fixed it in the master.

There was a problem in the way an IF statement was being parsed. The <= and >= operators were being split.
The correct code for the parsing method is:

private string[] SplitSides(string value)
 {
            // Remove all spaces
            value = StrRemSpaces(value);

            if (value.IndexOf("==") > 0)
            {
                value = StrReplace(value, "==", " == ");
            }
            else if (value.IndexOf(">=") > 0)
            {
                value = StrReplace(value, ">=", " >= ");
            }
            else if (value.IndexOf("<=") > 0)
            {
                value = StrReplace(value, "<=", " <= ");
            }
            else
            {
                value = StrReplace(value, "<", " < ");
                value = StrReplace(value, ">", " > ");
            }

            return SplitComponents(value, ' ');
 }

Thanks Mike ill get the code updated

oh so this sbasic is like qbasic, it does not require line numbering? Then how do I insert a line in an existing program?

here is what I am doing. How should it be done?

10 LET x= 1 (LET is not supported, INT instead but why? Is FLOAT an option?)
20 print x
30 x = x +1
40 if x > 10 then goto 60 (can I just use if x > 10 then end)
50 goto 20
60 end

In the TS system, line numbers are required on all statements. I don’t remember if sbasic also required this.

To insert a line just enter a line with a number between the two target lines.

10 LET x= 1 (LET is not supported, INT instead but why? Is FLOAT an option?)
*** See http://www.tinyclr.com/codeshare/entry/603 for supported keywords
*** int x = 1 I believe is not supported.

20 print x
30 x = x +1

40 if x > 10 then goto 60 (can I just use if x > 10 then end)
*** currently the only IF syntax that is supported is :
if x > 10 then
goto 60
endif


50 goto 20
60 end

I have updated the system, and the IF statement is working properly with the >= and <= operators.

I have uploaded a test program to the public area, which I used for testing the changes,.

If all is well, I will be releasing the source at the end of the week.

I am confused on one thing. You are saying line numbers are optional and if so, how can I insert a line?

@ Gus - the line numbers are not optional.

@ Mike - Then how would I use “if…end if” combination?

Is this correct?

10 INT x= 1
20 print x
30 x = x +1
40 if x > 10 then goto 60
50 goto 20
60 end if
70 end

@ skewworks - why INT instead of LET? There is only one variable type right?

20 if x > 10 then
30 goto 60
40 endif
50 end
60 REM keep going here

LET is/was not used for variable definitions. LET was the keyword at the beginning of
a line that said an arithmetic assignment statement follows. Use of LET became
optional early in the life of Basic.

SBASIC may not be a “standard” version of Basic. The following keywords are
supported:

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.

So, double, int, and string variables are supported

Line numbers are optional in SBASIC. The are not optional in Mike’s system.

He’s also correct that it’s not a “standard” port, though most features have been incorporated.

@ Mike - You do so well explaining SBASIC…maybe I can get you to do all of Skewworks’ support :wink:

@ Skewworks - turn the power off and then turn it back on

3 Likes

BASIC with floating point, nice :slight_smile:

@ Mike - lol

@ Gus - I believe Basic has always had floating point. originally the first letter of a variable name defined whether it was integer or float. I believe I, J and K were integers.

or was that Fortran?

@ Mike - If I remember correctly in good old GW-BASIC at least, float variables had a ! appended to the name and to force an int it was % and string as $, but the default if not specified was float(???)


P! = 3.1415
N% = 5
S$ = "Hello World"

@ taylorza - I never did much Basic programming.

On second thought, I believe that integer variable names beginning with I…N was a Fortran “feature”.