Recent

Author Topic: QBasic "is" equivalent in Pascal [SOLVED]  (Read 619 times)

pascal111

  • Sr. Member
  • ****
  • Posts: 284
  • Un trabajo en equipo para programas serias.
QBasic "is" equivalent in Pascal [SOLVED]
« on: May 03, 2021, 11:56:44 pm »
Can I say in Pascal something like "is" in QBasic in "select case" statement, the QBasic equivalent of  "case of" in Pascal to be able to use "<, >, =" operators.

something like this:

Code: Pascal  [Select][+][-]
  1.  
  2. Var i : integer;  
  3. ...  
  4. Case i of  
  5.  is>3 : DoSomething;  // like here
  6.  1..5 : DoSomethingElse;  
  7. end;
  8.  
  9.  
« Last Edit: May 04, 2021, 12:25:47 am by pascal111 »

y.ivanov

  • Full Member
  • ***
  • Posts: 197
Re: QBasic "is" equivalent in Pascal
« Reply #1 on: May 04, 2021, 12:13:45 am »
Yup!
Code: Pascal  [Select][+][-]
  1. Var i : integer;  
  2. ...  
  3. Case i of  
  4.  1..5 : DoSomethingElse;
  5. otherwise if i > 3 then
  6.   DoSomething;  // like here
  7. end;


pascal111

  • Sr. Member
  • ****
  • Posts: 284
  • Un trabajo en equipo para programas serias.
Re: QBasic "is" equivalent in Pascal
« Reply #2 on: May 04, 2021, 12:25:25 am »
I got the idea. Thanks!

 

TinyPortal © 2005-2018