Little improvment to Select Case statement

Post your requests and ideas on the future development of mikroBasic PRO for PIC.
Post Reply
Author
Message
kulla
Posts: 4
Joined: 15 May 2009 22:44

Little improvment to Select Case statement

#1 Post by kulla » 15 May 2009 22:48

I have one suggestion regarding Select State statements.

Now if I need to select more numbers or statements I can divide them by , but if I have a large difference like 25-90 it becomes pain to write all of them.

Suggestion is to add TO for numeric values, so it would be something like this

Select Case something
case 1 to 100

case 150 to 200

case else

end select

This was something that I missed in mikroBasic and thought that it's improved in Pro version.

Regards
Kulla

kulla
Posts: 4
Joined: 15 May 2009 22:44

#2 Post by kulla » 15 May 2009 23:29

One thing more because I can't edit my first post. Conditional statements could be also improved a bit so that we get nested if statemens in one line like

if something > 0 and something_else = 1 or something_more > 10 then

end if

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

Re: Little improvment to Select Case statement

#3 Post by Kalain » 16 May 2009 09:02

kulla wrote:I have one suggestion regarding Select State statements.

Now if I need to select more numbers or statements I can divide them by , but if I have a large difference like 25-90 it becomes pain to write all of them.

Suggestion is to add TO for numeric values, so it would be something like this

Code: Select all

Select Case something
          case 1 to 100 

          case 150 to 200

          case else

end select
This was something that I missed in mikroBasic and thought that it's improved in Pro version.

Regards
Kulla
Yes, I know, totally agree with you.
Have a look here.

http://www.mikroe.com/forum/viewtopic.p ... ght=select
Alain

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

#4 Post by zristic » 16 May 2009 09:16

kulla wrote:One thing more because I can't edit my first post. Conditional statements could be also improved a bit so that we get nested if statemens in one line like

if something > 0 and something_else = 1 or something_more > 10 then

end if
Use brackets:

Code: Select all

if (something > 0) and (something_else = 1) or (something_more > 10) then

kulla
Posts: 4
Joined: 15 May 2009 22:44

#5 Post by kulla » 16 May 2009 09:34

zristic wrote:
kulla wrote:One thing more because I can't edit my first post. Conditional statements could be also improved a bit so that we get nested if statemens in one line like

if something > 0 and something_else = 1 or something_more > 10 then

end if
Use brackets:

Code: Select all

if (something > 0) and (something_else = 1) or (something_more > 10) then
tnx for the help :-)

@Kalain: yes, we can assume that ME has bigger bugs/more important things to do, so this is not priority at all but it will come one day ;-)

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

#6 Post by Kalain » 16 May 2009 11:07

Hi,

May be I did too much Microsoft Visual Basic and thought this was standard Basic instructions. :roll:
Yes, I know, Microsoft is not the reference but.....
Alain

Post Reply

Return to “mikroBasic PRO for PIC Wish List”