APPLICATIONSDIVERS ★ RANFILE: Filling a gap in Amsdos ★

Ranfile (The Amstrad User)Applications Divers
★ 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 ★ 

As a teacher who has been working in the field of microcomputers for some 7 years, and an owner of an Amstrad 6128 since their introduction, I would firstly like to say that I find this machine to be very good value for money, and a computer I recommend highly to my students.

However, I have always felt that Amsdos has one or two omissions without which the disc drives are not much better than high speed cassettes. Perhaps the most serious of these is the lack of random access files. Here is a lisi of my program 'RANFILE" which is an attempt to remedy this situation, a Basic program to generate the binary file "RANFILE.BIN". The program resides at &9000 and is loaded as. follows:

MEMORY &8FFF LOAD"ranfile.bin" CALL &9000

There after the program can be invoked via 5 RSX commands. These are:

  • |OPENRAN,"filename" - this command opens a 32k file of the given name for use. Data in the file is not lost and if the file docs not exist it will be created. Note that a file extension is not required - indeed, if one is supplied, it will be overwritten with the file extension RAN
  • |FIELD,x - this command divides the file inlo 'fields'of a size x. The value of x must be a factor of 512, ie. 1,2,4,8,16...512 so that there is an integral number of fields per sector.
  • |PUT,string,x - this command puts the string into field x. Note that the length of the string should be of the length given in the field command, padded as required.
  • |GET,stringvar,x - this command gets the string from field x. Note that the length of the string should be preset to the length given in the field command.
  • |CLOSERAN - this will save the last PUT data to disc and tidy up the 'house -keeping'. Note that the file name can be given if desired, but is not necessary.
I have incorporated some error trapping into the routine, so that common errors such as FIELDing an unOPENed file, or CETling from an unFIELDed file, for example, can be trapped, as can using the wrong number of parameters.

TAU

★ PUBLISHER: The Amstrad User (Australia)
★ YEAR: 1987
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ AUTHOR: Martin Kimber
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listing:
» RSX-ranfileDATE: 2013-05-15
DL: 227
TYPE: PDF
SiZE: 435Ko
NOTE: 2 pages/PDFlib v1.6

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
Je participe au site:
» Pour ce titre nous ne disposons de fichier executable sur CPC (Dump, Saisie du listing) , alors si vous avez ça dans vos cartons ou vous désirez usé vos petit doigts boudinés sur votre clavier faites le nous savoir.
» Vous avez des infos personnel ?
» 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/c
Page créée en 207 millisecondes et consultée 1453 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.