Using The Bank Manager For String Storage - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

The contents of Screen 1 are copied into Screen 2. If you reverse the parameters by
typing:
MODE 1
ISCREENCOPV,1,2
.... the contents of the currently displayed screen are overwri tten from screen 2.
So the first parameter is the screen to copy to; the second parameter is the screen to
copy from.
When copying screens, note that you will produce a disjointed display if the screens'
MOD E
s are different, or if the viewing screen has been 'scrolled' since the last
MOD E
command. The BANK MANAGER's screen commands are intended for use with
pictorial screens rather than text screens, as scrolling is less likely to have occurred.
Using the BANK MANAGER for String Storage
There are four more commands provided by the BANK MANAGER, which allow the
use of the additiona164K of memory as a filing system for string variables.
Most programs can be divided into two parts: firstly, the actual program instructions,
and secondly, the data that the program uses. A good example of this is a database
program such as an address book. Such a program would use an array of strings to
store the names and addresses ofthe people listed in the book.
Strings can be stored in the second 64K of memory, one after another, end to end. The
memory that the strings are stored in can be divided into compartments, which are
called records. A record can be of any fixed length between 2 and 255 characters,
whereas the length of a string in BASIC varies according to its contents. The purpose
of a record is to provide standard sized compartments, like a set of pigeon holes, in
which to store the untidy string information. Each operation to store or retrieve data
from a record is automatically followed by a step to the next record, ready for the next
operation. The record to be used for the next operation is called the 'current record'
and will be used automatically unless a different record is specified.
We call this system of memory management a 'RAMdisc'. This is because it operates
in a similar way to random access disc systems, but using RAM instead.
Read the following descriptions of the various commands so that you understand
what each command is for, ifnot how to use it, then go on to tryout the examples.
The first of the RAMdisc commands is
I BAN KO PEN.
This command specifies how
many characters of string information each record can contain. Its syntax is:
IBANKOPEN,n
Where n is a number specifying the amount of characters in the record. The value n
can be in the range 0 to 255, but values of 0 and 1 will have strange effects.
Chapter 1 Page 86
Foundation Course

Advertisement

Table of Contents
loading

Table of Contents

Save PDF