Lazarus

Programming => General => Topic started by: pascal111 on May 03, 2021, 11:56:44 pm

Title: QBasic "is" equivalent in Pascal [SOLVED]
Post by: pascal111 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.  
Title: Re: QBasic "is" equivalent in Pascal
Post by: y.ivanov 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;

Title: Re: QBasic "is" equivalent in Pascal
Post by: pascal111 on May 04, 2021, 12:25:25 am
I got the idea. Thanks!
TinyPortal © 2005-2018