Need help with telephone program

Started by dunric, February 03, 2009, 01:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dunric

My cousin wrote a small telephone management program in BASIC a long time ago. It doesn't work as it should. I wanted to ask someone for help with debugging it. Here is the disk file, works under Vice commodore emulator:

http://www.geocities.com/dunric/ryandisk.zip

Load up the directory with LOAD"$",8 and search for the program "telephone".

Load that up and look at the code. Please see if you can debug it so that it works.
It is supposed to keep track of up to 8 telephone numbers, and the name of the person, too. But it doesn't do that.

Send me an email at: dunric@yahoo.com

Thanks!

Paul

dunric

#1
Here's the telephone program:

1 DIM RI$(50),RT$(50)
5 OPEN15,8,15,"I"
50 PRINT"[CLR]"
100 POKE53280,0:POKE 53281,0
110 PRINTTAB(11);"[RVS ON][RED] TELEPHONE NUMBERS "
120 PRINT"[RVS ON][PURPLE][DOWN]      NAME                    NUMBER   "
130 PRINT"[BLUE]#1":PRINT"#2":PRINT"#3":PRINT"#4":PRINT"#5":PRINT"#6":PRINT"#7"
150 INPUT"[WHITE][4 DOWN][7 RIGHT]PRESS ANY KEY TO CONTINUE";R$
160 PRINT"[RVS ON][WHITE][CLR][2 DOWN]        SAVE NEW #    [6 RIGHT]1"
165 PRINT"[RVS ON][RED][2 DOWN]        DIRECTORY      [6 RIGHT]2"
170 PRINT"[RVS ON][CYAN][2 DOWN]      GET RID OF A #  [6 RIGHT]3"
175 INPUT"[RVS ON][PURPLE]            MAKE A SELECTION           ";RU$
180 IFRU$="1"THEN210
190 IFRU$="2"THEN270
200 IFRU$="3"THEN330
210 INPUT"[BLUE]               ENTER NAME";RI$
220 PRINT:INPUT"[WHITE]             ENTER NUMBER";RT$
221 PRINT"[CLR]":OPEN1,8,3,F$+",S,R":I=1
222 PRINTTAB(11);"[RVS ON][RED] TELEPHONE NUMBERS "
223 PRINT"[RVS ON][PURPLE][DOWN]      NAME                    NUMBER   "
224 PRINT"[BLUE]#1":PRINT"#2":PRINT"#3":PRINT"#4":PRINT"#5":PRINT"#6":PRINT"#7"
225 PRINT"[HOME][3 DOWN]"
226 FORA=1TOI
227 INPUT#1,RI$(I):INPUT#1,RT$(I)
228 PRINTTAB(5)RI$(I)TAB(28)RT$(I)
229 IFRI$=CHR$(160)THENGOTO231
230 I=I+1:IFST=0THEN227
231 CLOSE1
232 PRINT"[WHITE]"TAB(5)RI$TAB(28)RT$:OPEN2,8,2,F$+",S,W":OPEN1,8,3,"PHONES,A"
240 PRINT#1,RI$:PRINT#1,RT$
250 CLOSE1:CLOSE2
260 GOTO150
270 PRINT"[CLR]":OPEN1,8,3,F$+",S,R":I=1
271 PRINTTAB(11);"[RVS ON][RED] TELEPHONE NUMBERS "
272 PRINT"[RVS ON][PURPLE][DOWN]      NAME                    NUMBER   "
273 PRINT"[BLUE]#1":PRINT"#2":PRINT"#3":PRINT"#4":PRINT"#5":PRINT"#6":PRINT"#7"
275 PRINT"[HOME][3 DOWN]"
280 FORA=1TOI
290 INPUT#1,RI$(I):INPUT#1,RT$(I)
300 PRINTTAB(5)RI$(I)TAB(28)RT$(I)
310 IFRI$=CHR$(160)THENGOTO150
320 I=I+1:IFST=0THEN290
325 CLOSE1:GOTO150
330 PRINT:INPUT"[WHITE]ARE YOU SURE";RU$
331 IFRU$="Y"THEN340
332 IFRU$="N"THEN150
340 PRINT#15,"S0:PHONES,S,W":CLOSE15
370 GOTO 150


Paul

airship

Your program is for the Commodore 64. This is a forum for the Commodore 128.

Perhaps you should try posting your request on a forum dedicated to the Commodore 64.

Good luck!
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

RobertB

Quote from: airship on February 03, 2009, 07:21 AMYour program is for the Commodore 64. This is a forum for the Commodore 128.
Unless someone converts it to Basic 7.0 for the C128.  :)

                 Truly,
                 Robert Bernardo
                 Fresno Commodore User Group
                 http://videocam.net.au/fcug
                 Catch the Fatman and Circuit Girl at
                 http://vimeo.com/jeri

Blacklord

Or I could move the thread into the 64 section.....

BigDumbDinosaur

Or, describe what the program does in plain English (if there's such a thing) and maybe someone might write an assembly language version that runs much faster.  :)
x86?  We ain't got no x86.  We don't need no stinking x86!

airship

Quote from: Blacklord on February 03, 2009, 01:28 PMOr I could move the thread into the 64 section.....
Forgot we had a C64 section.

BTW, my guess as to why it doesn't work is that it has all those magazine type-in pseudonyms for the funky C64 characters. :)
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

dunric

Can someone download telephone and debug it for me?

Paul

SmallCleverDinosaur

Quote from: airship on February 03, 2009, 07:21 AM
Your program is for the Commodore 64. This is a forum for the Commodore 128.

Perhaps you should try posting your request on a forum dedicated to the Commodore 64.

Good luck!
Just because a program doesn't use Basic 7.0 specific commands, doesn't automatically make it a program only for the C64 :) All programs written in BASIC 2.0 are meant to also run under BASIC 7.0, unless it uses POKE or SYS commands that are specific to the C64.

This program runs fine in C128 mode but there are some errors in the code. More of logical errors than code related. There are no lines that the BASIC interpreter wouldn't like, but I wonder if this program is complete. Do you know if it is?
Ignorance is a precious thing. Once lost, it can never be regained.

dunric

The program is complete as far as I know. It just needs to be debugged. What it is supposed to do is load in saved phone numbers and names. But it doesn't do that. The disk keeps spinning in the drive and the program "hangs".

Any ideas or code improvements?

Here's the disk file containing 'telephone':

http://www.geocities.com/dunric/ryandisk.zip

Paul