elseif

Post your requests and ideas on the future development of mikroBasic.
Post Reply
Author
Message
intothefray
Posts: 33
Joined: 29 Apr 2005 18:02

elseif

#1 Post by intothefray » 23 May 2005 12:27

Would love to have an elseif statement.

Would also like to see if or elseif's to use less program memory. I realize there's a major difference but select case statements use MUCH less program memory than if statements.

Kalain
Posts: 1093
Joined: 11 Mar 2005 18:26
Location: Aubenas, France

#2 Post by Kalain » 06 Oct 2006 21:10

Hi,

Yes this would be nice :

Code: Select all

 
if statement1 then
    xxxx
elseif statement2 then
    yyyyy
elseif statement3 then
    zzzzz
elseif statement4 then
    aaaa
else
   bbbbb
end if
This is a bit like select case instruction

Code: Select all

Select case Temp
case statement1
    xxxx
case statement 2
    yyyyy
case statement3
    zzzzz
case statement4
    aaaa
case else
   bbbbb
end select
but "select case statement" allows only simple statement.

"If then elseif" accepts some more complicated statement like : if a<5 and b>5 then
Alain

MauroB
Posts: 14
Joined: 17 Sep 2009 16:33
Contact:

After 4 year, nothing change

#3 Post by MauroB » 02 Oct 2009 07:56

Hi to all, it seems to me the keyword elseif
does not exist. I would appreciate to have it.

User avatar
mileta.miletic
mikroElektronika team
Posts: 493
Joined: 05 Jun 2009 14:46
Location: Belgrade, Serbia
Contact:

#4 Post by mileta.miletic » 02 Oct 2009 15:33

Thanks for suggestion, we will consider this. You can use if then else statement as:

Code: Select all

if statement1 then
  PORTA=1
else if statement2 then
       PORTB=1
     else if statement3 then
            PORTC=1
          else if statement4 then
                 PORTD=1
               else
                 PORTD=2
               end if
          end if
     end if
end if
Regards,
Mileta

Post Reply

Return to “mikroBasic Wish List”