Go to Post Indeed, the more ways you fail, the more ways you know something doesn't work.:) - Steven Sigley [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-02-2004, 23:40
danielkitchener's Avatar
danielkitchener danielkitchener is offline
408 Computer Nerd
AKA: Daniel Kitchener
#0408 (Roboticks)
Team Role: Alumni
 
Join Date: Sep 2003
Rookie Year: 2001
Location: Pompano Beach, Fl
Posts: 52
danielkitchener is on a distinguished road
HELP!!! Counters, global variables, and the like

Well, here's a question with an answer that's probably very obvious. How do I create a counter used by both the default routine and process IO functions? I tried declaring a global variable, but MPLAB had a major case of PMS when I did. Perhaps I'm doing it wrong? Below the includes, I simply declared
int counter=0;
Is there a better way of doing this?
Also, how do I pass values between functions? Once again, the compiler gets testy
This is urgent, as we ship in 2 days
  #2   Spotlight this post!  
Unread 23-02-2004, 23:42
doy's Avatar
doy doy is offline
#1208 Ex-Lead Programmer
AKA: Jesse Luehrs
#1208 (The Super Critical Axe Men)
Team Role: Alumni
 
Join Date: Jan 2004
Location: O'Fallon, IL
Posts: 27
doy is on a distinguished road
Send a message via AIM to doy
Re: HELP!!! Counters, global variables, and the like

well... if they are in separate files, you need to declare it in each file... do
Code:
int count=0;
in one file, then do
Code:
extern int count;
in all the others.
  #3   Spotlight this post!  
Unread 23-02-2004, 23:53
blindguyinanorg's Avatar
blindguyinanorg blindguyinanorg is offline
Matt Spencer
AKA: Sexy Beast
#1007 (Team Generals)
Team Role: Engineer
 
Join Date: Feb 2004
Location: Snellville GA
Posts: 93
blindguyinanorg has a little shameless behaviour in the past
Send a message via AIM to blindguyinanorg
Re: HELP!!! Counters, global variables, and the like

dont forget you get to work on programing after you ship
__________________
"No drugs, not even alcohol cause the fundementa ills of society. If we're looking for the sources of your troubles, we shouldn't test people for drugs, we should test them for stupidity, ignorance, freed and love of power" - PJ O'Rourke
Closed Thread


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
Help On Coding 2K1 Controller GregTheGreat Programming 9 05-12-2003 18:35


All times are GMT -5. The time now is 16:03.

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