Author |
Topic: Tutorial for BBC BASIC (Read 1669 times) |
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: Tutorial for BBC BASIC
« Reply #3 on: Mar 21st, 2014, 4:05pm » |
|
on Mar 21st, 2014, 12:15pm, Richard Russell wrote:... this isn't:
Code: IF condition% THEN (label)
It would theoretically be possible for me to change BB4W v6 so that the second example does work. Like all such modifications it would inevitably slow down execution slightly. Is it something you think I should consider? |
|
Hi Richard,
My tuppence:
If it would slow down *all* IF..THEN statements (or those calling a procedure/function), then I would say definitely not: an additional note in the manual that GOTO is required with a label would be adequate.
If it would only slow down explicit or implicit GOTOs, then I don't greatly care. However, it seems to me (but what do I know) a lot of effort to have to parse the bit after THEN to see if it's a label when it almost never will be - or is there no other situation in which it could start with a bracket?
Best wishes,
D
|
|
Logged
|
|
|
|
Edja
Developer
member is offline


Posts: 60
|
 |
Re: Tutorial for BBC BASIC
« Reply #4 on: Mar 21st, 2014, 7:12pm » |
|
on Mar 21st, 2014, 12:15pm, Richard Russell wrote:It would theoretically be possible for me to change BB4W v6 so that the second example does work. Like all such modifications it would inevitably slow down execution slightly. Is it something you think I should consider? |
|
The statement IF ... THEN GOTO (label) doesn't add anymore to the value of BB4W and only encourages bad programming habits.
IF... THEN... ELSE + the different loops : REPËAT ... UNTIL, FOR ... NEXT, WHILE... ENDWHILE + the CASE statement provide us with ample and better alternatives for well structured programming. The concepts of PROC's and FN's are absolutely within the reach of even the beginning programmer if willing to look at a tutorial.
If you want to incorporate this in V6 you may spread yourself to thin to implement a feature that virtually no-one will use at the cost of speed of execution and your personal available time that could otherwise be spent on more "worthy causes"
Please don't consider it. Eddy
|
|
Logged
|
|
|
|
rtr
Guest
|
 |
Re: Tutorial for BBC BASIC
« Reply #5 on: Mar 21st, 2014, 10:35pm » |
|
on Mar 21st, 2014, 4:05pm, DDRM wrote:| or is there no other situation in which it could start with a bracket? |
|
My assumption is that there isn't - unless you know different! Because of the way labels were shoehorned in you get inconsistencies like this:
Code: PRINT "Hello "; : (ignored) PRINT "world!" The 'label' is completely ignored (apart from a slight execution-time penalty); it can't be used as the destination of a GOTO because it's not at the start of a line. Effectively it's like a mid-line comment!
Richard.
|
|
Logged
|
|
|
|
Wendell
New Member
member is offline


Posts: 28
|
 |
Re: Tutorial for BBC BASIC
« Reply #6 on: Mar 21st, 2014, 11:01pm » |
|
That information was so valuable to me. My grandkids and i finish the project "Tenmads Math Quiz" Thanks to you and the others Wendell
|
|
Logged
|
|
|
|
|