Index


RISC World

BasicV a Dabhand Guide Part 6

Alligata Media

15 : Miscellaneous Changes

This chapter contains a miscellaneous collection of bits and pieces of information related to BASIC V and its differences from previous versions of BBC BASIC, which could not readily be fitted into any of the previous chapters. If you cannot find what you are looking for elsewhere in this book, then you will probably find it here.

LINE INPUT

The statement line input is entirely equivalent to the existing INPUT LINE. If the input variable is of type string then all the user's input up to, but not including. Return will be assigned to that variable. If the input variable is numeric, then only a single value will be taken from the input stream.

ON and OFF

In the past, several different versions of VDU23 calls were discovered for switching the flashing cursor on and off. Later, with the advent of the Master and Compact, these calls gained respectable legitimacy. BASIC V has taken this process one stage further by providing simple keywords, ON and OFF, to perform this essential function. However, the OFF action is not permanent. As well as reappearing when a mode change takes place, cursor editing will also restore the flashing cursor to the screen.

QUIT

To leave basic and interact with RISC OS directly, use QUIT. Incidentally, to return to BASIC the abbreviation 'B.' will no longer suffice, at least 'BA.' is now needed. Quitting to go to the system can sometimes prove useful. For example, if you attempt to load a relocatable module from within BASIC, you may encounter the message "Insufficient RMA space", but if the RMLoad command is executed from the system the problem is unlikely to arise as, in that context, the configured RMA space limit is ignored.

END

This keyword now has a second purpose, and may be used as a function to return the address of the limit of memory used by a program and its variables. BASIC always maintained this information in a zero page location, but it is now available through END rather than by dubious peeking at the appropriate location.

Mode Changes in Functions and Procedures

Mode changes can now be included in procedure and function definitions without any problems.

Improved PRINT Accuracy

The accuracy has now been improved when using PRINT and STR$ with numbers. For example, 0.05 now prints as 0.05 and not as 5E-2 as was previously the case.

Increased Line Number Range

The maximum line number for BASIC programs has been increased from 32767 to 65279 to cater better for larger programs. In memory, a program now terminates explicitly with two bytes, &0D &FF, whereas any byte with the top bit set would have marked the end of a program previously. Some program binary images created on earlier BBC micros may generate a "Bad program" error when loaded. This can be corrected by using *LOAD and locating and correcting the final byte. This is most unlikely to be a problem for the majority of programs.

Improved COUNT

Tabulation has been improved by using a 32-bit value for COUNT. This function keeps track of the current position within a line of text displayed or printed out.

Syntax Checking on Entry

Lines of BASIC entered with a line number are now subjected to some interactive syntax checking. The checks cover mostly mis-matched brackets, quotes and the like. Any errors detected are reported immediately.

Use of TIME

The use of the pseudo-variable TIME, which uses 4 bytes, particularly when being assigned to, no longer affects the Operating System's own real-time clock, which uses 5 bytes.

Alligata Media

 Index