There have been many lazy people, who think that declaring variables sucks and makes everything harder; even though it does suck, it also doesn't. Here OPTION STRICT will be explained. The people shall not be lazy, by being lazy. The whole world will rejoice because of OPTION STRICT, the command lazy people hate.
Now, everyone uses variables. They store data and make games playable. This is not a variable tutorial, so anyone wondering about those go through randomouse's tutorials. Anyway, with variables, anyone can make bad to ok software. But not everyone is perfect. Everyone who types makes errors in typing. Most don't notice their error, so it doesn't get fixed. Now, this can get messy, especially with variables. When a variable is created, it defaults the variable as 0, unless it's a string, in which case it is just "", or empty. So, when a variable is declared, it needs to be set, or it can be set later with the = sign. But when you make a typo, you might have set
VARIABLE% and accidentally used
VARI%. It doesn't recognize this variable. Now, if OPTION STRICT isn't used, it'll just make a new variable. This variable is gonna be 0, because the program just made a new integer. If
VARIABLE% had previously been set as 5, there would be a problem where
VARI% was used. If this was in your code:
?"A"*VARI%
there would be a problem. It should have put
AAAAA
assuming
VARIABLE% was set to 5. But
VARI% was put. This is where OPTION STRICT helps. In bigger programs, it can be hard to find these errors. This is because SmileBASIC doesn't tell the user that something is wrong. SmileBASIC doesn't know something is wrong. So when you use OPTION STRICT, SmileBASIC gives an error and the user can go back to fix it really fast. OPTION STRICT tells the user about the variable that doesn't exist, so that it can be fixed.