OCCRA
Go to Post Your cat-bell skills are most impressive. - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 12-16-2013, 09:16 PM
thelegend thelegend is offline
Registered User
FRC #1325
 
Join Date: Jan 2013
Location: Canada
Posts: 7
thelegend is an unknown quantity at this point
C++ Toggle Button

I am trying to make a toggle for switching between Arcade Drive and Tank drive. I wrote and tested this code but the only result I get is a switch between Tank to Arcade, not the other way back. I have such a complicated system because I believe that if I simply set a variable to be True or False, it won't compensate for if the driver holds on to the button. That's why I have a clause in there that checks if the button has been released.

If you find any issues, please reply!


Code:
void OperatorControl(void)
	{
		bool boolval = false;
		bool toggle = true;
		bool toggle2 = false;
		
		feeder->Set(false);
		firingMech->Set(true);
		
		while (IsOperatorControl())
		{
			if(boolval){
			//Arcade Drive
				//Left Side
				leftMiddleMotor -> SetSpeed(primaryController -> GetRawAxis(5) - primaryController -> GetRawAxis(4));
				leftBottomMotor -> SetSpeed(primaryController -> GetRawAxis(5) - primaryController -> GetRawAxis(4));
				//Right Side
				rightTopMotor -> SetSpeed(-(primaryController -> GetRawAxis(5) + primaryController -> GetRawAxis(4)));
				rightMiddleMotor -> SetSpeed(-(primaryController -> GetRawAxis(5) + primaryController -> GetRawAxis(4)));
				rightBottomMotor -> SetSpeed(-(primaryController -> GetRawAxis(5) + primaryController -> GetRawAxis(4)));
				if(!(secondaryController -> GetRawButton(6))){
					toggle2 = true;
					printf("Status is: \n");
				} 
				if(secondaryController -> GetRawButton(6) && toggle2 == true){
					boolval = false;
					toggle2 = false;
					toggle = true;
				}
			}
			//Arcade - Tank Toggle Switch
				if(secondaryController -> GetRawButton(6)){
					boolval = true;
					toggle = false;
				}else if(toggle){
					// Left Motor Drivetrain
					if (primaryController -> GetRawAxis(2)){
							leftMiddleMotor -> SetSpeed(primaryController -> GetRawAxis(2));
							leftBottomMotor -> SetSpeed(primaryController -> GetRawAxis(2));
						}else{
							leftMiddleMotor -> SetSpeed(0.0);
							leftBottomMotor -> SetSpeed(0.0);
						}
					//Right Motor Drivetrain
					if (primaryController -> GetRawAxis(5)){
							rightTopMotor -> SetSpeed(-(primaryController -> GetRawAxis(5)));
							rightMiddleMotor -> SetSpeed(-(primaryController -> GetRawAxis(5)));
							rightBottomMotor -> SetSpeed(-(primaryController -> GetRawAxis(5)));
						}else{
							rightTopMotor -> SetSpeed(0.0);
							rightMiddleMotor -> SetSpeed(0.0);
							rightBottomMotor -> SetSpeed(0.0);
						}					//Tank
				}
			// Compression
			if (secondaryController -> GetRawButton(8)){
					compressor -> Set(Relay::kForward);
				}else{
					compressor -> Set(Relay::kOff);
				}

			//Lifter
			if (secondaryController -> GetRawAxis(2)){
					leftLifterMotor -> SetSpeed(secondaryController -> GetRawAxis(2));
					rightLifterMotor -> SetSpeed(-(secondaryController -> GetRawAxis(2)));
				}else{
					leftLifterMotor -> SetSpeed(0.0);
					rightLifterMotor -> SetSpeed(0.0);
				}
			//Conveyer
				//Conveyer go up
			if (secondaryController -> GetRawButton(3)){
					conveyer -> SetSpeed(1.0);
				}else{
					conveyer -> SetSpeed(0.0);
				}
				//Conveyer go down
			if (secondaryController -> GetRawButton(2)){
					conveyer -> SetSpeed(-1.0);
				}else{
					conveyer -> SetSpeed(0.0);
				}
			//Shooter Motor
			if(secondaryController -> GetRawButton(5)){
					shooterInner -> SetSpeed(-(secondaryController -> GetRawAxis(3)));
					shooterOuter -> SetSpeed(-(secondaryController -> GetRawAxis(3)));
				}else{
					shooterInner -> SetSpeed(0.0);
					shooterOuter -> SetSpeed(0.0);
				}
			//Shooter FIRE!!!!
			if(secondaryController -> GetRawButton(1)){
					firingMech -> Set(true);
				}else{
					firingMech -> Set(false);	
				}
			//Arouser
				//Arouser Up
			if(secondaryController -> GetRawButton(11)){
					feeder -> Set(true);
				}
				//Arouser Down
			if(secondaryController -> GetRawButton(10)){
					feeder -> Set(false);
				}
			}		
			Wait(0.05);
			
		
	}
