Faulty BASIC interpretter in Repl

I am looking for an online classic BASIC interpreter. I created a repl using the BASIC language but it does not work correctly.

Repl link:

10 PRINT "Hello world."
20 FOR X = 1 TO 10
30 PRINT X
40 NEXT X
50 END

This outputs:

Hello world.
1
2
3
4
5
6
7
8
9

Note that 10 is missing,

Any ideas?

:wave: Welcome @rupertsmith!

That’s a BASIC interpreter built by Amjad (the CEO of Replit), so it may not be perfect.

I’ve just quickly made a template which uses a better BASIC interpreter: https://replit.com/new?template=2082caf5-a9d1-4093-b06d-cd9af4604162

1 Like

Very cool. I’m new to replit.com, so I was unaware that you could make a template.

Thank you.

1 Like

Well, it’s not an official template, so it won’t come up if you search for it at https://repl.new.

If my post answered your original question, please mark it as the solution.

3 Likes

Well, it would be nice to have an interpreter that uses line-numbers, but I’m happy to mark this as resolved - I’ll see what other options I have.

1 Like

In that case, you could Run the program, and instead use the Console to code. It won’t save it to the file, but I think it’s more similar to what you’re looking for.

I’m not sure why you want to add line numbers to the file, that is not necessary in an IDE, as you can see the line numbers on the left side of the code editor.

Call me old fashioned. I have some really old classic BASIC code that still uses line numbers for reference: GOTO 220, GOSUB 400, that kinda thing. Now, I could convert that to use labels and not line numbers, but I don’t want to right now - I want to run that old code as is. I have local BASIC interpreters that can do that, but I was hoping for something in the cloud. Look like I will have to use QuiteBASIC instead.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.