Commodore 128 Alive!

Commodore 64 => Programming => Topic started by: dunric on February 03, 2009, 01:31 AM

Title: Need help with telephone program
Post by: dunric on February 03, 2009, 01:31 AM
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
Title: Re: Need help with telephone program
Post by: dunric on February 03, 2009, 02:27 AM
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
Title: Re: Need help with telephone program
Post by: 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!
Title: Re: Need help with telephone program
Post by: RobertB on February 03, 2009, 08:01 AM
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
Title: Re: Need help with telephone program
Post by: Blacklord on February 03, 2009, 01:28 PM
Or I could move the thread into the 64 section.....
Title: Re: Need help with telephone program
Post by: BigDumbDinosaur on February 03, 2009, 02:45 PM
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.  :)
Title: Re: Need help with telephone program
Post by: airship on February 04, 2009, 01:30 AM
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. :)
Title: Re: Need help with telephone program
Post by: dunric on February 09, 2009, 02:41 AM
Can someone download telephone and debug it for me?

Paul
Title: Re: Need help with telephone program
Post by: SmallCleverDinosaur on February 09, 2009, 06:03 AM
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?
Title: Re: Need help with telephone program
Post by: dunric on February 09, 2009, 06:22 AM
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
EhPortal 1.34 © 2025, WebDev