APPLICATIONSDIVERS ★ Program of the Month — Amstrad CPC Progdoc ★

ProgdocApplications 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 ★ 


This is a utility program for the CPC464/664/6128. It allows you to trim finished and debugged programs down to a minimum size and so improve execution speed slightly.

When the program is run, it splits the screen into two information windows with a larger display window between them. Below the lower information window is the command window which has a > prompt, ready to accept a command. There are 16 commands, as follows:

  • CAT — displays a catalogue of the disk in the drive, and could be omitted if the program were to be converted for tape-only use.

  • CLS — clears the display window if it starts to get messy.

  • EDIT — once a file has been loaded into memory, this command can be used to edit lines within the file. You are prompted for a line number; if no number is entered, the program returns to the command prompt. Alternatively, E xxxx will work as the edit command and take you straight to editing line xxxx. After editing, you will be asked for confirmation and may return to the command prompt.

  • FILESPACE — this command may only be used before loading a file. It should be used before loading a large file (over 30k) but isn't necessary otherwise. Filespace defaults otherwise to 1000, which represents the number of lines in the program you wish to load and must be set equal to or higher than that number. The amount of filespace used will be displayed in the upper information window. An abbreviation for this command is FS xxxx.

  • FIND — typing FIND, or the abbreviation F, will bring up a prompt for a string to search for. This can be anything at all and is case-dependent, so 'THIS' and 'this' are different. The search is global, and the numbers of the lines in which the string is found will be displayed in the upper information window. The command does not alter anything in memory.

  • HELP — this (or H) will give a list of commands in the display window. LIST — this command has two actions. LIST, or the abbreviation LS, will list the whole program in memory to the display window. It can be aborted at any time by pressing the space bar. Use the sequence ESC — SPACE to pause and restart. LIST xxxx or LS xxxx will list the line xxxx only.

  • LOAD — this prompts for a filename. Pressing ENTER alone will return to the command prompt. Alternatively, LOAD filename or L filename will load-in the file directly. All files loaded must be in ASCII format.

  • PRINT — this, or P, will send the program in memory to a printer. You will be asked for confirmation but may not abort once confirmed.

  • PRINT ELITE — this will send the code for Elite font printing to a printer. Nothing is performed physically except a carriage return to realign the print head. The code in the program is for Epson compatibles and is on line 1330. The abbreviation is P ELITE.

  • PRINT PICA — exactly the same as PRINT ELITE but for Pica printing. The code is on line 1320.

  • QUIT — this can be abbreviated to Q, and you are asked for confirmation in case you make a mistake.

  • REPLACE — this prompts for a string to be replaced, followed by a prompt for replacement. This command must be used with care since it can alter large parts of a program. The replacement will be global, so all occurrences of the target string will be replaced. When replacing string variables, remember to include the $, or integer or real variables of the same name will also be replaced. The search will also replace everything of the same name between quotes in the PRINT statements or in REM statements. It will not replace the string if it's part of a longer alphabetic string; this is done in line 1260 of the program by checking that the character on either side of the string is lower than an ASCII 'A'. The line numbers in which a replacement has occurred will be displayed on the screen. The command can be abbreviated to R.

  • SAVE — similar to LOAD. The file saved is an ASCII version and should be reloaded to be run as an ASCII file.

  • TRIM — this command goes through the program, removing all comments. If you're in the habit (you shouldn't be) of sending control of your program to REM statements by GOTOs, and so on, then you'll need to alter your programming style or line 1540 of the program listing to take account of this (outlines = lineno$ + should do the trick). Once again, the search is not toke-nised, so if your program includes the groups :REM or :' anywhere other than a comment, be careful. Whole comment lines will be truncated to just the line number, and LIST will show you where they have been removed. You can use EDIT to put back any comments. The blank line numbers will be discarded when the file is saved.

  • ZAP — this command (or Z) will clear all the memory and start again. You will be asked for confirmation, and it's safer to use SAVE before taking such a drastic step.

When typing-in the listing, you may safely leave out all comments, or alternatively use the program on itself as a test. Watch out for line 1700.

You can alter the colour used from white on blue in line 110.

Using Progdoc

First, load the program you want to work on. Renumber it with RENUM 1,1,1 and make a note of the last line number to ensure that FILESPACE is set larger than it. You can then restore normal numbering with RENUM. Then save the program in ASCII format using SAVE "filename",A.

Now run Progdoc. At the command prompt enter FS xxxx where xxxx is greater than the highest line number previously noted. This isn't necessary if your program is less than 1000 lines.

You can now load the program to work on. Type 'LOAD filename ' where filename is the name of the ASCII version of the program you have just saved. The program will take a few moments to load. Various errors can occur at this stage if FILESPACE is too low or the wrong filename is used. Once the program is loaded, type LIST as a check. Press the space bar when you have seen enough.

It's best to use TRIM before REPLACE. Now type TRIM and your program will scroll through the display window but with the comments removed. You can pause this process by pressing ESC and start it again with SPACE, but don't press ESC twice or you'll break out of the program. If you do accidentally break out, type GOTO 150 for a warm restart.

When TRIM is finished, you can start REPLACE-ing. It's a good idea while doing this to consult a copy of the original listing to check the original variable names.

If the original variable names are in lower-case, replace them with short upper-case names. This makes them stand out from the original names.

Do a SAVE at regular intervals when using REPLACE, since it's easy to make mistakes. Remember to use a different name for each version, as it can be frustrating to have to go back and start from scratch.

A slower alternative to REPLACE is the FIND — EDIT sequence. Use FIND to display all the line numbers your variable is in, then step through each of these using EDIT xxxx. The latter command will display the original line, with the line number displayed separately below. The altered line can then be typed-in following this. When you press ENTER, you will be asked for confirmation. If you press

N, the original line will remain unchanged. To abort EDIT quickly, press ENTER in response to the empty line number, followed by N.

To convert Progdoc to tape

Load Progdoc and type the following direct Basic commands:

DELETE 300 (remove the CAT command)
DELETE 500 (remove the CAT command summary)
DELETE 1440 (remove the CAT subroutine)
DELETE 710 (to allow you to load unnamed files)
DELETE 820 (to allow you to save unnamed files)
Deleting lines 710 and 820 won't let you abort a load at the prompt, so leave them in if you want to retain this program.

Australian Personal Computer

★ PUBLISHER: Australian Personal Computer
★ YEAR: 1986
★ AUTHOR: JJ Walker


Je participe au site:
» Newfile(s) upload/Envoye de fichier(s)
★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

» Applications » Screen Dump on Amstrad (Popular Computing Weekly)
» Applications » Jak odbezpieczyć program w BASICU (Bajtek)
» Applications » Schildchen - Drucker (CPC Amstrad International)
» Applications » Din - Tastatur (CPC Amstrad International)
» Applications » Rsx - Flashing Cursor (The Amstrad User)
» Applications » Anti-Erreurs (CPC Revue)


L'alinéa 8 de l'article L122-5 du Code de la propriété intellectuelle explique que « Lorsque l'œuvre a été divulguée, l'auteur ne peut interdire la reproduction d'une œuvre et sa représentation effectuées à des fins de conservation ou destinées à préserver les conditions de sa consultation à des fins de recherche ou détudes privées par des particuliers, dans les locaux de l'établissement et sur des terminaux dédiés par des bibliothèques accessibles au public, par des musées ou par des services d'archives, sous réserve que ceux-ci ne recherchent aucun avantage économique ou commercial ». Pas de problème donc pour nous!

CPCrulez[Content Management System] v8.7-desktop/cache
Page créée en 849 millisecondes et consultée 160 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.