SDLIDE issues and suggestions

Discussions related specifically to the Windows, Linux (86), Mac OS-X and Raspberry Pi editions of BB4W and BBCSDL
RichardRussell

SDLIDE issues and suggestions

Post by RichardRussell »

I received this comment about SDLIDE by email (reproduced here with permission): "Dragging an example program into the window did absolutely nothing (in contrast with BB4W) and I had to use the menu system to load the program. Having done so I clicked on the green triangle RUN button and got some unexpected result... It seems a shame that it can't be more BB4W-like in its user interface, but perhaps that is deliberate".
  1. "Dragging did absolutely nothing".

    It has never once occurred to me to implement that feature in SDLIDE because I never use it in BB4W (indeed I had completely forgotten that it even existed!). I'm guessing that it's a rarely used facility, but perhaps I'm wrong. To support it would probably require changes to BBCSDL itself because I don't think there's any way, currently, for a BASIC program to receive the SDL_DropEvent notification.

    Do you miss the ability to drag a program into the IDE window, and if so do you have any thoughts on how it could best be supported?

  2. "Clicked on the green triangle RUN button and got some unexpected result".

    Unfortunately no more detail of the "unexpected result" was given, so it's hard to comment. It should behave the same way as in BB4W: if the editing window is empty it opens an Immediate Mode window into which statements may be typed; if a program is loaded it should run it.

  3. "It seems a shame that it can't be more BB4W-like in its user interface, but perhaps that is deliberate".

    Again no detail of precisely how it isn't "like the BB4W interface" was given, but in general I'm not sure that I think it necessarily should be. Just because BB4W has been around for some 18 years doesn't mean that its interface is 'perfect' or that it should be slavishly copied in SDLIDE. For example, personally I think listing the functions and procedures in the current program in a separate list box, with the ability to sort them alphabetically, is better than BB4W's use of the context menu for this purpose.
What niggles do you have about the SDLIDE interface, and how do you think it could be improved? Do please bear in mind that it's written in BBC BASIC code so there are limitations in what can be reasonably achieved.
p_m21987
Posts: 177
Joined: Mon 02 Apr 2018, 21:51

Re: SDLIDE issues and suggestions

Post by p_m21987 »

It has never once occurred to me to implement that feature in SDLIDE because I never use it in BB4W (indeed I had completely forgotten that it even existed!). I'm guessing that it's a rarely used facility, but perhaps I'm wrong.
I've never tried doing that in SDLIDE, but that's only because I assumed it wouldn't be supported. In all other desktop software, I make extensive use of drag and drop to load files because it's very convenient.
I think support for drag and drop would be a very useful feature, and it would be worth adding it - as long as it isn't prohibitively difficult to do so. It's very convenient but I can personally live without it.
Hated Moron

Re: SDLIDE issues and suggestions

Post by Hated Moron »

p_m21987 wrote: Thu 12 Dec 2019, 13:42 I think support for drag and drop would be a very useful feature, and it would be worth adding it - as long as it isn't prohibitively difficult to do so. It's very convenient but I can personally live without it.
Long delayed response! I've recently looked into this again, with the following conclusions:
  • Dragging a .BBC file onto the BBCSDL desktop icon does work: the program is run.

  • Dragging a .BBC file onto an open SDLIDE window could be made to work, but it doesn't currently.

  • Dragging a selected block of code onto an open SDLIDE window doesn't work, and cannot be implemented (in Windows) because SDL 2.0 doesn't support it.
Personally I don't think I have ever used the BB4W feature of dragging a file over an open IDE window, to me it seems a rather 'unnatural' action. Is there much demand for it?

I have used text drag-and-drop to insert selected text into the BB4W IDE editor pane, but (apart from it currently being impossible in BBCSDL) copy-and-paste achieves the same effect.
kirkkaf13@gmail.com
Posts: 5
Joined: Fri 23 Aug 2024, 21:37

Re: SDLIDE issues and suggestions

Post by kirkkaf13@gmail.com »

I am reviving this topic since I recently started using BBCSDL.

I am hoping this one is just me not understanding how to do it but opening multiple files. I am constantly switching between my main application and library files and since I can only run the application from the main file it’s very tedious.
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: SDLIDE issues and suggestions

Post by Richard Russell »

kirkkaf13@gmail.com wrote: Sat 24 Aug 2024, 11:51 I am constantly switching between my main application and library files and since I can only run the application from the main file it’s very tedious.
Personally, I try not to develop multiple source files concurrently. My preference is to develop and test the libraries (or sub-modules) first, often with a test harness included in the same source file, and only when the libraries are complete and tested start work on the main program. With that approach there's rarely a need to have more than one source file open for editing.

When this same issue came up, years ago, in connection with BBC BASIC for Windows an add-on module moduleviewer was developed which added a tabbed interface to the IDE, allowing multiple source files to be opened in different tabs. I don't know to what extent that module has been used, as far as I know not that much.

