Break with lable option

Post your requests and ideas on the future development of mikroBasic PRO for PIC.
Post Reply
Author
Message
Maged A. Mohamed
Posts: 27
Joined: 26 Dec 2014 11:01
Location: Cairo
Contact:

Break with lable option

#1 Post by Maged A. Mohamed » 05 Aug 2015 12:53

Thanks for great products
My idea is for all compilers it is Break Command with optional lable

This is current Break in a body of a sub or function

Code: Select all

   result = $FF
   for i = 0 to 180            ' Wait for hi
        if  DHT2_Data then
            result=0                                   
            break
       end if
   next i
     if result = $FF then exit end if    ' Bad sensor "we need this step since we lost the knowledge of result and get here in all cases
My wish is if we can add an optional label like this

Code: Select all

   result = $FF
   for i = 0 to 180            ' Wait  for hi
       if  DHT2_Data then
            result=0                                  
            break (Good_Sensor)
       end if
   next i
     exit                        ' Bad sensor
Good_Sensor:
  . the rest of code go here for good sensor
  .
It will have a lot of potential uses and power

User avatar
biljana.nedeljkovic
mikroElektronika team
Posts: 1043
Joined: 30 Jun 2015 15:15

Re: Break with lable option

#2 Post by biljana.nedeljkovic » 06 Aug 2015 15:54

Hello Maged,

that is a good suggestion, I will inform our development team and they will take it under consideration for some future versions of compiler.

Best regards,
Biljana

Post Reply

Return to “mikroBasic PRO for PIC Wish List”