# Batch Basic 2 quick reference Strings are delimited with double quotes; no escape characters. Identifiers are alphanumeric and start with a letter. Keywords and identifiers are case-insensitive. TRUE and FALSE are parsed as -1 and 0, respectively. ## Statements None of the statements are privileged, but some are defined only in stand-alone and/or interactive mode. ### Essentials REM text PRINT [string | expression [, | ;] ...] LET variable | array[index] = expression INPUT [string ,] variable [, variable...] ### Control structures IF condition THEN statement [: statement...] TEST condition IFTRUE statement [: statement...] IFFALSE statement [: statement...] WHILE condition ... WEND FOR variable = start TO limit [STEP step] ... NEXT [variable] REPEAT ... UNTIL condition DO variable = start, limit [, step] ... DONE ON expression GOSUB name [, name ...] ### Subroutines SUB name ... RETURN [CALL] name (CALL can be omitted if the subroutine name is alphabetic.) ### Miscellaneous DATA value [, value...] READ variable [, variable...] RESTORE index POKE index, value RANDOMIZE [seed] DIM array[size] REDIM array[size] ERASE name [, name...] OPTION EXPLICIT ### Stand-alone mode only MERGE filename QUIT ### Interactive mode only LOAD filename CLEAR NEW DELETE subroutine LIST [subroutine] SAVE filename ## Functions * ABS(n), SGN(n), INT(n), SQR(n) * PI(), SIN(), COS(n), DEG(n), RAD(n), HYPOT(a, b) * MIN(a, b), MAX(a, b) * E(), EXP(n), LOG(n) * PEEK(n), RND(), TIMER()