With BBCSDL the only 'off the shelf' option is to open multiple IDE windows on your desktop, they are fairly lightweight so there's no reason not to do that (other than losing track of which is which). But since the BBCSDL IDE is itself a BBC BASIC program, if anybody fancies modifying it to support multiple concurrent files they are of course more than welcome to do that!

Moving forward it will increasingly be down to users to maintain and develop BBC BASIC for SDL 2.0 since I am no longer in a position to do that. But with the IDEs and tools themselves all being written in BBC BASIC, that is much more practical than it would be for some languages.
kirkkaf13@gmail.com
Posts: 5
Joined: Fri 23 Aug 2024, 21:37

Re: SDLIDE issues and suggestions

Post by kirkkaf13@gmail.com »

Over the last 11 years or so I’ve been developing mobile applications for big pharma companies in Java and more recently JavaScript. I’ve almost become custom to working across multiple files at the same time.

I never lived through the BASIC era and not familiar with having single file applications. Is this something that was common when writing BASIC?

This even caused me issues recently when trying to structure my application across multiple files as I wanted to put some user defined types and procedures into a separate file and realised there was no easy way to include them like in a C program. I had to separate procs and functions into a file and types into another file. Maybe my approach in trying to structure a maintainable application is all wrong.

Back to the original topic I might look into the source of the IDE and see if I can customise it to support multiple tabs.
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: SDLIDE issues and suggestions

Post by Richard Russell »

kirkkaf13@gmail.com wrote: Sat 24 Aug 2024, 18:51 I never lived through the BASIC era and not familiar with having single file applications. Is this something that was common when writing BASIC?
I tend to write single-file applications, not least because my programs are generally quite small.

But some BBC BASIC programmers write applications with dozens of source files, consider for example David William's Forces of Darkness game which has around 84 source files and Jeroen Groenendaal's Joop game which has 18 sub-modules.

Even Andy Parkes' alternative IDE BBCEdit has five sub-modules, so I wonder how these people organised the editing when developing their applications.
I wanted to put some user defined types and procedures into a separate file realised there was no easy way to include them like in a C program.
No easy way? This syntax is intended for just such a purpose:

Code: Select all

CALL @dir$ + "include/mytypes"
Didn't that suit your purposes? What would you have preferred (a conventional '#include' style facility doesn't suit an interpreted language in which everything happens at run time)?
kirkkaf13@gmail.com
Posts: 5
Joined: Fri 23 Aug 2024, 21:37

Re: SDLIDE issues and suggestions

Post by kirkkaf13@gmail.com »

kirkkaf13@gmail.com wrote: Sat 24 Aug 2024, 18:51 No easy way? This syntax is intended for just such a purpose:
CODE: SELECT ALL
CALL @dir$ + "include/mytypes"
Didn't that suit your purposes? What would you have preferred (a conventional '#include' style facility doesn't suit an interpreted language in which everything happens at run time)?
I think the issue was my procedures were no longer in memory? What I was trying to do was keep a file which had various types for vectors and matrices and some functions and procedures together but I split them across multiple files with the functions and procedures in a file INSTALLED and the types CALLED.
CALLed modules should normally not contain any procedure or function definitions (nor should they INSTALL modules which do). Attempting to execute such a procedure or function after the CALLed module has returned could easily crash BASIC.
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: SDLIDE issues and suggestions

Post by Richard Russell »

kirkkaf13@gmail.com wrote: Mon 26 Aug 2024, 07:26 I think the issue was my procedures were no longer in memory? What I was trying to do was keep a file which had various types for vectors and matrices and some functions and procedures together
So your 'complaint' is that it wasn't possible to put both type declarations and procedure/function definitions in the same file without wasting memory?

It's the nature of an interpreted language (which has nothing like a pre-processor or a compilation stage, everything is done at run-time) that a function or procedure must be resident in memory when it is called. That implies being present either in the main program or in an INSTALLed module.

On the other hand a declaration, such as initialising a constant or dimensioning an array or defining a type, simply has to be executed before the referenced constant/array/structure is used, the declaration itself is no longer required. It still can be put in the main program or an INSTALLed module, but you will save memory by CALLing it instead (which executes the code and then discards the file and frees the memory it occupied).

So whilst this is different from what you may have been used to with a compiled language, I struggle to understand why you feel it is a weakness of BBC BASIC which "caused you issues".

I wonder if you might be happier with a compiled BASIC like PureBASIC. That is nearly as good as BBC BASIC, except that the 'mobile' compiler (SpiderBASIC) doesn't have the almost 100% compatibility with the desktop versions that BBC BASIC has, so writing genuinely cross-platform applications - especially ones using graphics, sound, music etc., can be harder.
kirkkaf13@gmail.com
Posts: 5
Joined: Fri 23 Aug 2024, 21:37

Re: SDLIDE issues and suggestions

Post by kirkkaf13@gmail.com »

I wouldn't really call it a complaint, the issue I was experiencing was more a lack of understanding on my part, I am familiar with Javascript as an interpreted language but it's wildly different. I am happy tinkering with BBC BASIC, I actually think it's great fun.