richpl / PyBasic

Simple interactive BASIC interpreter written in Python
GNU General Public License v3.0
170 stars 46 forks source link

File io #33

Closed RetiredWizard closed 3 years ago

RetiredWizard commented 3 years ago

Adds File I/O statements

Open "filename" for [input!output!append] as #filenum [else lineno] input #filenum,var1,var2,... print #filenum,var1,var2,... fseek #filenum,filepos

brickbots commented 3 years ago

It might be nice to add some of what was in testloop.bas to regression.bas as an additional test to make sure this does not get broken again in the future 👍

brickbots commented 3 years ago

Whoops! I see you have this test included in the actual PR related to the loop variable bug :-) Sorry for my confusion!

RetiredWizard commented 3 years ago

Updating regression.bas would have been better. I didn't do it because I didn't want to create pull conflicts. I'll go ahead and update the regression file in this pull request with the loop bug tests. Only thing is they'll fail if the loop bug pull request hasn't been merged (#30), I guess as long as that's known, it's not a problem.

richpl commented 3 years ago

Sorry, I'm still getting a conflict with basicparser.py. Maybe I should make sure I submit PRs in order. This is getting tricky

brickbots commented 3 years ago

Hi @richpl! Sorry we've been submitting all of these PR's, I'm not surprised they have some conflicts as there were a lot of changes across many files.

I'm happy to grab the latest master branch and rebase the FILE I/O and DATA changes from @RetiredWizard, and combine them with the remaining syntax tweaks and submit a single big PR. I think once we get all the pieces of the vintage basic changes in one codebase the PR's will be smaller and flow more easily.

Let me know if anyone has any thoughts/concerns with me merging/resolving these all in one branch and doing a new PR.

RetiredWizard commented 3 years ago

The conflicts on my two PRs look easy enough, I'll just update the requests. I don't mind going through a couple iterations to get them done. Thanks @richpl!

RetiredWizard commented 3 years ago

okay, I tried to use the github resolve conflict but that caused github to spit out the entire basicparser module. I've reloaded basicparser and it appears to be conflict free now.

RetiredWizard commented 3 years ago

Well I seemed to have messed up this PR. I'm going to close it and then resubmit a new one. Sorry :(