Introduction to mvBASIC

The Development of mvBASIC

The mvBASIC Language is an extended version of Dartmouth BASIC, specifically designed for data base management. Developed at Dartmouth College in 1963, Dartmouth BASIC is a language especially easy for the beginning programmer to master.

Consequently, practically every programmer today knows at least a little BASIC; therefore, because of its similarity to BASIC, mvBASIC is instantly familiar to almost every programmer. In addition, mvBASIC it is infinitely more flexible and more powerful than Dartmouth BASIC.

mvBASIC Enhancements

Some of mvBASIC’s enhancements, which represent improvements over Dartmouth BASIC, are listed here to suggest what mvBASIC can accomplish.

Program Format

Statement Labels

In Dartmouth BASIC, numeric statement labels are mandatory for each line of source code. The statements are stored according to their statement labels, so they are not executed in linear sequence (that is, according to where they appear in the source text), but in numeric sequence.

In mvBASIC, statements are executed in the order in which they appear. Statement labels are not mandatory for each line. Furthermore, statement labels do not have to be numeric: alphabetic and alphanumeric labels are also supported, with the provision that the label must end with a colon (:). A particularly useful feature is that there is no limit to the length of a statement label, as long as the file item does not exceed 248K.

Multiple Statements

mvBASIC allows several statements to be written on the same line of source code, as long as they are separated by a semicolon (;).

Variable Names

Variables can have any name of any length, as long as the file item does not exceed 248K.

Fixed Point Arithmetic

Computations are done with fixed-point arithmetic, with 19-digit precision and up to 9 decimal digits.

New Features

O/S Interoperability Commands

This is one major and unique feature of mvBASIC. O/S interoperability commands are executable from within mvBASIC, and enable the user to execute Windows programs and/or to access Windows files.

Dynamic Arrays and String Handling

Since string manipulation is primary to the mvBase system, string functions are key to the structure of mvBASIC. File items are read as dynamic array strings in an mvBASIC program, with each line of text separated by an attribute mark. String functions range from locating a substring or specifying a range of characters, to the powerful dynamic array functions for extracting, replacing, deleting, or inserting a specified field in the array.

Screen Manipulation

The @ function in mvBASIC provides a wide range of terminal control sequences. Using these sequences, full formatted screen programs can be produced.

Communications

mvBASIC includes several statements designed for communication programs on the mvBase system. Data can be sent to or taken from any remote line.

External Subroutines

External subroutines can be executed in mvBASIC with the CALL statement. In addition, any TCL command can be executed with the EXECUTE statement, and its output and error messages can be captured for use in the program.

Dimensioned Array

In mvBASIC, dynamic arrays can be converted into dimensioned arrays, and vice versa. Programmers therefore have the freedom to choose the data form that is most efficient for their applications.

Item and Execution Locking

File item locks and execution locks in mvBASIC can prevent multiple users from accessing the same data or executing the same subroutine at the same time.

Tape or Floppy Disk I/O

mvBASIC provides statements for directly reading and writing magnetic tapes or floppy disks within the program.

This guide aims to teach the mvBASIC programming language to a beginning user, assuming that the user is familiar with some programming concepts and techniques and also with the structure of the mvBase system. The reader does not have to be an experienced programmer in order to learn mvBASIC from this guide.

The following reading sequence is recommended:

Creating mvBASIC Programs

Describes how programs are created. It goes into more detail than the average beginner requires, so most readers may skim it for the general concepts and return to it for details as necessary.

Format, Data and Expressions

Describes program format, data types, and the syntax for expressions. It should be read carefully.

Overview of mvBASIC Statements and Functions

Provides a tour of the mvBASIC language. Every statement and function is covered by topic and should be read very carefully. It is recommended that readers stop periodically, perhaps after every subsection of Overview of mvBASIC Statements and Functions to try the material just covered. Statement and Function Reference can be used for reference at this stage.

After studying the sections on Creating mvBASIC Programs,  Format, Data, and Expressions, and Overview of mvBASIC Statement and Functions, readers should be ready to start writing programs, using the section Statement and Function Reference as a reference.

Readers should refer to Using the mvBASIC Debugger to learn how to debug their programs. This section contains a tutorial and a reference. There are few Debugger commands, so each may be studied and experimented with as the reader proceeds.

Appendix A: Error Messages

Lists error messages which may be encountered while creating programs.

Appendix B: List Of ASCII Codes

Provides a list of ASCII codes, which are often necessary for using the CHAR or SEQ functions.

Appendix C: mvBASIC Program Examples

Provides several example applications for users to study or copy.

See Also

mvBase mvBASIC User Reference Guide Overview

Syntax Notations

Creating mvBASIC Programs

Format, Data and Expressions

Overview of mvBASIC Statements and Functions

Using the mvBASIC Debugger

Statement and Function Reference

O/S Interoperability Commands

Appendix A: Error Messages

Appendix B: List Of ASCII Codes

Appendix C: mvBASIC Program Examples