if( yes != "no" ) // this will never be ran { no = "yes"; logicalYes = true; logicalFalse = false; if( (logicalYes && !logicalFalse) && yes == no ) // this will never be ran { while( !logicalFalse ) { if( logicalYes ) logicalYes = false; if( logicalFalse )// this will never be ran logicalFalse = false;
i believe i found them all but I'm under mod lock. >.<
this isnt as much of a typo as how much you can understand what the system is doing
Code Snippet
Plaintext
//storageVector contains: //command0 // command0.conditionalStatus = Structure.if // command0.shouldRun = false //command1 // command1.conditionalStatus = Structure.conditionalPause //command2 // command2.conditionalStatus = Structure.if // command2.shouldRun = true //command3 // command3.start = 3 // command3.timeout =2 //command4 // command4.conditionalStatus = Structure.endif //command5 // command5.start = 3 // command5.timeout = 2 //command6 // command6.conditionalStatus = Structure.conditionalEndPause // //command7 // command7.conditionalStatus = Structure.endif //the entire thing is inside of an if false statement, but the system still pauses for 2 seconds at 3 seconds public void execute() { if(!init){ loopTimer.start(); loopTimer.reset(); init = true; } if(finished) return; SmartDashboard.putNumber("loopTimer", loopTimer.get()); int numOfRunningCommands = 0; //Used to make sure that it still has commands to be run and doesn't loop forever long nestedIfs = 0; long nestedIfFalse = 0; long nestedIfTrue = 0; long nestedPauseStop = 0; long nestedPause = 0;
Enumeration runningCommandsIteration = storageVector.elements(); //List of objects in the storage hashtable Structure nextCommand; //Temporary storage for the next object in the hash while(runningCommandsIteration.hasMoreElements()){ nextCommand = (Structure)(runningCommandsIteration.nextElement()); //Retrieves the next element Object and typecasts it to TimedCommnad
case Structure.conditionalWhile: if(nestedIfFalse == 0 //No nested if false? && !nextCommand.finished //Not finished? && nextCommand.start < loopTimer.get() //Time is proper? && !cond.shouldRun(file)){ //Run the command. If it pauses, than pause everything else. numOfRunningCommands++; nestedPauseStop = nestedPauseStop | (1 << (nestedPause-1)); }else if(!nextCommand.finished && //Else if it should've run but didnt the command returned false nextCommand.start < loopTimer.get()){ //so disable the while.
default: System.out.println("[AUTON] Conditional type passed that does not exist. O.O"); }
}else if(nestedIfFalse == 0 //no false if statements && loopTimer.get() < nextCommand.timeout + nextCommand.start){ //within time frame
if(loopTimer.get() > nextCommand.start){ //if the command should be running, if(nextCommand.command == null) { System.out.println("[AUTON] Null Command Passed! Woops. How'd that happen? Report to Jake"); }else{ nextCommand.command.execute(file); numOfRunningCommands += 1; } nextCommand.hasStarted = true; }else{ //else, the command would be running but it hasn't met its start point so the tcg should still run because it hasnt run that command yet numOfRunningCommands += 1; }
"Deleted code is debugged code." - Jeff Sickel "Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
Ray u posted that code earlier and it had no error... Arceus ur missing a semicolon in the first fund after waittill not to mention that u use the forum-page variable when u pass the forum-post variable
Last Edit: December 13, 2014, 11:57:29 pm by arhowk