BBC BASIC
« BBC Basic Beginner »

Welcome Guest. Please Login or Register.
Mar 31st, 2018, 10:39pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Cross-platform BBC BASIC (Windows, Linux x86, Mac OS-X, Android, iOS, Raspberry Pi)
BBC BASIC Resources
BBC BASIC Help Documentation
BBC BASIC for Windows Home Page
BBC BASIC Programmers' Reference
BBC BASIC Beginners' Tutorial
BBC BASIC for SDL 2.0 Home Page
BBC BASIC Discussion Group

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: BBC Basic Beginner  (Read 292 times)
kf4595
New Member
Image


member is offline

Avatar




PM


Posts: 4
xx BBC Basic Beginner
« Thread started on: Feb 26th, 2018, 08:54am »

Hello,

I am a student currently studying mathematics. I am looking to learn more about how computers work while attempting to write some simulations and maybe a simple render-er.

I am interested in using the Windows API as I thought this might help be less abstract than using a higher level API such as .NET. I have looked into using C or a BASIC dialect which can target the Windows API, which is how I came about finding BB4W.

Again I don't know enough about this topic to know the pros and cons about either choice. One thing I do like about BB4W is the built-in documentation which you don't get with any C compiler as far as I am aware.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: BBC Basic Beginner
« Reply #1 on: Feb 26th, 2018, 10:35am »

on Feb 26th, 2018, 08:54am, kf4595 wrote:
I have looked into using C or a BASIC dialect which can target the Windows API, which is how I came about finding BB4W.

Welcome! Fortunately it's usually not difficult to convert Microsoft's API documentation at MSDN to the equivalent BBC BASIC syntax. MSDN uses C-language function templates throughout so if you know a little C syntax it may help.

I would suggest that you start by looking at the section of the BB4W Help file on Accessing the Windows API. There you will find many (usually simple) examples of translations of Windows API calls to BBC BASIC. By comparing them with what's documented at MSDN you should begin to see a pattern!

It's only fair to point out that some of the more 'modern' Windows API functions are object-based (using the Component Object Model standard) and they can be considerably harder to translate into BASIC. If you want to delve into those complexities there is a Wiki article on the subject here.

Richard.
User IP Logged

kf4595
New Member
Image


member is offline

Avatar




PM


Posts: 4
xx Re: BBC Basic Beginner
« Reply #2 on: Feb 26th, 2018, 11:31am »

Hi Richard,

Thanks for the prompt response!

I am somewhat familiar with the C syntax, by no means an expert just covered the very fundamentals from a course I took a few years back. Although I do have a pocket reference laying around somewhere which might come in handy.

After spending sometime researching the Windows API I came across a few recommendations for an older book, "Programming Windows Fifth Edition" by Charles Petzold so I have ordered that and will look at going through that and possibly writing the examples in BB4W (that's if the book is still relevant).

I am not yet sure what parts of the API I will be using but I will keep this wiki page in mind. FYI it looks as if Wikispaces are closing down.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: BBC Basic Beginner
« Reply #3 on: Feb 26th, 2018, 12:52pm »

on Feb 26th, 2018, 11:31am, kf4595 wrote:
"Programming Windows Fifth Edition" by Charles Petzold

I learned how to write BB4W from that book, about 18 years ago (I can hardly believe it)!

Quote:
FYI it looks as if Wikispaces are closing down.

Supposedly, in September (there's a thread about it elsewhere on this forum), however the warning banner that they were displaying on every page has now gone. I'm not sure what that means.

Richard.
User IP Logged

kf4595
New Member
Image


member is offline

Avatar




PM


Posts: 4
xx Re: BBC Basic Beginner
« Reply #4 on: Feb 26th, 2018, 1:26pm »

on Feb 26th, 2018, 12:52pm, Richard Russell wrote:
I learned how to write BB4W from that book, about 18 years ago (I can hardly believe it)!

Wow that is impressive, well hopefully I can reach the same level of success with this book. Maybe one day I will write my own compiler. Just out of curiosity, I also looked at Powerbasic which is a compiler rather than interpreter but what was your thought process when you decided you wanted to create BB4W as a interpreter rather than compiler? Also was BB4W written in C?
on Feb 26th, 2018, 12:52pm, Richard Russell wrote:
however the warning banner that they were displaying on every page has now gone. I'm not sure what that means.

The banner was present for me, might be due to your browser cache if you are not seeing it.

« Last Edit: Feb 26th, 2018, 1:29pm by kf4595 » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: BBC Basic Beginner
« Reply #5 on: Feb 26th, 2018, 5:07pm »

on Feb 26th, 2018, 1:26pm, kf4595 wrote:
Wow that is impressive, well hopefully I can reach the same level of success with this book.

To be fair, what I meant was "port it to Windows". The interpreter already existed for the 8086 (I wrote it for the Z80 in 1982 or thereabouts). See A history of BBC BASIC.

Quote:
but what was your thought process when you decided you wanted to create BB4W as a interpreter

It didn't require a "thought process"; BBC BASIC has always been interpreted. Several features of the language make it 'impossible' to compile (the author of OWL BASIC some years ago argued otherwise, but I don't think he got very far).

Quote:
Also was BB4W written in C?

No, assembler.

Quote:
The banner was present for me, might be due to your browser cache if you are not seeing it.

Oh, OK.
User IP Logged

kf4595
New Member
Image


member is offline

Avatar




PM


Posts: 4
xx Re: BBC Basic Beginner
« Reply #6 on: Feb 26th, 2018, 7:43pm »

Interesting read about the history of BBC BASIC. Still an inspiring story that you have been involved with BBC BASIC all these years.
User IP Logged

KenDown
New Member
Image


member is offline

Avatar




PM


Posts: 49
xx Re: BBC Basic Beginner
« Reply #7 on: Mar 8th, 2018, 10:35am »

Er - Richard is not just "involved", he is the creator!

Like yourself I have a nodding acquaintance with C+, but I find BASIC - and BBC BASIC in particular - much easier to code for one simple reason.

When my program crashes, as it does frequently while I am writing it, you can easily debug it. For example, if the error is "No such variable" or "division by zero" or "out of range", the offending line is highlighted (and sometimes the offending statement) and you just type PRINTx% or whatever the variable name is. That will tell you if x% is the offender and what its value is/was at the moment of the crash.

Indeed, at times when I can't work out the problem, I will put the non-statement RUM on a line to bring the program to a crashing halt and then I can PRINT the different variables to check whether they are doing what I want at that point. If they are, I delete the first RUM and put another a line or two further on.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: BBC Basic Beginner
« Reply #8 on: Mar 10th, 2018, 11:09pm »

on Mar 8th, 2018, 10:35am, KenDown wrote:
Er - Richard is not just "involved", he is the creator!

I did not "create" BBC BASIC, that was (to the extent that it can be pinned on one person) Sophie Wilson.

Quote:
I will put the non-statement RUM on a line to bring the program to a crashing halt

Would not STOP be a better choice (it has the advantage of not changing ERR or ERL which may contain useful information for debugging)? Also, STOP will work even if an ON ERROR is active, which RUM will not!

Richard.
« Last Edit: Mar 10th, 2018, 11:16pm by Richard Russell » User IP Logged

michael
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 157
xx Re: BBC Basic Beginner
« Reply #9 on: Mar 11th, 2018, 12:07am »

Quote:
I did not "create" BBC BASIC, that was (to the extent that it can be pinned on one person) Sophie Wilson.


As I had researched long ago, Sophie Wilson did create BBC BASIC (the language) , but you created BBC BASIC for Windows and BBCSDL and all other related content.

I gather Sophie laid down the torch long ago. Perhaps long before BBC4W was released.. Correct?

Also, it would have been a large group of people behind BBC Basic, as I have seen there are many people in that picture with Sophie.

I know its a bit complicated, but as per conversation, anyone could make a new version of BBC Basic (and of course would have to rename it for copyright)

That person would have created that version of Basic.. but it would be a clone.
« Last Edit: Mar 11th, 2018, 12:07am by michael » User IP Logged

I like reinventing the wheel, but for now I will work on tools for D3D
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: BBC Basic Beginner
« Reply #10 on: Mar 11th, 2018, 10:18am »

on Mar 11th, 2018, 12:07am, michael wrote:
Also, it would have been a large group of people behind BBC Basic

Not really. Sophie designed the language syntax and semantics, and wrote the entire (6502) interpreter herself; that was typically the way things were done in those days. A few other people contributed to the BBC's specification, which of course drove some of Sophie's design decisions (and there was a little bit of compromise needed), but that was a small proportion of the total effort.

Quote:
anyone could make a new version of BBC Basic (and of course would have to rename it for copyright)

Or seek permission from the BBC to call it BBC BASIC, as I did. Generally people have chosen not to do that, which is why we have Brandy and Owl BASIC and others, but it's an option.

Richard.
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