BBC BASIC for Windows
« Syntax error??? »

Welcome Guest. Please Login or Register.
Apr 6th, 2018, 12:21am



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: Syntax error???  (Read 592 times)
coolguy
New Member
Image


member is offline

Avatar




PM


Posts: 7
xx Re: Syntax error???
« Reply #2 on: Apr 5th, 2013, 10:13am »

Hi Richard

I was unaware of any such syntax, thank you for clearing it up, works perfectly well now. Thanks a lot.

Regards

User IP Logged

JGHarston
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 52
xx Re: Syntax error???
« Reply #3 on: May 13th, 2013, 9:36pm »

on Apr 4th, 2013, 1:05pm, coolguy wrote:
CASE Choice% OF
WHEN 4 PRINT "4 sided dice thrown, score "; Dice1
WHEN 6 PRINT "6 sided dice thrown, score "grinice2
WHEN 12 PRINT "12 sided dice thrown, score "grinice3
WHEN <> 4 OR 6 OR 12 PRINT "ERROR"
ENDCASE
The parameters to WHEN are a constant expression, just like any other constant expression. What happens if you do:
PRINT 4
PRINT 6
PRINT <> 4 OR 6 OR 12

Often the simplest way to start debugging a piece of code is to PRINT each of the parameters and see what happens.

on Apr 5th, 2013, 10:13am, coolguy wrote:
I was unaware of any such syntax, thank you for clearing it up, works perfectly well now. Thanks a lot.
Help -> Help topics -> CASE
« Last Edit: May 13th, 2013, 9:36pm by JGHarston » 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