Page 1 of 1

Structure prototypes in Structure DIMs

Posted: Tue 12 Feb 2019, 22:27
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

Re: Structure prototypes in Structure DIMs

Posted: Thu 14 Feb 2019, 21:55
by hellomike
Hi,

Actually it very much is in the manual!

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

Regards,

Mike

Re: Structure prototypes in Structure DIMs

Posted: Thu 14 Feb 2019, 23:37
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