BBC BASIC for Windows
« Programming Windows »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:55pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Programming Windows  (Read 693 times)
PaoloR
New Member
Image


member is offline

Avatar




PM


Posts: 4
xx Programming Windows
« Thread started on: Oct 5th, 2012, 03:14am »

I notice that it is possible to program Windows by either using SYS commands to access the Windows API or using the various Windows libraries provided with BBC Basic. It seems to me that the libraries provide a useful abstraction of the API. Why would one use SYS rather than the libraries? Is it because the libraries only contain a sub-set of the API? Are there any other reasons?

I'm still exploring BBC Basic, hence the question.

TIA
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Programming Windows
« Reply #1 on: Oct 5th, 2012, 08:43am »

on Oct 5th, 2012, 03:14am, PaoloR wrote:
Why would one use SYS rather than the libraries? Is it because the libraries only contain a sub-set of the API?

Yes. It would be impractical to wrap every single Windows API in a library (there are many thousands of them!) and it would impact on both program size and speed.

If an API can straightforwardly be called 'inline' from BBC BASIC by means of a simple SYS statement then there is no good reason not to do so. However when the API needs a significant degree of supporting code (perhaps to convert parameters to a different format, or to manage memory buffers, or because some assembler code is required) then wrapping it in a PROC or FN makes sense. If that PROC or FN is likely to be of 'general' use then it is appropriate to put it into a library.

Of course there are very many API calls which aren't straightforward to use but neither is there an existing BB4W library to access them. They are waiting for the need to arise and for somebody to create and submit a suitable library!

Richard.
User IP Logged

PaoloR
New Member
Image


member is offline

Avatar




PM


Posts: 4
xx Re: Programming Windows
« Reply #2 on: Oct 5th, 2012, 09:38am »

Richard: thanks. That seems like a sensible division if responsibilities between 'simple' and complex.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls