ROBOTC.net forums
http://robotc.net/forums/

RobotC Hiding Parts of Code
http://robotc.net/forums/viewtopic.php?f=1&t=5612
Page 1 of 1

Author:  DiMastero [ Wed Mar 13, 2013 5:47 pm ]
Post subject:  RobotC Hiding Parts of Code

Hey,

I'm having a sort of weird problem in RobotC 3.54: when my code gets really long (width-wise, not necessarily length-wise), parts of it are invisible. It still feels like it's there (I can click to specific parts of it, and the scroll bar is the right size to still reach where the code would end were I able to see it), and it executes just fine; I just can't see it.

Although it's not exact or always the same, the text starts being hidden after scrolling to the right about 3/2 of my screen (1920 pixels wide).

Any idea what this might be and how I can prevent it without splitting my code onto new lines?

Thanks,
- Leon

EDIT: gremmer and speling

Author:  JohnWatson [ Fri Mar 15, 2013 6:12 pm ]
Post subject:  Re: RobotC Hiding Parts of Code

I attempted to replicate this issue and was able to in a way. By copying the text of a comment over and over again, there was a point there the ROBOTC IDE turned some of the text invisible; it was still there, but needed to be clicked on to be made visible again. However, this occurred after 272 individual words + spaces, and I'm not sure if your code approached that length or not. Would you be able to post the code here using the [code] tags for us to take a look at? I want to test the exact code you are using to see if I can replicate the issue.

Thank you in advance!

Author:  DiMastero [ Sat Mar 16, 2013 3:41 pm ]
Post subject:  Re: RobotC Hiding Parts of Code

Hey,

Thanks for the reply! The whole code is pretty long and irrelevant, but the exact line that's not displaying all the way is this:
Code:
lengthLimits[sizeof(jointLengths) / 2 - i - 2] = sqrt(pow(lengthLimits[sizeof(jointLengths) / 2 - (i + 1)], 2) + pow(jointLengths[sizeof(jointLengths) / 2 - (i + 2)], 2) - 2 * lengthLimits[sizeof(jointLengths) / 2 - (i + 1)] * jointLengths[sizeof(jointLengths) / 2 - (i + 2)] * cosDegrees(angle)); //calculate maximum reach using law of cosines
I can't see anything past this:
Code:
lengthLimits[sizeof(jointLengths) / 2 - i - 2] = sqrt(pow(lengthLimits[sizeof(jointLengths) / 2 - (i + 1)], 2) + pow(jointLengths[sizeof(jointLengths) / 2 - (i + 2)], 2) - 2 * lengthLimits[sizeof(jointLengths) / 2 - (i + 1)]
I do know the rest of the code is still there, and it's functional; it's just being displayed as if the space bar had been hit a number of times after where the visible code is truncated.

I've also had this problem in other places, like in filling big arrays with data generated on my computer. Once those get past about the same point, they become invisible too.

Thanks for your time,
- Leon

PS: I guess this could also be solved using word wrap. Is that planned to come to RobotC?

Author:  JohnWatson [ Thu Mar 21, 2013 11:05 am ]
Post subject:  Re: RobotC Hiding Parts of Code

Word wrap is already implemented in ROBOTC, in a sense. Since ROBOTC ignores whitespace (including newline spaces), you can essentially break down the code into separate lines:

Code:
   
Code:
lengthLimits[sizeof(jointLengths) / 2 - i - 2] = sqrt(pow(lengthLimits[sizeof(jointLengths) / 2
- (i + 1)], 2) + pow(jointLengths[sizeof(jointLengths) / 2 - (i + 2)], 2) - 2 * lengthLimits[sizeof(jointLengths) / 2
- (i + 1)] * jointLengths[sizeof(jointLengths) / 2 - (i + 2)] * cosDegrees(angle)); //calculate maximum reach using law of cosines


This should allow you to use the code as written without having to worry about the issue you ran into.

Author:  DiMastero [ Sun Mar 24, 2013 1:14 pm ]
Post subject:  Re: RobotC Hiding Parts of Code

Okay, I could do that. What about the cutting off issue though?

Author:  JohnWatson [ Mon Mar 25, 2013 4:04 pm ]
Post subject:  Re: RobotC Hiding Parts of Code

This is actually the first report we've had of this issue; since it is such a unique bug (the tested line of code had 272 characters (!), which is a rare occurrence) and there is already a simple workaround, we will add it to the bug list but it won't be the highest priority item on the list :)

Author:  magicode [ Sat Mar 30, 2013 8:54 am ]
Post subject:  Re: RobotC Hiding Parts of Code

Is it possibly related to this problem form a while back? http://www.robotc.net/forums/viewtopic. ... 00&p=11367

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/