Go to Post And Dave, although I know you have connections, please don't slow the earth's rotation to get more time on the caption contest. ;) - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #23   Spotlight this post!  
Unread 27-01-2015, 13:47
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is online now
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,722
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Command Based Programming (Threads?)

Quote:
Originally Posted by Ether View Post

So this codeA:
Code:
public FiringCommandGroup extends CommandGroup {

     public FiringCommandGroup() {
          addSequential(new FireCommand1());
          addSeqiential(new waitCommand(1));
          addSequential(new FireCommand2());
     }
}
...is quite different than this codeB:
Code:
public void execute() {
     if (timeSinceInitialized() < sometime) {
          do something;
     } else if(timeSinceInitialized() < some bigger time) {
          do nothing;
     } else {
          do something2;
     }
}
...because codeA executes FireCommand1() once, then waits, then executes FireCommand2() once, and exits.

whereas codeB executes "something" repeatedly, then waits, then executes "something2" repeatedly.

Yes?


Correct. I can write up something that would be similar to code A in the second style if you'd like.
Reply With Quote
 


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 12:55.

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