First Steps


Issue 2

Feb/Mar 83

Next Article >>

<< Prev Article



First steps this month will concentrate on a problem which I know is common to many of our readers. How to get VULTURES III running!

Whilst much of what we will say will be specific to Vultures many of the principles will apply to all listings which are typed in from magazines. The first hard lesson to learn - like it or not - is that 98% (or so) of the time the reason that a program won't run is because YOU have made typing mistakes! Don't get upset, I make typing errors so does everyone I have come across - we all have to learn the hard way. Although the listing of Vultures was not very clear (blame the Atari 822 printer which has now died completely) the program does run as listed.

Lesson number one is, when any program has machine language in it, SAVE IT BEFORE YOU RUN IT. Any mistakes in entering data can lock up your machine making the only means of recovery to switch off and start again. Machine language is usually included in a Basic program as a series of DATA statements so when you see blocks of DATA - beware! It is probably a good idea to get into the habit of saving ALL Programs before you run them and you don't have to wait until you have completed a listing, you can save it at any time making it possible to put in a long listing over several evenings. The biggest headache is to try and find out where you are likely to have made your mistake - not easy! Common errors in typing DATA statements include typing an 0 (letter) instead of a 0 (figure), using a full stop instead of a comma or missing out commas thus ending up with numbers greater than 255. Most of the problems in Vultures stemmed from these type of errors in the big block of DATA between lines 2000 and 2080. If you have still not got it running try making the following changes which will check the DATA.

LINE 2000 delete :NEXT I 

Add line 2085 TOT=TOT+A:N.I:IF TOT<>39259 THEN ? "ERROR IN DATA": TOT=0:STOP

If you get the error message, there is no getting away from it - you must check every one of those DATA statements!

If you get ERROR 8 messages when reading in DATA then you have characters or punctuation in the statements. if you are using a FOR.. NEXT loop to read in the data then you can pinpoint the area of the error by asking the computer to print the value of the FOR ... NEXT variable and the value of the last statement read. For example if you get an ERROR 8 message in line 2000 of Vultures, the loop variable is I and the variable for the DATA is A. Ask the computer to PRINT I,A. The two figures you get are first the number of times the loop has executed before coming to the error and secondly the value of the last CORRECT data statement read. You should be able to count through the DATA statements to the I'th number which should be wrong. The number before should be your last correctly read item of data.

This idea of checking variables is very useful for tracing bugs. You can always stop a program at any time by using the BREAK Key and then ask the computer to PRINT the value of a variable or the content of strings. If you can figure out whether a variable is behaving correctly you should be able to narrow down the likely area of error.

If you still can't get Vultures going and you feel it is because you may have read the bad (awful?) printing wrongly, send me a stamped addressed envelope and I will send you off a full original listing.

Would anyone like to write this column for a future issue? It would be interesting to get alternative views - perhaps a humorous story, incorporating a few hints and tips of how you survived that nerve-wracking first few months with your new Atari computer - Let me know........