Multiwin not working in 0.26a

Discussions related to the code libraries supplied with BB4W & BBCSDL
Post Reply
zeem
Posts: 3
Joined: Thu 22 Nov 2018, 23:43

Multiwin not working in 0.26a

Post by zeem » Thu 22 Nov 2018, 23:50

I can't get Multiwin to run in 0.26a, as it results in a DIM Space error. This happens even in a 2-line program containing the relevant INSTALL and PROC commands.

I can continue using 0.21a which I backed up before upgrading, but I'd really like to see if the compile feature makes my program faster! For those who might be interested, I've been writing a DEC PDP-8 emulator.

guest
Posts: 268
Joined: Mon 02 Apr 2018, 09:12

Re: Multiwin not working in 0.26a

Post by guest » Fri 23 Nov 2018, 09:52

zeem wrote:
Thu 22 Nov 2018, 23:50
I can't get Multiwin to run in 0.26a, as it results in a DIM Space error.
What platform? The supplied example program 'multidem.bbc' (in the examples/general folder) works for me, does it work for you? How many windows are you trying to create?
This happens even in a 2-line program containing the relevant INSTALL and PROC commands.
If you have a sample program that illustrates a problem (whether two lines or several) it would be enormously helpful to see it! This forum has good facilities for listing code within posts (put it in [code] tags).

RNBW
Posts: 11
Joined: Thu 05 Apr 2018, 21:41

Re: Multiwin not working in 0.26a

Post by RNBW » Fri 23 Nov 2018, 11:57

The Multidem.bbc works for me on 2 different computers using 26a and on Windows 10 platform

zeem
Posts: 3
Joined: Thu 22 Nov 2018, 23:43

Re: Multiwin not working in 0.26a

Post by zeem » Sat 24 Nov 2018, 11:41

guest wrote:
Fri 23 Nov 2018, 09:52
What platform? The supplied example program 'multidem.bbc' (in the examples/general folder) works for me, does it work for you? How many windows are you trying to create?
Many thanks for the reply! I'm running Linux, specifically Linux Mint 18.3 64-bit. Multidem.bbc doesn't run, generating the same error (see below). I'm trying to create one window.
If you have a sample program that illustrates a problem (whether two lines or several) it would be enormously helpful to see it!
This code:

Code: Select all

INSTALL @lib$+"multiwin.bbc"
PROC_multiwin(1)
Causes this error:

Code: Select all

DIM space in module /home/zeem/bbcsdl/lib/multiwin.bbc
The line in multiwin.bbc that's causing the problem is this:

Code: Select all

DIM Vdu{(Q%)}=@vdu{},Win{(Q%) hwnd%%,hdc%%,cmc&,cx%,cy%}
I've just tried it on my Windows 10 laptop and multidem.bbc works OK there.

Thanks again.

guest
Posts: 268
Joined: Mon 02 Apr 2018, 09:12

Re: Multiwin not working in 0.26a

Post by guest » Sat 24 Nov 2018, 14:00

zeem wrote:
Sat 24 Nov 2018, 11:41
I'm running Linux, specifically Linux Mint 18.3 64-bit.
OK, I understand. It's not a problem with 'multiwin.bbc' at all, but arises because you are running 64-bit Linux. 32-bit BBC BASIC assumes that 'user memory' is allocated in the bottom half of the memory map (that is, addresses below &80000000) because in Windows that is guaranteed: higher addresses are reserved for the Operating System. 64-bit Linux does not make that guarantee and I expect that if you run 'about.bbc' (in the examples folder) you will find that either the heap or the static integer variables (or both) are allocated above that address; the consequence is that the addresses appear to be 'negative' and you receive the DIM space error.

Your best bet is not to try to run 32-bit BBCSDL on 64-bit Linux, but to run the 'experimental' 64-bit edition instead. It can be downloaded from the usual place, or via this direct download link. Many Linux users do not like to - and often will not - install the 'multiarch' support necessary to run 32-bit applications on 64-bit Linux, so before too long I expect the 64-bit Linux edition of BBCSDL to become the 'standard' edition.

zeem
Posts: 3
Joined: Thu 22 Nov 2018, 23:43

Re: Multiwin not working in 0.26a

Post by zeem » Sun 25 Nov 2018, 14:31

Many thanks for that - it's now running, with the small change that I had to change the variable for the window handle to a 64-bit one.

I understand that this is an experimental version, but I'm having problems with the debug window and compiling. Should I open new threads about these in the appropriate subforums?

guest
Posts: 268
Joined: Mon 02 Apr 2018, 09:12

Re: Multiwin not working in 0.26a

Post by guest » Sun 25 Nov 2018, 18:05

zeem wrote:
Sun 25 Nov 2018, 14:31
Should I open new threads about these in the appropriate subforums?
I don't think that would achieve anything. The dependence of the debugger/profiler (and some other features) on there being an assembler has been discussed at length previously; the view was expressed by somebody that BBC BASIC no longer needs an assembler, but the loss of those features is a high price to pay (I know that in principle it might be possible to compile a position-independent 'binary blob' in something like C, but I don't have the experience to know how to do it).

The problem is well understood, but solutions are hard to find.

Post Reply