CODINGLISTINGS ★ FILER (COMPUTING WITH THE AMSTRAD) ★

Filer (Computing With the Amstrad)Coding Listings
★ 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 ★ 

THIS month's program shows how simple it is to save data to a file on cassette or disc and then read it back.

  • 10,20 The usual REMs.
  • 30 Prints a message telling you the data is about to be stored. This is needed as disc systems give you no message and you may think nothing is happening. Tape systems, of course, prompt you to press the play and record keys on the recorder.
  • 50 This opens a pathway from the program to the cassette or disc allowing data to be stored in a file. In this case the file is called file. Try out other names.
  • 60-90 Make up a FOR ... NEXT loop which reads in the data and sends it out to the file. When you understand the program try getting the loop to cycle twice or four times and see what happens.
  • 70 Reads in the data, storing it temporarily in the variables name$ and number. In this case the information comes from a data statement, but it could be from other sources such as the keyboard.
  • 80 WRITE #9 causes the information in the following variables to be sent to the cassette or disc. The first time round the loop it will be Tom and 1, the second time, Dick and 2.
  • 90 The loop finishes after three cycles, having read in all the information from the data line. Can you change this to a WHILE ... WEND loop that reads the information until a flag value occurs?
  • 100 Sends a string to be stored in the output file.
  • 110 Closes down the output stream. The file is written in 2k blocks. If the total amount of data is less than this it doesn't get sent until the CLOSEOUT.
  • 130, 140 Provide a pause between storing the data and reading it. The data is now stored on a cassette or disc file called file.
  • 160-230 Read the data back from file and display it.
  • 160 Sets up a pathway between the program and the storage device to read from the file called file. If you're using cassette, make sure that you've rewound the tape. What happens if the OPENIN has a different name from the file we OPENedOUT?
  • 170-200 Form another FOR ... NEXT loop which repeats three times. What happens if it cycles twice or four times?
  • 180 INPUT#9 takes information from the disc or cassette, holding it in name$ and number.
  • 190 Displays the retrieved data.
  • 210 Reads the last part of file and stores it in final$.
  • 220 Prints final$.
  • 230 Closes the input file.
  • 250 Stores the data. Try changing it.

CWTA

★ PUBLISHER: Computing with the Amstrad
★ YEAR: 1985
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ COLLECTION: COMPUTING WITH THE AMSTRAD 1985
★ AUTHOR: Trevor Roberts
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listing:
» Filer    (Computing  with  the  Amstrad)    ENGLISHDATE: 2020-07-19
DL: 184
TYPE: ZIP
SiZE: 4Ko
NOTE: 40 Cyls
.HFE: Χ

Je participe au site:
» 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 303 millisecondes et consultée 775 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.