80-Bus News |
May–June 1983 · Volume 2 · Issue 3 |
Page 13 of 59 |
---|
[Editors’ note:
When Dr. Coker’s article was first submitted I pointed out to him that this
represented an article on ‘How to use a ripped off MBASIC’, a practice 80-BUS
News could not condone. Dr. Coker agreed that in that light, I could edit it in
any way I wanted. However, on re-reading the article, I gleaned so much from it
that I consider it a very good commentary on the MBASIC manual (which I thought I
had read thoroughly). In the end, I find I have done very little of the scissors
job on the article that I threatened. I am unable to tell which version of MBASIC
Dr. Coker is using, my guess is version 4.x, I have noted several descrepancies
between this and mine which is version 5.21, dated mid 1981. D.R.H.]
Microsoft BASIC is available in a number of versions which differ mainly in the number of features which they have available and the medium in which they are supplied. Perhaps the commonest form is the 8k ROM BASIC which is supplied as standard on the Nascom 2 and several other machines, but increasing numbers of 80-BUS users have the disk-based version which offers many additional facilities. The purpose of this note is to provide a simple guide to some of the more useful features which may be of interest. In this article, MBASIC refers to the disk version of Microsoft BASIC; BASIC refers to other versions.
MBASIC has been available for several years and is regularly updated. Users who have experience with BASIC on mainframe computers will find that most of the statements, commands and functions with which they are familiar are identical in use, or at worst only marginally different. There is also a wide range of facilities not usually found in mainframe BASIC implementations. The ‘SAVE’ command is a little more awkward to use and there are no matrix-handling (MAT) statements. Alcock (1977) in his book ‘Illustrating BASIC’ shows how these can be programmed in the absence of MAT instructions.
Having loaded MBASIC and achieved the ‘sign-on’ message, MBASIC will display the amount of free memory you have at your disposal: MBASIC occupies about 28kbytes and a 48k or 64k system is recommended. Following the ‘sign-on’, the prompt, ‘Ok’ is displayed.
In common with most computer software documentation, the MBASIC manual is not particularly ‘user friendly’ on first reading. Quite full explanations of the commands, functions and statements are given, but it is not designed for the beginner who can easily become confused by the intricacies of, for example, file handling using random-access files. Some users will have lost, or never had a manual (whoops!).
There are, in general, no hard and fast distinctions between statements and commands in MBASIC and in many cases, commands can be executed as part of a statement and vice versa – experience will show when you can’t!
The following is a resume of some of the commands and statements first time users or users converting from Nascom BASIC (or other BASICs) will not necessarily be familiar with. The more usual commands and statements such as LET, FOR –– NEXT, etc, I take as read and well understood. In the lists of commands and statements which follow, square brackets enclose optional parts and < and > signs enclose parts which the user has to supply.
This is a remarkably useful command for automatically generating line numbers; to use it, type:
AUTO [<initial line>[,[increment]]:
e.g. AUTO 100,10 will generate line numbers from 100 in increments of 10.
AUTO will provide a line number after every <cr> until-Control-C (^C) is typed. If the initial line is omitted from the command, it is assumed to be 10 and this is the default value for the increment. If AUTO generates a line number that is already in use, the line number is followed by an asterisk to warn you that any input will replace the existing line. This can happen after an editing session – with unfortunate consequences!
Page 13 of 59 |
---|