APPLICATIONSUTILITAIRES RSX/LIGNE DE COMMANDE ★ INSTANT ACCESS ★

INSTANT ACCESS (Computing with the Amstrad)INSTANT ACCESS (Amstrad Action)INSTANT ACCESS (Popular Computing Weekly)INSTANT ACCESS (CPC Magazin)
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

If you've got a disk-equipped CPC and you program in Locomotive Basic, you've got a lot of features available to you in the way of graphics and sound commands that PCW owners and their Mallard Basic don't have. Mallard does have one feature, though, that Locomotive can't match - and that's random access file-handling.

THE PROBLEM

When you want to read files in Locomotive Basic, you can only get at your information sequentially in the order you stored it in the first place, that is. If you've stored 100 phone numbers and want to get at the 50th one, you have to open the file and read in and discard 49 phone numbers to get the one you're after. If you now want to read the 38th number you have to close the file, reopen it and start the read/discard process again.
This is very inefficient, so most people end up just reading the whole file into an array and working on it there. That's fine, so long as you can fit your program and your data into memory in one go. Otherwise, you've got problems.

THE SOLUTION

What you need is a way of getting at the precise piece of information you want without having to plough through all the data up to that point. This is called random access and as I said earlier, Locomotive Basic can't do it. Till now, the answer has been to work in CP/M - both of the CP/M Pascals reviewed this issue offer random access, or if you prefer Basic you could buy a copy of Mallard. That does mean learning a new language, though, or at least a new implementation of Basic.
Now Minerva Systems have come up with a way of getting random disk access in Locomotive Basic. It's called Instant Access and it's a spin off of their successful Random Access Database. They've taken the disk-handling routines out of that and packaged them up as RSXs - functions you can call from Basic by using bar-commands.

THE ROUTINES

There are nearly 40 RSXs in the package, a third of them actually dealing with random access. The key ones are |CREATE to set up a new random access file, |OPEN and |CLOSE for existing files. PRINT to write data and |INPUT to read it.
As with all RSX systems, information is passed to an Instant Access routine as a series of parameters after the relevant bar-command. If you wanted to read a piece of information in from a file you'd opened, you'd give a command of the form '|INPUT,stringname$,number1%,number2%'
Here "stringname$' is a string you've previously defined.

The routine starts reading in characters from the random access file, putting them into stringname$ until it's full. If you've previously defined stringnameS as a string of 10 blanks then, after the routine has done it's job, the string will instead contain 10 characters read in from the file.

The two numbers in the example tell the routine which part of the file you wanted to read from. If you don't bother to give them, the routine will carry on reading where it left off last time - just like a sequential system. |PRINT works in a similar way and, helpfully, can be freely used alongside |INPUT. You don't have to open a file specifically for input or output, in other words: if you read the data and find it needs updating you can rewrite it without the need to close and reopen the file - another advantage over Locomotive Basic.

AMSTRAD ACTION n°12

★ PUBLISHER: Minerva Systems
★ YEAR: 1986
★ CONFIG: 64K ( All CPCs with disk drives )
★ LANGUAGE:
★ LiCENCE: COMMERCIALE
★ AUTHOR(S): ???
★ PRICE: £29.95
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Aucun fichier de disponible:
» Vous avez des fichiers que nous ne possédons pas concernent cette page ?
★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Applications » Routines du C.C.C : RSX Modeur (CPC Infos)
» Applications » RSX Bank-Dump (Schneider Magazin)
» Applications » RSX Function Key Lister (Popular Computing Weekly)
» Applications » PRINT wird dreimal schneller
» Applications » RSX Varlist (Computer Technik)
» Applications » RSX Deconvert
Je participe au site:
» Vous avez des infos personnel, des fichiers que nous ne possédons pas concernent ce programme ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop
Page créée en 113 millisecondes et consultée 3688 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.