BASIC-PLUS is patterned closely on later versions of
Dartmouth BASIC, including its powerful MAT commands. On top of this, DEC added a number of unique flow-control structures.
Editing Line numbers were positive integers from 1 to 32767. Logical lines of code could be continued on multiple physical lines by using a
line feed at the end of a line instead of the normal
carriage return character. For ease of external editing of the source file, later versions of BASIC-PLUS also allowed the character as a line continuation character. Multiple statements could be placed on a single line using as the statement separator. The system allowed tabs to be used as inline whitespace, and was used to make loops more clear, as in modern languages. Comments used either the keyword or the character, as opposed to MS BASICs, which used and .
Standard statements The command divided the screen into regions 14 spaces wide, and the comma was used to move between these locations; would output 1, 2 and 3 in a spaced-out fashion, while would leave a single space and produce "1 2 3". allowed a prompt string to be specified, but used the semicolon to separate it rather than the comma; Strings could be delimited by single or double quotes. In addition to the and functions that converted single characters to and from string format, BASIC-PLUS also supported Dartmouth's command. iterated the string and returned each character's ASCII value as a slot in a numeric array. For instance, would return an array with the five ASCII codes, 110, 105, 114, 114, 105, in elements 1 through 5, and the number 5, the length of the string, in element 0. One could reverse the operation as well, would read the individual numbers in the X array and convert it to a string.
Statement modifiers BASIC-PLUS added the concept of "statement modifiers",
JOSS-like conditions that could be applied to any statement. For instance, is the equivalent of The opposite was also provided, was the equivalent of . loops worked as in other versions of BASIC, and the command could not be used in an expression to exit early. Instead, the and keywords could be used to control early exits. For instance, continue looping until I=10, with the assumption that following code would set the value of I, meaning it might not exit after 10 iterations but as soon as the code set I to 10. Modifiers could also be used to build compact one-line loops, for instance, would loop until X was 100.
Variables, expressions and matrixes Variable names in the early versions of BASIC-PLUS could be a single letter or a single letter followed by a single digit. With the inclusion of "Extend mode" in later versions, variable names could be up to 29 characters long, and dot (.) was added as a permitted character. Every variable name still had to begin with a letter. As in most versions of BASIC, the keyword, for variable assignment, was optional. It could set multiple variables to a single value, like . The language supported three data types; floating-point numbers, integers, and strings. Variables with no suffix were floating point (8 bytes, range 0.29 to 1.7, up to 16 digits of precision). Integer variables (16-bit, range −32768 to +32767) were indicated with a suffix, string variables (variable length) were indicated with a suffix. The list of mathematical and logical operators was typical of most BASICs, with some extensions. For math, , , , and were supported, along with as an alternate form of for
computer terminals that might not have that character. Standard logical comparisons were , , , , , and . One interesting addition was the operator, for "approximately equal". This would return true if the two numbers would be printed the same, that is, their six most significant digits were the same. Logical operators included the typical , and , along with , which return true if both A and B are true or both are false, and which is false if A is true and B is false and otherwise always true. The statement could allocate one-dimensional and two-dimensional arrays of any of the three data types. The range of subscripts always began with 0 (but statements did not set elements in row 0 or column 0). The language also included a number of commands to work with the entire array (or MATrix). The command would fill the matrix with values in a statement, would fill the array with user-typed values, and would print out the elements in a 1D or 2D format. could also be used to set default values in a matrix using associated keywords, for instance, would fill the A array with zeros. would transpose an entire matrix, and would invert it. Additionally, , , and could be used on matrixes, performing the associated matrix operation.
File processing The "virtual DIM" statement could map "virtual data array(s)" or "virtual array(s)" to a disk file, which allowed arrays larger than the computer's available memory (or even its address space), and allowed use of array elements to read, write, and extend disk files (persistent storage). They called this arrangement "virtual data storage" and "virtual core", but it did not use the modern approach of allocating the arrays and a
memory-mapped file. Instead, a single buffer was used to store 512 bytes of data at a time, and when an entry in the virtual array was accessed, the corresponding data was read, and old data written, as required. The statement caused the buffer to be written back (if necessary) before closing the file. Because no additional sectors were cached, accessing data in the "wrong" order could multiply the number of disk accesses. Additional rules were imposed on virtual arrays, such that one datum could never span a record boundary: Each data type was aligned to a multiple of its size. Virtual strings were stored as fixed-length ASCIIZ data, with sizes restricted to 2, 4, 8, 16, 32, 64, 128, 256, or 512 bytes, and were accessed using and . ==Virtual machine==