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
 
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
82
Reaction score
11
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
82
Reaction score
11
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:
Joined
Aug 11, 2022
Messages
12
Reaction score
0
I realize it has been along time since the question, but I hate unanswered questions.

OK thanks but what is the set 1?

If X matches ANY of the conditions in the list, temp is reduced by 1
i.e. X can be
21,
24,
25,
any number from 27 To 32,
34,
35,
38
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top