LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

INPUT to an undefined variable

Root / General / [.]

12Me21Created:
Normally, functions determine the type of the OUT variables when you first set their value:
DEF TEST OUT A
 A="Hi" 'now A is a string
 A=3 'this causes a Type mismatch since A is a string now
END
However, if you first use the variable in INPUT...
DEF TEST OUT A
 INPUT A
END
Inputting an integer causes A to become an integer, a float causes A to be a float, and inputting a string causes it to become a string. Inputting nothing causes it to stay undefined, since INPUT doesn't touch (or even check) the variable if you input an empty string.