BBC BASIC for Windows
« *Commands in BB4W »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:14pm



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: *Commands in BB4W  (Read 845 times)
mohsen
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 39
xx *Commands in BB4W
« Thread started on: Nov 19th, 2008, 11:29pm »

*Commands behavior in BB4W differs slightly from that on the BBC Microcomputer and Acorn RISC-OS. I found that be coincidence while trying to experiment to crash the interpreter smiley

The difference which I have so far found out are:

1. The *Command does not need to be followed by a space. So, for example, you could type *DIR*.* to list all files in current folder. or *SYS1.

2. Once the initial part of the *Command text is recognized as valid then the interpreter executes the *Command, and if the *Command takes no parameters, the interpreter ignores the rest of the text.

For example you could type:
*Help_me_now_please -----> same as *HELP
OR
*HELPUS -----> same as *HELP
OR
*QUITNOW -----> same as *QUIT

Such use on RISC-OS would give error reports as unrecognised command or module.

This does not mean that you use the above in your code (you shouldn't), because future versions of BB4W may behave differently.

It is just interesting to know how BB4W works.


User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: *Commands in BB4W
« Reply #1 on: Nov 20th, 2008, 08:35am »

Quote:
The *Command does not need to be followed by a space.

This is the same as on the BBC Micro, BBC Master etc:

Code:
*FX8,7 

Quote:
Once the initial part of the *Command text is recognized as valid then the interpreter executes the *Command

This is really the same thing (i.e. no space separator is required).

My reference for the syntax of BBC BASIC and OS commands is the BBC Microcomputer (and BBC Master etc.) not any RISC OS based machine. I have never owned nor used an Acorn Archimedes or later model, so if changes were made to the syntax I would not be aware of them.

Acorn don't seem to have been as concerned with maintaining compatibility with the BBC Micro as I was.
When I designed BBC BASIC for Windows I never considered not supporting MODE7 or ENVELOPE, and it surprised me when I discovered that Acorn had removed those features in the Archimedes.

Richard.
User IP Logged

mohsen
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 39
xx Re: *Commands in BB4W
« Reply #2 on: Nov 20th, 2008, 09:10am »

the last time I used a BBC Micro was (if I remember correctly) around 1985/86 (it was BBC Master). But later on have used most Acorn computers since the early Archimedes machines to the RISC-PC. I have stopped touching the RISC-OS for 10 years (since 1998).

What made me go back to the old days is two (2) applications:

1. Virtual RISC-PC (on Windows), and
2. BB4W

Many changes have been introduced by Acorn over the years to the RISC-OS Operating System, but I think the OS is lagging behind and I consider it dead.

I am currently doing a comparison of BB4W and Basic V (as on RISC-OS) to see if there are any differences on the results/outputs of the different BASIC Keywords. Obviously there are many and I hope I can list them on the BB4Wwiki in due time.

This is the reason you may find me asking some strange questions on some of the internals of the language smiley
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: *Commands in BB4W
« Reply #3 on: Nov 20th, 2008, 1:25pm »

Quote:
I am currently doing a comparison of BB4W and Basic V (as on RISC-OS) to see if there are any differences on the results/outputs of the different BASIC Keywords.

You can expect to find that they are very similar so long as the 'official' (unpublished!) syntax is followed. As soon as you depart from that syntax (for example by omitting spaces or colons) then there's no reason to expect identical behaviour, because the interpreters were developed independently.

It's an important difference between compilers and interpreters. Compilers often perform a strict syntax check of the source program; if you depart from that syntax you can expect the compiler to report an error. Interpreters, which parse the source code at run-time, can't afford the overhead of strict syntax checking, because it would both slow execution and increase the size of the interpreter.

Of course there's nothing to prevent an off-line syntax check being performed by the IDE before the program is actually run by the interpreter, but most implementations don't bother with that (no version of BBC BASIC does as far as I know).

Where BASIC 4 and BASIC 5 differ, you should (hopefully) find that BB4W follows the BASIC 4 behaviour - obvious examples are SOUND and @%. BASIC 4 is the 'reference' version of BBC BASIC as far as I'm concerned.

Where BB4W has incorporated some of the BASIC 5 'extras' the spirit of BBC BASIC has been followed, but not necessarily the exact same syntax. For example ON ERROR LOCAL works significantly differently.

The way I explain it is that Acorn's BASIC 5 and BBC BASIC for Windows are both developments of BBC BASIC 4, but they have to some extent gone their own separate ways. The divergence happened after the BBC was no longer responsible for agreeing the specification with Acorn, and the 'Wilson' and 'Russell' variants of BBC BASIC took slightly different paths.

Richard.
User IP Logged

JGHarston
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 52
xx Re: *Commands in BB4W
« Reply #4 on: Aug 6th, 2010, 3:06pm »

Code:
>*FX0

OS 3.20
>*CATALOG

Bad command
>*CAT
JGH   (092)   Owner
User          Option 02 (Run)
Dir. JGH      Lib. Library

!Choices  DL/ !ToDo  WR/r  !ToDo2  WR/r   a  WR/r
etc...
 

*command names are terminated by a non-letter, so *FX 1 (terminated by space) *FX1 (terminated by '1') match as *FX, but *FXZ does not match as *FX. Similarly, *SAVER does not try to save a file called 'R', but tries to execute a command called 'SAVER'.
Unfortunately, sloppy sideways ROM writers could mess up their command table scanning code. I have a ROM that matches '*PRL' to anything which means I can't use '*PRLIST' whenever I have it inserted.
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