Hi all,
A quick question.
I cannot seem to get any results with the debug commands in SDLIDE 1.37a.
When I run the same code in BB4W I have good results.
The code is just a simple test.
print "jumboshrimp"
print 2 + 3
prin
SDLIDE just says "mistake"
BB4W executes the first 2 lines and then says "mistake" - I find this a bit more helpful.
What am I doing wrong I wonder?
Thx!
Johnny
Newbie help - BB4W vs BBC-SDL
-
- Posts: 7
- Joined: Fri 28 Jun 2019, 23:41
- Location: Michigan, USA
Re: Newbie help - BB4W vs BBC-SDL
What platform? If it's Windows, both BB4W and BBCSDL use (effectively) the identical BASIC interpreter, so code that runs in one but errors in the other really shouldn't be possible.JohnnyRockets wrote: ↑Fri 10 Nov 2023, 21:08 I cannot seem to get any results with the debug commands in SDLIDE 1.37a.
When I run the same code in BB4W I have good results.
Therefore I suspect 'finger trouble', for example if you really are entering keywords in lowercase (don't do that!) perhaps one is in *lowercase on mode and the other is in *lowercase off mode.
Below is a screenshot of your code (corrected to use keywords in capitals) running in BBCSDL:
You do not have the required permissions to view the files attached to this post.
-
- Posts: 7
- Joined: Fri 28 Jun 2019, 23:41
- Location: Michigan, USA
Re: Newbie help - BB4W vs BBC-SDL
Hi!
Hey, thanks for your help!
I know what my issue was.
I had no line numbers, so all it said was "mistake" with no indication of where, and I thought, "man that is not too helpful!", but it makes sense that the interpreter did not know how to reference the the mistake line.
No it all makes sense, thanks, sometimes just seeing someone else do the same thing, shows your own mistake.
Johnny
Sidenote: Your version is 1.38, but mine is only 1.37, is that because you're the developer?
Hey, thanks for your help!
I know what my issue was.
I had no line numbers, so all it said was "mistake" with no indication of where, and I thought, "man that is not too helpful!", but it makes sense that the interpreter did not know how to reference the the mistake line.
No it all makes sense, thanks, sometimes just seeing someone else do the same thing, shows your own mistake.
Johnny
Sidenote: Your version is 1.38, but mine is only 1.37, is that because you're the developer?
Re: Newbie help - BB4W vs BBC-SDL
If you're debugging (Run.. Debug Program, or the Beetle button in the toolbar) the line which caused the error is highlighted in reverse video, so you don't normally need line numbers. I do occasionally add them, but only temporarily for debugging purposes; I dislike line numbers in 'finished' programs, this isn't the 1980s!JohnnyRockets wrote: ↑Sat 11 Nov 2023, 18:02 I had no line numbers, so all it said was "mistake" with no indication of where
Well, yes, but it's more because I keep procrastinating and putting off releasing 1.38! I really will make an effort to do that in the next few days.Sidenote: Your version is 1.38, but mine is only 1.37, is that because you're the developer?
-
- Posts: 7
- Joined: Fri 28 Jun 2019, 23:41
- Location: Michigan, USA
Re: Newbie help - BB4W vs BBC-SDL
Thank you again, this if very helpful!
If I could ask another question, is it best to type in all caps, or turn on lowercase letters and then type that way? (I'm on Windows FWIW)
I believe the interpreter does not like lower case letters generally, correct?
Thank you,
John
If I could ask another question, is it best to type in all caps, or turn on lowercase letters and then type that way? (I'm on Windows FWIW)
I believe the interpreter does not like lower case letters generally, correct?
Thank you,
John
Re: Newbie help - BB4W vs BBC-SDL
Traditionally, BBC BASIC requires keywords to be entered in capitals. That includes the original Acorn versions (going back to 1981), Brandy and its derivatives (e.g. Matrix Brandy), and most other versions. With those, you have no choice.JohnnyRockets wrote: ↑Sat 11 Nov 2023, 20:29 is it best to type in all caps, or turn on lowercase letters and then type that way? (I'm on Windows FWIW)
I added the option to enable Lowercase Keywords in BBC BASIC for Windows and BBC BASIC for SDL 2.0, primarily for those moving from a dialect of BASIC which allows them (several do, for example Liberty BASIC). Some users find capital keywords 'ugly' or 'old fashioned'.
But enabling that option is not without issues. For example you may find that programs that you copy-and-paste from other places (for example here or the supplied demos) don't run, because they happen to contain a lowercase variable name which is recognised as a keyword.
And of course there's the issue that a lot of variable names become unusable, because with Lowercase Keywords enabled they start with a keyword e.g. printer (PRINT er), total (TO tal) etc., remembering that you can often omit spaces in BBC BASIC.
So it's up to you to weigh up the pros and cons. Incidentally the supplied 'Cross Reference' utility warns you if you've used a variable name which would be illegal in Lowercase Keywords mode.
- JeremyNicoll
- Posts: 73
- Joined: Sun 26 Jul 2020, 22:22
- Location: Edinburgh
Re: Newbie help - BB4W vs BBC-SDL
It's only the reserved words of the language that this matters for.JohnnyRockets wrote: ↑Sat 11 Nov 2023, 20:29 Thank you again, this if very helpful!
If I could ask another question, is it best to type in all caps, or turn on lowercase letters and then type that way? (I'm on Windows FWIW)a
If you turn on CAPS LOCK then you lose easy access to mixed case for
variable names and comments.
Comments, in particular, are much easier to read in mixed case.
Even when I've had to write code in languages where everything in the
code had to be in upper case, I used to put comments in mixed case to
make them stand out.
Re: Newbie help - BB4W vs BBC-SDL
Nobody is suggesting using capitals for everything, we've moved on from the days of the Teletype (or the ZX80)! The Help Documentation has this to say about Naming Conventions:JeremyNicoll wrote: ↑Sat 11 Nov 2023, 21:55 If you turn on CAPS LOCK then you lose easy access to mixed case for variable names and comments.
- You are recommended to adopt the following conventions when naming variables:
Local variables (e.g. variables with only a limited scope, formal parameters of functions and procedures, and variables declared in a LOCAL or PRIVATE statement) should be entirely in lower case (except for the static integer variables). For example number%, text$.
Global variables (i.e. those declared and used throughout your main program, and possibly accessed in functions or procedures) should use a mixture of lower case and capital letters. For example Click%, Title$.
Constants (i.e. variables set to a constant value during initialisation and never changed again) should be in all capitals. For example MAXFILES, VERSION$.
Following these recommendations will make your programs easier to understand and avoid problems such as an interrupt routine erroneously accessing a local variable instead of a global variable.
-
- Posts: 7
- Joined: Fri 28 Jun 2019, 23:41
- Location: Michigan, USA
Re: Newbie help - BB4W vs BBC-SDL
Thanks a ton guys! I'm obviously crazy new to BBC Basic, LOL!
I'm sure I'll have lots more very basic BBC questions, thanks for bearing with me!
I am really enjoying this language though.
Johnny
I'm sure I'll have lots more very basic BBC questions, thanks for bearing with me!
I am really enjoying this language though.
Johnny
Re: Newbie help - BB4W vs BBC-SDL
For completeness, whilst that is true of the Lowercase Keywords selection in the Options menu, the *LOWERCASE command is more far-reaching. That affects keywords, the 'e' in scientific notation numbers and hexadecimal constants.JeremyNicoll wrote: ↑Sat 11 Nov 2023, 21:55 It's only the reserved words of the language that this matters for.
So this code runs:
Code: Select all
*lowercase on
PRINT EVAL("pi")
PRINT 123e4
PRINT &abcd
Code: Select all
3.14159265
1230000
43981