Addition and subtraction in Small Basic web IDE text string calculates?!

StephenDx 51 Reputation points
2020-10-16T04:34:10.283+00:00

In the Small Basic web IDE, the following code outputs numbers on the left of the "=" rather than an expected string showing the calculation. Is this a bug or have I formulated my strings incorrectly?

 a = 6 
 b = 3 

 result1 = Text.Append(a, " + ") 
 result1 = Text.Append(result1, b) 
 TextWindow.WriteLine(result1 + " = " + (a + b) ) 

 result2 = Text.GetSubText(a, 1, 1) + " + " + Text.GetSubText(b, 1, 1) 
 TextWindow.WriteLine(result2 + " = " + (a + b) ) 

 sum = Text.Append(a, " - ")
 TextWindow.WriteLine(sum + b + " = " + (a - b) ) 

The result (not expected) from the web IDE is (https://superbasic-v2.azurewebsites.net/):

63 = 9
9 = 9
-3 = 3
Program has ended.

The result with the same code in the desktop IDE is as expected (Microsoft Small Basic v1.3 at time of writing):

6 + 3 = 9
6 + 3 = 9
6 - 3 = 3
Press any key to continue...

Multiplication ( * ) and Division ( / ) in both IDE's behave as expected.

Small BASIC
Small BASIC
A programming language created by Microsoft that serves a stepping stone for beginners from block-based coding languages to more complex text-based languages.
277 questions
0 comments No comments
{count} vote

1 additional answer

Sort by: Most helpful
  1. Nonki Takahashi 676 Reputation points
    2020-10-17T02:00:08.083+00:00

    Hi @StephenDx , thank you for your report. I will add this issue to GitHub. This is a new issue.

    1 person found this answer helpful.
    0 comments No comments