Inliner: BASIC with DEFINEs and without line numbers

By DamnedAngel

Champion (286)

DamnedAngel's picture

29-12-2017, 13:06

Hi all,

just to let you know that Giovanni Nunes has just released Inliner on Github, a nice tool in Python that converts your indented, line-numberless BASIC listing with DEFINEs to a traditional BASIC listing.

Example of usage (as provided by Giovanni):

An original program like this...

'' Kaleidoscope (MSX2 256 colors)

' define WIDTH 255
' define HEIGHT 211
' define MAXCOLORS 256

COLOR 15,0,0
SCREEN 8
I%=RND(-TIME)

main_loop:
    FOR I%=0 TO {{WIDTH}} STEP 2
        ' pick up a color
        K%={{MAXCOLORS}}*RND(1)
        ' left side
        LINE (0,0)-STEP(I%,{{HEIGHT}}),K%
        LINE (0,{{HEIGHT}})-STEP(I%,-{{HEIGHT}}),K%
        ' right side
        LINE ({{WIDTH}},0)-STEP(-I%,{{HEIGHT}}),K%
        LINE ({{WIDTH}},{{HEIGHT}})-STEP(-I%,-{{HEIGHT}}),K%
    NEXT I%
    GOTO {{main_loop}}

... becomes this:

10 ' Kaleidoscope (MSX2 256 colors)
20 COLOR 15,0,0:SCREEN 8:I%=RND(-TIME)
30 FOR I%=0 TO 255 STEP 2:K%=256*RND(1):LINE (0,0)-STEP(I%,211),K%:LI
NE (0,211)-STEP(I%,-211),K%:LINE (255,0)-STEP(-I%,211),K%:LINE (255,2
11)-STEP(-I%,-211),K%:NEXT I%:GOTO 30

Articles (in Portuguese) here and here.

[]s

Login or register to post comments

By Manuel

Ascended (19685)

Manuel's picture

29-12-2017, 13:25

A bit like NestorPreter?

By PlainSpooky

Resident (53)

PlainSpooky's picture

29-12-2017, 13:47

Yes, but in a more agnostic approach and to be used in any BASIC dialect without many changes on language's syntax.

By DanySoft

Champion (452)

DanySoft's picture

06-01-2018, 21:18

Mmhh... the double "{{" / "}}" ...
I do not like this!
I prefer to use "NestorPreter" or "tabmegx"!! Smile

DanySoft