Description
PRINT is a command used in SmileBasic to output text onto the N3DS screen. Each PRINT command used in your program will output a specified amount of text onto the screen (top by default).
The PRINT command will output any string, either stored in a variable, converted to by STR$(), or simply a string in the format of NAME$. The PRINT command can also be shortened to ?. This was used a lot in Petit Computer for faster interpretation speed.
At the end of every PRINT command, there's an imaginary command to print a new line. Thus, if two PRINT commands are used together, they will output on two different lines.
Advanced Use
If you wish to print multiple kinds of strings on one line, you can use the addition operator (+) to combine the strings. Additionally, you can add a semicolon (;) to the end of a PRINT command to prevent a new line from automatically being created.
Program Example
Outputting a string enclosed in quotation marks.
PRINT "Hello, world"
'Output on screen:
'Hello, world!
Outputting a string in the form of NAME$.
MYSTRING$="Testing"
PRINT MYSTRING$
'Output on screen:
'Testing
Outputting a string converted to by STR$().
MYVARIABLE%=5
PRINT STR$(MYVARIABLE%)
'Output on screen:
'5
Combining strings.
NAME$="Joe David"
PRINT "Hello, "+NAME$+"!"
'Output on screen:
'Hello, Joe David!
Use of the newline prevention character and ? alias.
PRINT "This is all ";
PRINT "on one line."
?"But this is on a second line!"
'Output on screen:
'This is all on one line.
'But this is on a second line!