Compute!

Page 66

(such as word processors) let you do this from â– loading programs is a one-way street. The real

value of a disk drive is that it can hold volumes of your information, not just prepared material. The disk drive is a mass-storage device. Like RAM

memory, you can read and write to it. The disk is slower than RAM, but is usually larger (170K ver sus 3.5K on a VIC!). If you read last month's installment, you'll remember that the simplest access is at the sector

within the application, but you will usually do this from BASIC. A blank disk straight out of the box is not ready for your disk drive. The disk drive docs not know where to find the tracks and sectors, since

the diskette is just a circular piece of magneticcoated material. The disk drive must organize the disk into tracks and sectors by writing timing in formation all over it. This is in addition to whatever

level. You can read and write blocks of 254 char

data you want to put on the disk. "Format" is the

acters. It's as difficult as it sounds, but fortunately, you should never have to use the disk at such a primitive level. Instead, your computer and disk

best description, but some people use the term

NEW {as in wiping out a BASIC program), Header (like putting a title on a disk), or Initialize (prepare

to 254 characters. It's just a long sequence of num

You should know what these people are talking about when they use the other terms, however.

drive work together as a team to let you create files. it for first use). Unfortunately, these terms also have other definitions, so they can be confusing. A file is a hunk of information, not restricted bers. Files can also hold characters, since charac ters can be represented by numbers, too. A file might be a program, a list, a letter you typed on a word processor, or just raw data. Every file has a name, so to access the file, you just give the disk drive its file name.

A filename can be almost any sequence of

characters, including the alphabet, graphics characters, punctuation, etc. The filename can

be up to 16 characters long. These are valid filenames: "PROOFREADER", "3D DEMO", "SUPERCHASE!", "DDOUBLETTAKE". Some characters are reserved, such as the asterisk and

the question mark. These are used as wild cards. The question mark is used like the joker is in some card games. When searching for the filename on the disk, the disk drive compares the name you give it character by character with all the names on the disk. The question mark lets you allow for some ambiguity. If you are not sure about

the filename, for example, you can substitute question marks for the characters you're not sure about. If you think the name might be "TRIX" or "TRIP", you can use the filename "TRI?". If you are searching for something like "HAPPY FACE" or "NAPPY-PACE" you can use "?APPY??ACE". In practice, the question mark isn't all that useful, as these contrived examples show. Far more useful is the asterisk, ft lets you

leave off characters. For example, "BAS*" will match with "BASIC AID", "BASEBALL", "BASH", etc. The asterisk alone will match with anything, which is why you use it to load the first program on the disk, since the asterisk will match

To send commands to the disk, you have to

open a command channel. Bear with us, because the procedures are very technical-looking. You can memorize what you need to know, but in

future installments of this series, it will all become clear. To get ready, you need to enter: OPEN 15,8,15

This tells the computer you will use the number 15 (the first number) to talk to the disk drive, device number 8. The last number, also 15, is

for the disk's sake. It tells the disk that the things you send it are commands, not data. All the com mands are sent with the PRINT# statement (pro

nounced "PRINT-file"). Unlike the other BASIC PRINT command, you cannot use the question mark as an abbreviation for PRINT# (?# does not work). Instead, use P-SHIFT-R to abbreviate PRINT#. (For more information on abbreviations,

see this month's "Horizons: 64.") The format statement looks like this: PRINT#15, "N:DISK NAME, ID"

The N stands for NEW, which is the word Commodore uses for format. You can even spell it out: PRINT#15, "NEWrDISK NAME, ID"

This command completely erases a disk as it formats, so use it with caution. The colon (:) sepa

rates the command from the parameters that the command needs to function. The disk name uses

the same format as the filename, and can be any

cently accessed, not just the first file the disk finds. We'll talk about other variations on filenames

thing you choose. You should organize your disks. Don't just randomly place any file on any disk. Have a disk for games, a disk for utilities, a disk for your BASIC programs, a disk for your word

later.

processor, and so on. This makes it so much easier

Btefore you can write to a disk for the first time,

organizing when you first get started. The disk

with the first thing it finds. Incidentally, the as terisk alone will also find the filename most re

you must format it. Some application programs 64

COMPUTEIS Gazelle

December 1983

to find the right disk, and you might as well start name should describe what the disk will store.


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.