Structure prototypes in Structure DIMs

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
Zaphod
Posts: 78
Joined: Sat 23 Jun 2018, 15:51

Structure prototypes in Structure DIMs

Post by Zaphod »

In an other topic I recently wrote:

Code: Select all

DIM mi{s%, rm{l%,t%,r%,b%}, rw{l%,t%,r%,b%}, flag%}
and as I did this thought 'Why can't I define a Rect structure prototype and use that?' But I did not see how you could do that until I recently looked at one of Richard's SDL libraries where I found the equivalent to this.

Code: Select all

      DIM rect{l%,t%,r%,b%}
      DIM mi{s%, rm{}=rect{}, rw{}=rect{}, flag%}
Which seems so obvious in retrospect, but isn't in the manual. So I thought I would pass it along in case it is of interest to others.
Of course, I might have been the only one who had not cottoned on to this technique to start with!

Z
User avatar
hellomike
Posts: 184
Joined: Sat 09 Jun 2018, 09:47
Location: Amsterdam

Re: Structure prototypes in Structure DIMs

Post by hellomike »

Hi,

Actually it very much is in the manual!

http://www.bbcbasic.co.uk/bbcwin/manual ... tructproto

Regards,

Mike
Zaphod
Posts: 78
Joined: Sat 23 Jun 2018, 15:51

Re: Structure prototypes in Structure DIMs

Post by Zaphod »

Actually it very much is in the manual!
By George you are right! I read that bit but didn't see as being the same, but of course it is.
Thanks. I really must be losing it.

Z