Write text, quotes and comments
THE BASIC LANGUAGE
A line of story text often contains punctuation BASIC also uses. A sign that reads “Closed” is a good example.
FUNCTION Run()
REM A notice painted on the wall.
DIM notice = "The sign reads ""Closed""."
' Keep the punctuation when adding the second line.
RETURN notice & "\n" & "Come back at dawn."
END FUNCTIONThe outer double quotes mark the start and end of a string. Two double quotes inside that string produce one visible quotation mark. An apostrophe starts a comment outside quoted text. REM at the start of a line also marks an author’s note.
Read the result#
The sign reads "Closed".
Come back at dawn.The backslash and n inside the string produce a newline. The ampersand joins the pieces. Keep straight double quotes in code, even if your word processor prefers curly ones.
Keywords and BASIC identifiers are case-insensitive. TRUE and true mean the same thing. Text inside quotes keeps its spelling and capitalization. Copy project IDs and named action fields exactly as shown by the editor.