Reply With Quote
  #2   Spotlight this post!  
Unread 12-16-2013, 10:35 PM
Domenic Rodriguez's Avatar
Domenic Rodriguez Domenic Rodriguez is offline
Registered User
FRC #0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Sep 2010
Rookie Year: 2011
Location: Grove City, PA
Posts: 213
Domenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura about
Re: C++ Toggle Button

One way to increase the readability of your code would be to use an enum to keep track of the drive mode. This also lets you simplify the logic for tracking the button press state:
Code:
void OperatorControl(void)
{
    typedef enum _DriveMode { kArcadeDrive, kTankDrive } DriveMode;

    DriveMode mode = kArcadeDrive;
    bool current, prev;
    prev = current = false;

    while (IsOperatorControl())
    {
        // Check the mode toggle button
        current = secondaryControler->GetRawButton(6);
        if (mode == kArcadeDrive) {
            // Arcade Drive code here...

            // Check for state chagne
            if (current && !prev)
                mode = kTankDrive;
        } else if (mode == kTankDrive) {
            // Tank Drive code here...

            // Check for state change
            if (current && !prev)
                mode = kArcadeDrive;
        }

        // Set old button value for next iteration
        prev = current;
    }

    // Other code goes here...
}
__________________

LuNaTeCs - Learning Under Nurturing Adults Teaching Engineering Concepts and Skills - Small and Mighty!

FRC 316 LuNaTeCs - Student (2011-2014), Lead Programmer (2011-2014), Team Captain (2013-2014), Operator (2013), Drive Coach (2014), Mentor (2015-????)
'11 Philly Regional Finalists, '13 Chestnut Hill Finalists, '13 Lenape Champions, '13 Archimedes Division, '14 Chestnut Hill Champions, '14 Lenape Champions
FTC 7071 EngiNerds - Founding Advisor (2013-2014) | FRC 5420 Velocity - Founding Advisor (2015)
Grove City College Class of '18, Electrical/Computer Engineering (B.S.E.E)

Reply With Quote
  #3   Spotlight this post!  
Unread 12-17-2013, 12:15 AM
jmullins16's Avatar
jmullins16 jmullins16 is offline
Registered User
AKA: Jeff Mullins
FRC #2135 (Presentation Invasion)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2011
Location: San Jose, CA
Posts: 34
jmullins16 is a glorious beacon of lightjmullins16 is a glorious beacon of lightjmullins16 is a glorious beacon of lightjmullins16 is a glorious beacon of lightjmullins16 is a glorious beacon of light
Re: C++ Toggle Button

Very nice answer. And to bring out a couple more subtle points displayed in the answer that will help understandability.

- Don't be afraid to use a bit more whitespace. Parentheses, brackets, and keywords all deserve attention and the whitespace gives the user visual focus. The answer example has a good balance of spacing.

- The code for managing the toggling is now grouped very tight and easily understood without paging around the drive code packed into it. This can be maintained by either putting the drive code into their own sub-functions, or simply making a new section immediately after the toggling code which re-checks the arcade/tank enum solely for the purpose of doing just the drive functions. There is no penalty for re-checking a value such as this.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-17-2013, 02:05 AM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 799
mikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to all
Re: C++ Toggle Button

This is one of the programming topics I teach my students: how to make something happen when a button is pressed or released. The first challenge is to detect button presses and releases as an edge event. The second challenge is to toggle a mode when a button is pressed. For the first challenge, detecting an edge event means to detect the transition between two states which means you need to remember the previous state and compare it with the current state. This could be done with two Boolean variables.
Code:
bool prevState = false;
bool currState = false;

while (IsOperatorControl())
{
    //
    // Check for button 6 press.
    //
    currState = secondaryController->GetRawButton(6);
    if (currState != prevState)
    {
        if (currState)
        {
            //
            // Button has been pressed.
            //
        }
        else
        {
            //
            // Button has been released.
            //
        }
        prevState = currState;
    }

    wait(0.02);
}
For the second challenge, you simply toggle a Boolean variable like this:
Code:
bool driveTankMode = false;

driveTankMode = !driveTankMode;
So put them all together:
Code:
bool prevState = false;
bool currState = false;
bool driveTankMode = false;

