BASIC-DOS

A PCjs Retro-Programming Project

BASIC-DOS is on Twitter Project maintained by jeffpar

BASIC-DOS Manual

BASIC-DOS BASIC Commands

LET

The LET statement assigns the value of expression to variable:

[LET] variable=expression

Values cannot be assigned to predefined variables (eg, ERRORLEVEL and MAXINT).

Within BAS and BAT files, the LET keyword is optional (eg, A = 1). At the prompt, however, LET is required, since a name typed at the prompt would otherwise be treated as the name of a program to run.

If the expression and variable are different numeric types, the value is converted to the variable’s type; floating-point values assigned to integer variables are rounded (eg, LET A% = 2.5 sets A% to 3).

Example:

LET A$ = "HELLO":LET N = LEN(A$) * 2
PRINT A$; N
HELLO 10

« IFRETURN »

Copyright (c) 2020-2026 Jeff Parsons Released under MIT License