Go to Post I knew you guys were really smokin' at Championships. I just didn't realize how much! - Mark McLeod [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-02-2006, 01:02
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
Question Commenting out in EasyC?

Anyone know if putting in two User Code blocks with "/*" and "*/" (sans quotes) will work to comment out the blocks in-between?
I want to comment out large chunks of code including conditions (if, while, etc.) and without having to click on every block.


Edit: Oops! I forgot there was a separate EasyC forum. Mods, wanna move this? Sorry.

Last edited by P1h3r1e3d13 : 20-02-2006 at 19:25. Reason: See post
  #2   Spotlight this post!  
Unread 20-02-2006, 02:51
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Commenting out in EasyC?

EDIT: I'm not entirely postive that will work in EasyC, it's standard C so I think it will. Let me know if it does?

Instead of doing /* and */ do this

Old way:
Code:
/*
int myvar = 0;

Default();
Code();
DoStuff();
*/
Better way:
Code:
#if 0 // Will never be satisfied
int myvar = 0;

Default();
Code();
DoStuff();
#endif
Pre-processor directives won't be succeptible to comment blocks in the block you're trying to comment. Good luck!
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)

Last edited by Matt Krass : 20-02-2006 at 02:55. Reason: Second thought
  #3   Spotlight this post!  
Unread 20-02-2006, 15:14
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
Re: Commenting out in EasyC?

Aha - good idea!

if (0)
{
I would have thought of that.
}

Thanks


edit:
Is there no way then to comment out (or otherwise render irrelevant) one "elseif" from the middle of a string of them?

Last edited by P1h3r1e3d13 : 20-02-2006 at 15:46. Reason: New question
  #4   Spotlight this post!  
Unread 20-02-2006, 15:50
Francis-134's Avatar
Francis-134 Francis-134 is offline
Lifer
FRC #0190 (Gompei and the Herd)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Worcester, MA
Posts: 598
Francis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond repute
Re: Commenting out in EasyC?

A very easy way to comment out blocks is to simply right click them, then hit "comment out block". From my experience, this does not work with entire, long statements such as an if, else, for etc., but it will work with individual blocks and user functions.
__________________

Email | Twitter | Facebook | YouTube | Twitch
iTunes Podcast | Snapchat

A proud alumnus of teams 134 and 40 || Mentor of Team 190 || Director of Fun for BattleCry@WPI
  #5   Spotlight this post!  
Unread 20-02-2006, 19:22
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
Re: Commenting out in EasyC?

Thanks - I'd gotten that part, but as you noted, it doesn't work on conditions, and you can't comment out multiple blocks in one fell swoop.
  #6   Spotlight this post!  
Unread 20-02-2006, 19:26
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
Red face Re: Commenting out in EasyC?

Oops!
I just realized I put this in the wrong forum - sorry, mods.

Could the EasyC forum (and its subforums, natch) be itself made a subforum of the programming forum. That would seem to make more sense; I know I would have found it that way.

Last edited by P1h3r1e3d13 : 20-02-2006 at 19:33. Reason: Added suggestion
  #7   Spotlight this post!  
Unread 22-02-2006, 10:21
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Commenting out in EasyC?

*/ and /*

works very well in the User Code Block
  #8   Spotlight this post!  
Unread 24-02-2006, 15:27
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
Smile Re: Commenting out in EasyC?

Oh good - thanks.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EasyC Wish List dcbrown Programming 32 14-08-2006 09:24
EasyC v2.0 is mandatory for FVC! skimoose FIRST Tech Challenge 7 14-01-2006 18:37
Kickoff easyC workshop integrated into EasyC help file Dan Larochelle Programming 0 11-01-2006 06:12
EasyC v. 2.0 - New features, custom user functions, and more! artdutra04 FIRST Tech Challenge 1 02-11-2005 13:36


All times are GMT -5. The time now is 01:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi