Try... except.
Page 1 of 1

Author:  greenorange [ Sat Jun 13, 2015 2:34 am ]
Post subject:  Try... except.

    # Do something
   print "Error doing something"

This is how it works in python. Most other languages have some variation of this. What is this variation for RobotC, I've heard normal C doesn't have it but has this work around. It doesn't seem to work in RobotC.

Author:  mightor [ Sat Jun 13, 2015 4:44 am ]
Post subject:  Re: Try... except.

There is no support for user based exceptions, sorry.

= Xander

Author:  greenorange [ Sun Jun 14, 2015 12:46 am ]
Post subject:  Re: Try... except.

Thanks for the response.
Do you know what this error is?
PgmCnt: 0001A2
Type: 91

I'm guessing it's a maths error, I'm trying to triangulate an IR signal but the IR sensors don't seem very reliable. It may also be something to do with my internal positioning system.


It's a divide by 0 error coursed by this line of code:
int sidea = (botdist*sin(angleB))/(sin(angleA));

I made an if statement, only do above if angleA != 0

Author:  mightor [ Sun Jun 14, 2015 1:20 am ]
Post subject:  Re: Try... except.

If you have the debugger attached, it should tell you the exception type.

= Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group