Discussions related to graphics (2D and 3D), animation and games programming
To satisfy my curiosity, how is this related to the program of the same name that you've written for Matrix Brandy? Are they essentially the same code? I doubt that many people will have tried to target both platforms simultaneously so there may well be valuable lessons to learn from your experience.
If you can reproduce the problem (or if you saved a copy of the program) please list the troublesome section of code here. What I would say, however, is that (unlike Python!) indentation has only cosmetic significance, and can't of itself have any effect on the running program. The BBCSDL interpreter doesn't even see it, because leading spaces are stripped off program lines (and of course you can disable indentation in the Options menu).Patrick M wrote: ↑Fri 30 Nov 2018, 23:49It seemed to get confused by something somewhere in the code. I realised that something was wrong when I noticed that the automatic indentation didn't look correct (for example, there were two ENDIFS next to each other at the same horizontal position), and the program didn't behave correctly when I ran it.
Too late for the next release of BBCSDL I'm afraid (I'm not holding it back for what sounds like a minor problem, and one I've never come across). You can always try switching to the other IDE to see if that works better; in my experience Andy Parkes' IDE is considerably more stable than mine (he hasn't sent me any updates or bug fixes for months).
Surely that must be a decision for you? If it's giving you enjoyment and/or satisfaction, carry on. I know from my own bitter experience that if you write any software in the hope of it being appreciated by others you are likely to be disappointed.Does anyone have an answer to my question about whether or not I should bother continuing with this project?
It's a fault in your file, not in SDLIDE: both those lines have a trailing space. As you know, in an IF … THEN line there must be nothing after the THEN (not even a REM, or indeed a space) because it's being the last token on the line that indicates that it's the start of a multi-line IF...ENDIF clause rather than a single-line IF statement. Technically the explanation for this restriction is that when BBC BASIC 'searches forwards' for a possible nested IF...ENDIF clause it looks only at the last byte of every line (for maximum speed).
The reason that editing the lines fixes the problem is that it causes the lines to be re-tokenised, and a side-effect of the re-tokenisation is that any trailing spaces are stripped. In principle SDLIDE could strip trailing spaces when the program is read from a file too, but currently it assumes that the file corresponds to a valid BBC BASIC program and therefore does not expect to need to.
I wonder how those spaces got there in the first place. Did you create the program in a regular text editor rather than a specific BBC BASIC editor such BB4W, BBCSDL or BBCEdit (or indeed one of the many other BBC BASIC editors)? I would not expect a BBC BASIC editor to export a file with trailing spaces, but of course a regular text editor might.
I wouldn't say nobody is interested - I am interested in any program written in BBC BASIC, more so if it has a unique property such as having been written to run in both Matrix Brandy and BBCSDL! But I am not a games enthusiast, not least because I'm hopeless at playing them, so it's not a program that I would be very likely to use myself other than for the interest of seeing it run.Fair enough. I'll probably not continue working on this project since nobody is interested.
It wouldn't be difficult to modify SDLIDE to work as you expected. If people are going to use a regular text editor it probably should strip trailing (and leading) spaces so I'll add it to the 'wish list' for the next release.
Has nobody written an IDE for Brandy? You could perhaps adapt SDLIDE.bbc, which I don't think relies on many language extensions that Matrix Brandy doesn't have (ON TIME is probably the most problematical one); the GUI is created entirely using regular BBC BASIC plotting statements so should be quite portable. Admittedly 'dlglib.bbc' which SDLIDE uses to display its 'dialogue boxes' makes extensive use of structures so that would need some work.I did, as it started out as a Matrix Brandy program.