Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem with Case If (Read 3316 times)
James Brown
Junior Member
**
Offline


Posts: 46
Location: Near San Diego
Joined: Jul 31st, 2012
Problem with Case If
Nov 5th, 2012 at 3:15am
Print Post  
There doesn't seem to be a way to insert a breakpoint in a code snippet like this:

case 1:
   if (data == 0x62)
     step ++;
  else
     step = 0
  break;

The compiler spits out 'else' without a previous 'if' when I attempt to set a breakpoint on step ++

Is there a workaround?
Regards.... Jim
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem with Case If
Reply #1 - Nov 5th, 2012 at 7:42am
Print Post  
yes this problem is sort of documented on the beta page.

the only workaround is to place the breakpoint somewhere else or change the code so that the if has braces. 

you can add conditions to breakpoints so the "if" can be re-created as the breakpoint condition allowing the breakpoint to be placed before or after the existing "if"
  
Back to top
IP Logged
 
James Brown
Junior Member
**
Offline


Posts: 46
Location: Near San Diego
Joined: Jul 31st, 2012
Re: Problem with Case If
Reply #2 - Nov 5th, 2012 at 2:40pm
Print Post  
Thanks Tim.  I found the description after I posted.
For others this seems to work well:

case 1:
   if (data == 0x62)
   {
     step ++; // now a breakpoint here
   }
  else
     step = 0
  break;
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint