Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File type and mode does not seem to work #19

Open
rzuckerm opened this issue Sep 10, 2023 · 1 comment
Open

File type and mode does not seem to work #19

rzuckerm opened this issue Sep 10, 2023 · 1 comment

Comments

@rzuckerm
Copy link

rzuckerm commented Sep 10, 2023

This creates a file called output.txt, SEQ, W instead of a writable file called output.txt:

10 OPEN 3, 8, 2, "output.txt, SEQ, W"
20 PRINT#3, "Hello from Commodore Basic"
30 PRINT#3, "This is a line"
40 PRINT#3, "This is another line"
50 PRINT#3, "Goodbye!"
60 CLOSE 3

Correspondingly, this cannot be used to read output.txt:

70 OPEN 3, 8, 2, "output.txt, SEQ, R"
80 INPUT#3, $A
90 IF ST <> 0 THEN GOTO 120
100 PRINT A$
110 GOTO 80
120 CLOSE 3

Instead, it tries to read a file called output.txt, SEQ, R.

@rzuckerm
Copy link
Author

I found this example. It looks like this differs from the C64 documentation I found on the C64 Wiki. I got this working:

10 OPEN 1, 1, 1, "output.txt"
20 PRINT#1, "Hello from Commodore Basic"
30 PRINT#1, "This is a line"
40 PRINT#1, "This is another line"
50 PRINT#1, "Goodbye!"
60 CLOSE 1
70 OPEN 1, 1, 0, "output.txt"
80 INPUT#1, A$
90 PRINT A$
100 IF ST = 0 THEN GOTO 80
110 CLOSE 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant