Nascom Newsletter |
Volume 3 · Numbers 5 & 6 · June 1984 |
Page 15 of 69 |
---|
MOKE is a relocatable USR routine for the Nascom ROM Basic version 4.7 that will display menus, title pages and game graphics held in data lists. The data is formatted using offsets and repeat counters to reduce memory requirements to a minimum. The data is read directly from DATA lists; this avoids the duplication of data that results when using string variables or literals. literals.
The MOKE’s formatted lists are not quite compatible with the format expected by Basic’s READ statement. In choosing the control characters for offset, repeat and terminate – the need for characters that visually indicate their function and not likely to be used in text or graphics was the main consideration. The control characters choosen are:
/ offset
" repeat
! terminate
The " (ditto) repeat control character and the absence of data separators between each character in the MOKE list will cause a conventional READ statement to read a block of MOKE data. In a large block of data, calculation of the number of READs required to skip a section of MOKE data could be a bit tiresome. If each new MOKE list started on a new line, the lists can be selected by using the Restore n statement, where n is the line number on which the list starts. I don’t think there will be many applications where MOKE data lists will need to be read by the READ statement, but if that is required, the MOKE will recognise data separators (though inclusion of them will double the length of your data list) and & could be substituted for " in the MOKE code.
There could have been a fen more features, like repeating blocks of the MOKE list, and fewer compromises; the routine could also have been a lot longer. My maxim is ; Long USRs get filed away, short USRs get used.
Page 15 of 69 |
---|