Help with statement Select Case in BASIC


Joined
Apr 19, 2022
Messages
4
Reaction score
0
Hi all and sorry for what is probably a stupid question. I am trying to translate in Pascal a program written in BASIC and I am stuck with a statement for which I do not find any documentation: the statement is

Select Case x
Case 21, 24, 25, 27 To 32, 34, 35, 38
etc.

I know
Case 21 To 28

but I am puzzled by the multiple ranges which I do not know how to understand!
Thanks in advance to whomever will reply
 
Ad

Advertisements

Joined
Apr 19, 2022
Messages
4
Reaction score
0
Thanks, but note that the syntax which I reported is not included

Case A, B, ..., H To M, N, ... W
 
Joined
Mar 28, 2022
Messages
42
Reaction score
5
If you're looking for additional assistance, then please post the code for the entire select/case statement.
You've already stated your understanding hasn't resolved the matter, so it's up to someone else to spot the issue.
 
Last edited:
Joined
Apr 19, 2022
Messages
4
Reaction score
0
Select Case X
Case 21, 24, 25, 27 To 32, 34, 35, 38
temp = temp - 1
Case 33, 36, 37, 39, 40
temp = temp - 2
End Select
 
Joined
Mar 28, 2022
Messages
42
Reaction score
5
Looks to me like the program makes an adjustment to temp based on categorization of x as belonging to one of three possible sets.

* A set where 1 is subtracted
* A set where 2 is subtracted
* Everything else where no change is applied

That's what this extra pair of eyes got for ya.
 
Last edited:
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top