Log In  

function _init()
    chosen = 1
    cls()
end

function _update()

    cls()
    if chosen==16 then
        print("no-scope mode activated! 🅾️", 12, 1, 11)
    else
        if chosen>9 then
            print("novelty crosshair " .. tostr(chosen) .. " ⬆️/⬇️/🅾️", 1, 1, 10)
        else
            print("crosshair " .. tostr(chosen) .. " ⬆️/⬇️/🅾️", 1, 1, 6)
        end 
    end
    spr((chosen - 1), 60, 60)

    if btnp(⬆️) then chosen += 1 end
    if btnp(⬇️) then chosen -= 1 end
    if chosen>16 then chosen = 16 end
    if chosen<1 then chosen = 1 end

    end
end

With this code, I'm receiving an error at line 23:

SYNTAX ERROR LINE 23 (TAB 0)
 IF CHOSEN<1 THEN CHOSEN = 1 END
<EOF> EXPECTED NEAR END

Isn't the END the EOF?

Note: Edited due to a misspelling. Original:

SYNTAX ERROR LINE 23 (TAB 0)
 IF CHOSEN<1 THEN CHOSEN = 1 END
<EOF> EXPECTED NEAR END
P#128938 2023-04-23 22:28 ( Edited 2023-04-23 22:50)

1

You misspelled THEN as THEEN, which is causing PICO-8 to think the IF.. THEN block is incomplete so it thinks the END is not meant to be there

P#128939 2023-04-23 22:39 ( Edited 2023-04-23 22:40)

@2bitchuck Thanks. Sorry, that was just a misspell because I didn't Ctrl-C then Ctrl-V the error message. I still get the error when it's spelled correctly. Thank you for noticing that!

P#128940 2023-04-23 22:51

Ah, got it. You also have an extra END in there. The one before the END for the function doesn't go with anything, so delete that and you should be fine.

P#128941 2023-04-23 22:58

@2bitchuck Thanks, that fixed it! It was only there to prevent another error that I am no longer receiving. :D

P#128943 2023-04-23 22:59

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 01:31:26 | 0.009s | Q:13