Go to Post Hurricane season would be torture, at least in snow you can lock the doors and know the robot is safe. - rtfgnow [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
  #9   Spotlight this post!  
Unread 04-03-2005, 00:40
ace123's Avatar
ace123 ace123 is offline
Registered User
AKA: Patrick Horn
FRC #0008 (Paly Robotics - http://robotics.paly.net/)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Palo Alto, CA
Posts: 50
ace123 has a spectacular aura aboutace123 has a spectacular aura about
Send a message via AIM to ace123
Re: Static Variables

Actually, you can not put explicit code outside of functions, but you are allowed to put initial values for all variables. These must be constants, and can only be either arrays like (1,45,3,21,4,5...} or integers like 2.
They can also include basic expressions like:
Code:
#define M_PI 3.14159265358979
int my_circumference=2*M_PI
This code is executed, and I think that's what the ".cinit" seciton in your map file is for.

But, no actual code is allowed, and the order in which variables are initialized is also undefined. So you can and should only use this to initalize defaults. If you do not do this, then the variables will be uninitialized, meaning that they could start out with any value.

If you want code to run, then put all of that in your User_Initialization(). Beware that no pwms or inputs or control inputs can be read or written in the initialization function.
__________________
-Patrick Horn, Paly Robotics

Check out the space simulator called Vega Strike, modelled after the space simulator games Elite and Wing Commander. It's Open Source too!
If you have ever played Wing Commander, or especially Privateer, and had a feeling of nostalga derived from the you will enjoy these two Vega Strike mods: Privateer Gemini Gold and Privateer Remake!
I'm working on adding multiplayer support this year...
 


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
Need help with Variables ? David Bryan Programming 5 23-02-2004 07:42
Joystick Variables fred Programming 8 20-02-2004 10:58
Simple problem with variables sear_yoda Programming 4 05-02-2004 09:12
VB Program to monitor robot variables DanL Programming 7 15-02-2002 22:35


All times are GMT -5. The time now is 00: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