Login
Back to forumSee the full topicGo to last reply

Posted By

Csabo
on 2009-02-07
17:08:33
 Re: Need help with telephone program

Hey Paul,

First of all, this program is very poorly written, there are multiple problems with it, both technical and design problems. It's not worthy of our time. You also haven't said anything about whether you've already tried to debug it and if so, where you got stuck. You must realize that your "standing" on this forum is not very high, so it's really too much to ask from basically random people - why should we work on fixing this problem for you? The fact that you don't seem to realize this must be due to your illness, that's the only reason I'm giving you credit.

Nevertheless, here are some of the issues.

1) Line 100 is the telltale sign of a C64 program as others have pointed it out. The rest is standard basic so it'll run fine on the Plus/4. If the white color wasn't used (but unfortunately it was), it would be perfect. The question as to how to detect if we are running on a C64 or a Plus/4 is actually an interesting one though. That address is free RAM on the Plus/4, but poking there on the C16 will kill the BASIC program.

On the C64, peeking back the poked value will return 240, as the upper four bits are unused and will always be set to 1. So adding this line:

105 IF PEEK(53280)=0 THEN POKE 65301,0 : POKE 65305,0

makes it run fine on both machines. (We want to avoid the COLOR command as the token for that would not be recognized by the C64.) Moving on.

2) Lines 110-130 are useless and should be deleted.

3) Bug: if the user chooses anything besides 1, 2 or 3, it's still treated as "1". You need to add

205 GOTO 175

to fix this. This still leaves the user no option to exit the program.

4) The actual problem is with saving the data. Lines 221-231 should be deleted, that is duplicated "direction" functionality that's not needed for saving a new number. Line 232 should be changed to

232 OPEN 1, 8, 3, F$+",S,W"

The original has ",A", but that's invalid. I'm assuming the author was thinking "Append"? Also line 250 changes to only closing channel 1 (delete the CLOSE 2 part).

5) The third menu item's description should change to "GET RID OF ALL #S" as it appears to be deleting the data file. You should use this before entering new data, or just delete the original data file, I don't think the one on the disk is in the proper format.

Making the above changes will cause the program to function better, but it's still not very good. There's nothing in there to try and make sure only 7 numbers can be entered, etc. Whew, there's goes 30 minutes of my life that I will never get back. Now, let us never speak of this again.



Back to top


Copyright © Plus/4 World Team, 2001-2024