LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

I'm trying to port an old bit of code from a magazine. Need Help.

Root / Programming Questions / [.]

twadepsvitaCreated:
I've been trying to use some code from an old issue of CVG Magazine. Their type-ins were pretty much in BASIC, but they all contain numbers at the start. For the most part they are multiples of 10, but later down the line, they start to be other numbers. When I've tried to use these numbers to copy in some test programs, they won't run, but if I put the test programs in without numbers, they work. How do I get the code to work in SmileBASIC?

Those numbers are line numbers. Ignore them. Other dialects of BASIC are not guaranteed to work with SmileBASIC's interpreter, however, and you may run into some problems trying to use some of those directly.

Replacing line numbers with @labels should work. For example:
10 PRINT "HI"
'
@10:PRINT "HI"
and fix GOTOs:
10 GOTO 20
'
@10:GOTO @20