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 |
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
@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!
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.
@2bitchuck Thanks, that fixed it! It was only there to prevent another error that I am no longer receiving. :D
[Please log in to post a comment]