- BASIC Interpreter / Run Time Engine
Fixed a bug causing MOUSE and graphics coordinates to diverge if the window is resized without doing a VDU 26.
Incorporated Jonathan Harston's modification to ignore SOUND statements specifying non-internal sound channels.
- IDEs and Utilities
The SDLIDE list of functions and procedures can now be scrolled using the PgUp and PgDn keys.
SDLIDE will now load programs in plain text (.bas) format even if they contain TAB characters.
Added a Go To Line menu selection to SDLIDE, similar to that in BBC BASIC for Windows v6.12a.
Modified the search utility to fix a problem with it not having keyboard focus initially.
- Libraries
dlglib.bbc now supports comboboxes!
Fixed a bug in datelib.bbc causing the FN_date$() function to misbehave with months starting with an M (March and May). D'oh!
The DejaVuSans font has been updated to a newer version with more Unicode symbols.
Added the (incomplete) bigint.bbc library in case somebody fancies developing it further.
- Example Programs
Added a graphics demo fluid.bbc which uses GPU shader code to create a plasma-like effect.
Modified dlgdemo.bbc to demonstrate the new combobox capability of the dialogue box library.
Modified hangman.bbc to remove code which worked around the now fixed coordinate disparity.
Added a 3D animation to accompany skaters.bbc. This has a rather risqué Easter Egg, can you find it?!
BBC BASIC for SDL 2.0 version 1.05a released
- Richard Russell
- Posts: 2088
- Joined: Sun Feb 27, 2011 10:35 am
- Location: Downham Market, Norfolk
- Contact:
BBC BASIC for SDL 2.0 version 1.05a released
I have released version 1.05a of BBC BASIC for SDL 2.0, the cross-platform programming language for Windows, MacOS, Linux, Raspbian (Raspberry Pi), Android and iOS. The changes in this version are as follows:
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
- Richard Russell
- Posts: 2088
- Joined: Sun Feb 27, 2011 10:35 am
- Location: Downham Market, Norfolk
- Contact:
Re: BBC BASIC for SDL 2.0 version 1.05a released
Somebody has posted this, unbidden, at the BBC BASIC forum (and, no, it's not me posting under an alias):
"I just want to let people know that I finally did the effort to use structures in my programs and that this was a revelation. Big words but justified. I know Richard has made the effort to implement structures already some years ago. And, at the time, I made a minor effort to work with them only to put them aside quite quickly. Not that they were not useful or to difficult to use. I simply looked for the old familiar ways to solve my programming issues. Lazy !
I couldn't have been more wrong. This week I did the effort to carefully read the manual and started to code a new program including several arrays of structures, mixing different data types within the structures. The code I've produced after some tinkering is now finalized. It is compact, symmetric, much more readable,... and so much easier/faster to code. For those who already use this I am of course stating the obvious. For those who don't : read the manual , then give structures a try. This language is so rich !"
Naturally I entirely agree with this, and I am in no doubt that structures are one of the most valuable extensions that I have made to the language. But nevertheless structures in BBC BASIC remain controversial. Some people say that they can't see the point, given that everything you can do with structures you can do with indirection (whilst that is arguably true, it's what you can do elegantly, easily, safely and quickly that matters more).
Structures have particular value in the context of moving from 32-bits to 64-bits. If you are using indirection you are necessarily working with addresses (typically of memory allocated with DIM); if those addresses may be 64-bit values then you have to assign them to 64-bit variables which means that programs need modifying. But the structure syntax is blind to the size of addresses and programs using them will run on a 64-bit system without modification.
I'd like to see structures implemented in other versions of BBC BASIC (e.g. Matrix Brandy) and I'd like to see them implemented in a way compatible with BBC BASIC for Windows and BBC BASIC for SDL 2.0. But I know that's a tall order when there is such a range of opinions (I expect there would be pressure from some quarters to be compatible with Basalt's structures instead).
"I just want to let people know that I finally did the effort to use structures in my programs and that this was a revelation. Big words but justified. I know Richard has made the effort to implement structures already some years ago. And, at the time, I made a minor effort to work with them only to put them aside quite quickly. Not that they were not useful or to difficult to use. I simply looked for the old familiar ways to solve my programming issues. Lazy !
I couldn't have been more wrong. This week I did the effort to carefully read the manual and started to code a new program including several arrays of structures, mixing different data types within the structures. The code I've produced after some tinkering is now finalized. It is compact, symmetric, much more readable,... and so much easier/faster to code. For those who already use this I am of course stating the obvious. For those who don't : read the manual , then give structures a try. This language is so rich !"
Naturally I entirely agree with this, and I am in no doubt that structures are one of the most valuable extensions that I have made to the language. But nevertheless structures in BBC BASIC remain controversial. Some people say that they can't see the point, given that everything you can do with structures you can do with indirection (whilst that is arguably true, it's what you can do elegantly, easily, safely and quickly that matters more).
Structures have particular value in the context of moving from 32-bits to 64-bits. If you are using indirection you are necessarily working with addresses (typically of memory allocated with DIM); if those addresses may be 64-bit values then you have to assign them to 64-bit variables which means that programs need modifying. But the structure syntax is blind to the size of addresses and programs using them will run on a 64-bit system without modification.
I'd like to see structures implemented in other versions of BBC BASIC (e.g. Matrix Brandy) and I'd like to see them implemented in a way compatible with BBC BASIC for Windows and BBC BASIC for SDL 2.0. But I know that's a tall order when there is such a range of opinions (I expect there would be pressure from some quarters to be compatible with Basalt's structures instead).
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
Re: BBC BASIC for SDL 2.0 version 1.05a released
Structures definitely make sense. They are a good compromise between the simple scalar and array variables used by simple BASIC implementations, and full-on user-defined object types used by the likes of Java and JavaScript.
If I could take just one of the lessons learned in my programming career, such as it is, it would have to be:and so forth, where I% is the common index into each of them, with just one array indexed on I% and each element having all those properties in it.
This is what the User Guide is getting at in an innocent sentence about building up quite complex expressions with the ?, ! and $ memory operators. You can write PROCs to set properties within a structure, and FNs to get them -- exactly as I did the test code for my project, BCP. Now functionality like data structures is just baked right into the language itself -- how cool is that?
BCP is written mainly in 6502 assembly language, since it's intended to run on real, ancient kit; but if I was writing a version to run on modern, fast hardware, then it would definitely make sense to use structures to represent the various objects it used. The data structures are so central to it, I ended up writing code to emulate that functionality!
If I could take just one of the lessons learned in my programming career, such as it is, it would have to be:
You can replace a whole bunch of separate arrays e.g.Design your data structures correctly, and your program will more or less write itself from then on.
Code: Select all
name$(I%), height(I%), weight(I%)
This is what the User Guide is getting at in an innocent sentence about building up quite complex expressions with the ?, ! and $ memory operators. You can write PROCs to set properties within a structure, and FNs to get them -- exactly as I did the test code for my project, BCP. Now functionality like data structures is just baked right into the language itself -- how cool is that?
BCP is written mainly in 6502 assembly language, since it's intended to run on real, ancient kit; but if I was writing a version to run on modern, fast hardware, then it would definitely make sense to use structures to represent the various objects it used. The data structures are so central to it, I ended up writing code to emulate that functionality!
- Richard Russell
- Posts: 2088
- Joined: Sun Feb 27, 2011 10:35 am
- Location: Downham Market, Norfolk
- Contact:
Re: BBC BASIC for SDL 2.0 version 1.05a released
Absolutely. In the syntax I devised for BBC BASIC for Windows and BBC BASIC for SDL 2.0 you'd create the structure array thus:julie_m wrote: ↑Sun Aug 25, 2019 2:14 pmYou can replace a whole bunch of separate arrays e.g.and so forth, where I% is the common index into each of them, with just one array indexed on I% and each element having all those properties in it.Code: Select all
name$(I%), height(I%), weight(I%)
Code: Select all
DIM objects{(num%) name$, height, weight}
Code: Select all
DIM object{name$, height, weight}
DIM objects{(num%)} = object{}
Code: Select all
PROChandle_entire_array(objects{()})
PROChandle_one_element(objects{(I%)})
PROChandle_one_member(objects{(I%)}.height)
Code: Select all
size_of_array = DIM(objects{()},1)
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.