while (IsOperatorControl())
{
    //
    // Check for button 6 press.
    //
    currState = secondaryController->GetRawButton(6);
    if (currState != prevState)
    {
        if (currState)
        {
            //
            // Button has been pressed.
            //
            driveTankMode = !driveTankMode;
        }
        else
        {
            //
            // Button has been released.
            //
        }
        prevState = currState;
    }

    if (driveTankMode)
    {
        //
        // Do tank drive.
        //
   }
    else
    {
        //
        // Do arcade drive.
        //
   }

    wait(0.02);
}
You can use the edge event detection code to not only toggle a mode, you can do different things when a button is pressed and released. For example, some teams like to "slow down the robot when driving with a button pressed and held down". So you could have the "pressed event" to set the joystick divisor to 2.0 and the "released event" to set the divisor back to 1.0.
Our team even went further to define a joystick button class where the code will be called periodically to check for all button changes. When any button has changed state, it will do an event callback with the parameters specifying which joystick, which button and whether it was a pressed or released event. This greatly simplify our code. For example, our joystick class is TrcJoystick.
Code:
class MyRobot
    : public SimpleRobot
    , public ButtonNotify
{
private:
    TrcJoystick m_leftDriveStick;
    TrcJoystick m_rightDriveStick;

public:
    MyRobot(void)
        : m_leftDriveStick(1, this)    //joystick 1, call this class for button events
        , m_rightDriveStick(2, this)   //joystick 2, call this class for button events
    {
    }

    void NotifyButton(
        UINT32 joystickNum,
        UINT16 bitButton,
        bool   fPressed
        )
    {
        if (joystickNum == 1)
        {
            switch (bitButton)
            {
                case Logitech_Trigger:
                    break;

                case Logitech_Btn2:
                    break;
            }
        }
        else if (joystickNum == 2)
        {
            switch (bitButton)
            {
                 case Logitech_Trigger:
                    break;

                case Logitech_Btn2:
                    break;
            }
        }
        else if (joystickNum == 3)
        {
            switch (bitButton)
            {
                 case Logitech_Trigger:
                    break;

                case Logitech_Btn2:
                    break;
            }
        }
    }
};
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 12-17-2013, 11:16 PM
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 550
SoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond repute
Re: C++ Toggle Button

Consider this:
Code:
class Posedge_toggle{
	bool value,last;

	public:
	Posedge_toggle():value(0),last(1){}

	void update(bool sample){
		if(sample&&!last) value=!value;
		last=sample;
	}

	bool get()const{ return value; }
};
//...

Posedge_toggle t;
while (IsOperatorControl())
{
    t.update(secondaryController->GetRawButton(6));
    if(t.get()){
        //do tank drive
    }else{
       //do arcade drive
    }
    wait(0.02);
}
It decouples the logic of how to make things toggle from the logic to read joysticks, etc.

Last edited by SoftwareBug2.0 : 12-17-2013 at 11:20 PM. Reason: Inconsistent variable name
Reply With Quote
  #6   Spotlight this post!  
Unread 12-18-2013, 12:14 AM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 799
mikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to all
Re: C++ Toggle Button

Sure, how about this? It is basically the same as your Posedge_toggle class except that it allows the update method to also return the switch state so you don't have to make the get call.
Code:
class ToggleSwitch
{
private:
    bool switchValue;
    bool prevInput;

public:
    ToggleSwitch(void)
        : switchValue(false)
        , prevInput(false)
    {
    }

    bool GetSwitchValue(void)
    {
        return switchValue;
    }

    bool UpdateSwitchValue(bool currInput)
    {
        if (currInput != prevInput)
        {
            if (currInput)
            {
                switchValue = !switchValue;
            }

            prevInput = currInput;
        }

        return switchValue;
    }
};

...
...
ToggleSwitch tankMode;

while (IsOperatorControl())
{
    //
    // Check for button 6 press.
    //
    if (tankMode.UpdateSwitchValue(secondaryController->GetRawButton(6)))
    {
        //
        // Do tank drive.
        //
    }
    else
    {
        //
        // Do arcade drive.
        //
    }
    wait(0.02);
}
__________________

Last edited by mikets : 12-18-2013 at 12:19 AM.
Reply With Quote
  #7   Spotlight this post!  
Unread 12-18-2013, 01:56 AM
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 550
SoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond repute
Re: C++ Toggle Button

Quote:
Originally Posted by mikets View Post
Sure, how about this? It is basically the same as your Posedge_toggle class except that it allows the update method to also return the switch state so you don't have to make the get call.
That would work too.

It seems like you've added a lot of unnecessary stuff though. You're made the class's code go from 13 lines to 33 while you could have made it do that by just adding one line:
Code:
class Posedge_toggle{
	bool value,last;

	public:
	Posedge_toggle():value(0),last(1){}

	bool update(bool sample){
		if(sample&&!last) value=!value;
		last=sample;
		return value; //this is the only new line
	}

