Go to Post You know you're addicted to FIRST when robots are sexy! - Pat Arnold [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 10-02-2007, 14:06
billdar billdar is offline
Registered User
FRC #2085
 
Join Date: Jan 2007
Location: california
Posts: 3
billdar is an unknown quantity at this point
Variable Scope

I know its pretty late asking these questions, but we haven't gotten
to building a competition port dongle yet and I have a nagging question
on variable scope within the 3 WPI functions (Initialize, Autonomous,
Operator).

The kids have been practicing with code laid out like this:
main()
{
int someVariable;
while (1)
{
doSomethingTo(someVariable);
}
}
And they have been assuming that someVariable will retain its
value each time it loops.

Two questions on this, if they write the same kind of code in either
the Autonomous() or OperatorControl() functions:
- Will the forever loops break the background competition port monitoring
task?
- How do I define a variable that retains its value when Autonomous()
or OperatorControl() loops?
Thanks,

-Bill
Team 2085
 


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
camera scope problems xrabohrok Programming 4 15-01-2007 20:48
Camera variable scope question Validius Programming 1 28-01-2006 09:24
Save a variable dawonn Programming 7 23-04-2005 08:30
Interrupt Handlers and Variable Scope kaszeta Programming 2 14-02-2004 18:30
variable? manodrum Programming 11 01-04-2003 17:20


All times are GMT -5. The time now is 12:02.

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