Discussion:
Messing around, creating a disk editor.
(too old to reply)
KP KP
2023-06-06 23:55:34 UTC
Permalink
I need some scrutinizing on my crappy coding expertise. Haven't made a program in years.. Could be junk or have no idea what I am doing. Gibberish? Lol.


10 PRINT "***** C64 DISK EDITOR *****"
20 PRINT
30 INPUT "Enter the name of the disk file: "; FILENAME$
40 PRINT
50 OPEN 1, 8, 15, FILENAME$
60 PRINT "1. Display sector"
70 PRINT "2. Edit sector"
80 PRINT "3. Save changes"
90 PRINT "4. Quit"
100 PRINT
110 INPUT "Enter your choice: "; CHOICE
120 PRINT

130 IF CHOICE = 1 THEN
140 INPUT "Enter the sector number to display: "; SECTOR
150 PRINT
160 SYS 64738
170 PRINT
180 GOTO 50
190 ELSEIF CHOICE = 2 THEN
200 INPUT "Enter the sector number to edit: "; SECTOR
210 PRINT
220 PRINT "WARNING: You are about to modify the sector contents."
230 PRINT "Make sure you know what you're doing!"
240 PRINT
250 INPUT "Press any key to continue, or Q to cancel: "; KEY$
260 IF KEY$ = "Q" OR KEY$ = "q" THEN GOTO 50
270 PRINT
280 SYS 64738
290 PRINT
300 GOTO 50
310 ELSEIF CHOICE = 3 THEN
320 PRINT "Saving changes..."
330 PRINT
340 CLOSE 1
350 OPEN 1, 8, 2, FILENAME$
360 CLOSE 1
370 PRINT "Changes saved successfully!"
380 PRINT
390 GOTO 50
400 ELSEIF CHOICE = 4 THEN
410 CLOSE 1
420 END
430 ELSE
440 PRINT "Invalid choice. Please try again."
450 PRINT
460 GOTO 50
470 END IF

480 GOTO 50
Andreas Kohlbach
2023-06-07 01:52:29 UTC
Permalink
I need some scrutinizing on my crappy coding expertise. Haven't made a
program in years.. Could be junk or have no idea what I am
doing. Gibberish? Lol.
10 PRINT "***** C64 DISK EDITOR *****"
20 PRINT
30 INPUT "Enter the name of the disk file: "; FILENAME$
40 PRINT
50 OPEN 1, 8, 15, FILENAME$
60 PRINT "1. Display sector"
70 PRINT "2. Edit sector"
80 PRINT "3. Save changes"
90 PRINT "4. Quit"
100 PRINT
110 INPUT "Enter your choice: "; CHOICE
120 PRINT
130 IF CHOICE = 1 THEN
140 INPUT "Enter the sector number to display: "; SECTOR
150 PRINT
160 SYS 64738
That'll do a System-Reset, and the rest is ignored. Worse, you leaving a
data channel open (line 50).
170 PRINT
180 GOTO 50
190 ELSEIF CHOICE = 2 THEN
Commodore BASIC (at least not of the C64) doesn't know "ELSE". May be of
the C128? But I never used it.
--
Andreas
Myles Skinner
2023-06-08 23:10:24 UTC
Permalink
I need some scrutinizing on my crappy coding expertise. Haven't made a program in years.. Could be junk or have no idea what I am doing. Gibberish? Lol.
Uh, so I have to ask...was this your own work? Because it looks suspiciously like some of the almost-but-not-quite-BASIC generated by ChatGPT that I've had the "pleasure" of critiquing lately: quite aside from the invalid keywords, I see the mixed-case PRINT strings, unreachable lines, opening and then closing a file for no reason, gratuitous calls to the system reset all as red flags...HIBT?

ms

Loading...