	bool get()const{ return value; }
};
As for whether the code ought to work this way, I guess it's a matter of taste, but I prefer command-query seperation when possible.
Reply With Quote
  #8   Spotlight this post!  
Unread 12-18-2013, 03:05 AM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 799
mikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to all
Re: C++ Toggle Button

Interesting...
I ran a tool that counts line of code on the ToggleSwitch class code and it gave me:
Code:
                         Commented Comment Comment         LOC/semi
           Lines    LOCS      LOCS   Lines   Ratio   Semis    Ratio File Name
              32      16         0       0    0.00       7     2.29 togglesw.cpp

Totals        32      16         0       0    0.00       7     2.29
I ran the same tool on the Posedge_toggle class code and it gave me:
Code:
                         Commented Comment Comment         LOC/semi
           Lines    LOCS      LOCS   Lines   Ratio   Semis    Ratio File Name
              14      10         1       0    0.05       6     1.67 posedge.cpp
Totals        14      10         1       0    0.05       6     1.67
It is true that my total number of lines in the file is 32 but that includes blank lines and potential comments which makes the code readable. Therefore, it is more meaningful to count real lines of code. The actual number of lines of real code is only 16. Teaching the students to write readable code is one of my priorities and breaking the lines up is one of the techniques. So I just want to make sure students reading it understand it better.
__________________

Last edited by mikets : 12-18-2013 at 03:31 AM.
Reply With Quote
  #9   Spotlight this post!  
Unread 12-19-2013, 12:01 AM
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 550
SoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond repute
Re: C++ Toggle Button

Quote:
Originally Posted by mikets View Post
I ran a tool that counts line of code on the ToggleSwitch class code ...
What tool are you using? I might be interested in trying that out.

I think there is value in having a count of physical lines too though. For example, it controls how much you can see in an editor.
Reply With Quote
  #10   Spotlight this post!  
Unread 12-19-2013, 12:18 AM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 799
mikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to all
Re: C++ Toggle Button

Quote:
Originally Posted by SoftwareBug2.0 View Post
What t ool are you using? I might be interested in trying that out.
That's a proprietary tool from where I worked. But I am sure there are lots of similar open sourced or free tools you can find on the Internet. In fact, I just googled "source code line counter" and got a whole bunch of hits.
__________________

Last edited by mikets : 12-19-2013 at 12:24 AM.
Reply With Quote
  #11   Spotlight this post!  
Unread 12-19-2013, 08:58 PM
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 550
SoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond repute
Re: C++ Toggle Button

Quote:
Originally Posted by mikets View Post
That's a proprietary tool from where I worked. But I am sure there are lots of similar open sourced or free tools you can find on the Internet. In fact, I just googled "source code line counter" and got a whole bunch of hits.
Eh, I was mostly interested in trying that exact tool because I can't figure out why it said 32 instead of 33 lines.
Reply With Quote
  #12   Spotlight this post!  
Unread 12-19-2013, 09:54 PM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 799
mikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to all
Re: C++ Toggle Button

Quote:
Originally Posted by SoftwareBug2.0 View Post
Eh, I was mostly interested in trying that exact tool because I can't figure out why it said 32 instead of 33 lines.
That could be due to an extra blank line removed when I copied and pasted the code into notepad when doing the counting. It all depends on the editor if they add/remove blank line at the end of the file (i.e. an extra 0x0d/0x0a).
__________________
Reply With Quote
  #13   Spotlight this post!  
Unread 12-19-2013, 10:29 PM
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 550
SoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond repute
Re: C++ Toggle Button

Quote:
Originally Posted by mikets View Post
That could be due to an extra blank line removed when I copied and pasted the code into notepad when doing the counting. It all depends on the editor if they add/remove blank line at the end of the file (i.e. an extra 0x0d/0x0a).
But that would possibly get you one more line than expected rather than one less.
Reply With Quote
  #14   Spotlight this post!  
Unread 12-19-2013, 11:25 PM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 799
mikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to allmikets is a name known to all
Re: C++ Toggle Button

Quote:
Originally Posted by SoftwareBug2.0 View Post
But that would possibly get you one more line than expected rather than one less.
Like I said, I don't really care about the physical number of lines whether it's more or less, I only care about the readability of the code.
__________________
Reply With Quote
  #15   Spotlight this post!  
Unread 12-20-2013, 12:26 AM
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 550
SoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond reputeSoftwareBug2.0 has a reputation beyond repute
Re: C++ Toggle Button

Quote:
Originally Posted by mikets View Post
Like I said, I don't really care about the physical number of lines whether it's more or less, I only care about the readability of the code.
It may render differently in your browser, but reading the longer version requires me to scroll. When things get longer it doesn't always make them easier to read.
Reply With Quote
Reply


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


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

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


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