LoginLogin

List of Errors

Root / Submissions / [.]

12Me21Created:

0: (no error)

State of ERRNUM after a program ends without triggering an error.

1: Internal Error

Should never happen.

2: Illegal Instruction

Unknown.

3: Syntax Error

Code can't be interpreted.

4: Illegal function call

An incorrect number of arguments was passed to a function. Sometimes used instead of Type mismatch or Out of range.

5: Stack overflow

Call stack is full. (Usually triggered by doing GOSUB without RETURN or calling a function within itself.)

6: Stack underflow

Should never happen.

7: Divide by zero

Tried to divide by 0 while code is running or during pre-compilation.

8: Type mismatch

When passing arguments of the wrong type to a function.

9: Overflow

Trying to assign a value to an integer that is too big.

10: Out of range

A value passed to a function is outside the expected range.

11: Out of memory

Not enough unused memory to create/resize a variable.

12: Out of code memory

Unknown.

13: Out of DATA

Tried to read DATA when there is none left.

14: Undefined label

Tried to GOTO or GOSUB to a label that doesn't exist.

15: Undefined variable

A variable was used before it was defined with VAR or DIM (or as the input/output to a function). Only happens in STRICT mode.

16: Undefined function

Tried to CALL a function that doesn't exist.

17: Duplicate label

There are multiple labels with the same name.

18: Duplicate variable

Tried to VAR/DIM a variable that already exists.

19: Duplicate function

Tried to DEFine a function when one already exists with the same name.

20: FOR without NEXT

21:NEXT without FOR

Note: Within IF statements, NEXT is treated as CONTINUE and won't trigger this error.

22:REPEAT without UNTIL

23: UNTIL without REPEAT

24: WHILE without WEND

25: WEND without WHILE

26: THEN without ENDIF

Note: Only triggered in multiline IF statements

27: ELSE without ENDIF

Note: Only triggered in multiline IF statements

28: ENDIF without IF

29: DEF without END

30: RETURN without GOSUB

31: Subscript out of range

Tried to access an array/string element that doesn't exist.

32: Nested DEF

DEF was used inside a function definition.

33: Can't continue

Tried to use CONT in direct mode after an error.

34: Illegal symbol string

Passed a string to GOTO/GOSUB that is not a valid label.

35: Illegal file format

Unknown.

36: Mic is not available

Tried to use MICSTART while MIC was turned off.

37: Motion sensor is not available

Tried to use ACCEL, GRYOV, GYROA, or GYROSYNC with MOTION turned off.

38: Use PRGEDIT before any PRG function

39: Animation is too long

Tried to pass more than 32 key frames to SPANIM

40: Illegal animation data

41: String too long

A string that is too long was passed to a function.

42: Communication buffer overflow

MPSEND was used too many times in "a short period".

43: Can't use from direct mode

Tried to use a feature in direct mode that isn't allowed. These are XSCREEN 4, USE, EXEC, DEF, RESTORE, DATA, and READ.

44: Can't use in program

Tried to use a feature in a program that isn't allowed. Only triggered by PROJECT.

45: Can't use in tool program

Unknown.

46: Load failed

Tried to USE or EXEC a file that doesn't exist.

47: Illegal MML

http://smilebasicsource.com/page?pid=797

48: Uninitialized variable used

Tried to set a variable to an undefined value.

49: Protected resource

Unknown.

50: Protected file

Unknown

51: DLC not found

Tried to use a DLC command without purchasing the DLC.

52: Incompatible statement

Use a WII U exclusive feature on the 3DS version or vice-versa.

53: END without CALL

END of user DEF encountered without calling it

54: Array is too large

Array saved with SAVE is too large.

Error 43 (Can't use from direct mode)
<direct mode>
XSCREEN 2
OK
DISPLAY 1
Can't use from direct mode(DISPLAY)
Error 44 (Can't use in program)
<edit mode>
NEW
<direct mode>
RUN
Syntax error in 0:1
Error 31 (Subscript out of range)
<edit mode>
DIM ARRAY[5]
FOR I=0 TO 5
   ARRAY[I] = I
   ?ARRAY[I]
NEXT
<direct mode>
RUN
0
1
2
3
4
Subscript out of range in 0:3
OK
Error 7 (Divide by 0)
<direct mode>
?1/0
Divide by zero
OK
Error 15 (Undefined variable)
<edit mode>
OPTION STRICT
VAR A
VAR B
A=3:B=5
?A
?B
C = A + B
?C
<direct mode>
RUN
Undefined variable in 0:7
It's a compiler error, not runtime

I added (untested) examples for most errors I suspect that stack underflow NEVER happens, since it should be detected as one of the _ WITHOUT _ errors.

Please add error 49: Protected resource

Replying to:snail_
Please add error 49: Protected resource
You asked me to remove it a while ago lol

YOU FOUND AN INTERNAL ERROR IN 0:25(SPANIM) but no seriously i got an internal error i used SPANIM 0,2,"",FILEANIM,0 the code for setting the array was this: DIM FILEANIM[2] FILEANIM[0]=496 FILEANIM[1]=497 then when i run it and get to SPANIM, BOOM INSTANT INTERNAL ERROR! am i supposed to add a timing thing to the array or something?

Replying to:IAmRalsei
YOU FOUND AN INTERNAL ERROR IN 0:25(SPANIM) but no seriously i got an internal error i used SPANIM 0,2,"",FILEANIM,0 the code for setting the array was this: DIM FILEANIM[2] FILEANIM[0]=496 FILEANIM[1]=497 then when i run it and get to SPANIM, BOOM INSTANT INTERNAL ERROR! am i supposed to add a timing thing to the array or something?
You don't have an animation type. See this page for info on how to use SPANIM

Error 35 happens, when you load a map as a graphics page and vice versa. (I encountered this, when I accidentally typed in the name of a file containing map data... in the graphics editor!)

Replying to:IAmRalsei
YOU FOUND AN INTERNAL ERROR IN 0:25(SPANIM) but no seriously i got an internal error i used SPANIM 0,2,"",FILEANIM,0 the code for setting the array was this: DIM FILEANIM[2] FILEANIM[0]=496 FILEANIM[1]=497 then when i run it and get to SPANIM, BOOM INSTANT INTERNAL ERROR! am i supposed to add a timing thing to the array or something?
Internal is a very strange error code to use for this; Illegal animation data is the one that would make the most sense, obviously.

35: Illegal file format The file is in a format that SmileBASIC cannot support (Example: If you put a .EXE (Windows Executable) onto SB and tried to load it.)

Replying to:CyberYoshi64
Error 35 happens, when you load a map as a graphics page and vice versa. (I encountered this, when I accidentally typed in the name of a file containing map data... in the graphics editor!)
So like if you load a DAT as a GRP I assume.

Replying to:CyberYoshi64
Error 35 happens, when you load a map as a graphics page and vice versa. (I encountered this, when I accidentally typed in the name of a file containing map data... in the graphics editor!)
Yeah. This crashes due to using a wrong array with the wrong amount of elements. 524288 elements are needed. A map file is way less than that I guess 'cause GAME3JUMP has a map size of almost 64 KB. I had a GRP file MAP_000 and tried to open it using the map editor and the map editor threw out BAD ID and I had to mash buttons to proceed. This is because of GRP files having too many elements for the map editor to handle for the map draw routine?

I know this is old but GOTO "" triggers Internal Error

With LOAD FAILED, it's not necessarily because the file doesn't exist. Most times I've gotten it are because I told it not to load when the dialog came up, asking if I was sure I wanted to overwrite unsaved data.

Replying to:rando
With LOAD FAILED, it's not necessarily because the file doesn't exist. Most times I've gotten it are because I told it not to load when the dialog came up, asking if I was sure I wanted to overwrite unsaved data.
Oh also, with CONT, there are other instances when it can't be used, like if you use a command like CLEAR or edit the program you are trying to resume before using CONT, and after using STOP.

These are known errors in Japanese wiki. Error 2 Illegal instruction When PRG:TEST isn't empty, in slot 0:
USE 1
GOSUB "1:@1"
in slot 1:
@1
EXEC "PRG0:TEST"
RETURN 'to slot 0
Error 4 Illegal function call
LOAD "NUL"
It also happens with "AUX", "CON", "COM1", "COM2", "COM3" and "COM4". Error 12 Out of code memory (Bug)
DEF TEST OUT
END
It should be Syntax error. Error 15 Undefined variable Tried to use unused variable with VAR.
?VAR("TEST")
Error 35 Illegal file format
EXEC "DAT:TEST"
when DAT:TEST isn't a 2 dimensions array,
LOAD "GRP0:TEST"
Error 45 Can't use in tool program Tried to use a feature in a program running from Smile Button that isn't allowed. Only triggered by COMMON DEF.

Replying to:Na_trium
These are known errors in Japanese wiki. Error 2 Illegal instruction When PRG:TEST isn't empty, in slot 0:
USE 1
GOSUB "1:@1"
in slot 1:
@1
EXEC "PRG0:TEST"
RETURN 'to slot 0
Error 4 Illegal function call
LOAD "NUL"
It also happens with "AUX", "CON", "COM1", "COM2", "COM3" and "COM4". Error 12 Out of code memory (Bug)
DEF TEST OUT
END
It should be Syntax error. Error 15 Undefined variable Tried to use unused variable with VAR.
?VAR("TEST")
Error 35 Illegal file format
EXEC "DAT:TEST"
when DAT:TEST isn't a 2 dimensions array,
LOAD "GRP0:TEST"
Error 45 Can't use in tool program Tried to use a feature in a program running from Smile Button that isn't allowed. Only triggered by COMMON DEF.
He added the errors that are stated as "Unknown" so itยดs not a dumb post.