Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Flags???? (http://www.chiefdelphi.com/forums/showthread.php?t=34919)

cprogrammer 18-02-2005 15:42

Flags????
 
I have a quick question. What are flags?? If you know please tell me.

theDoctor 18-02-2005 15:52

Re: Flags????
 
Flags are variables that have two or sometimes more states. They're used to indicate what mode the program is in, for example, whether or not it's tracking a color.

cprogrammer 25-07-2005 19:29

Re: Flags????
 
So how would the compiler flag _USE_CMU_CAMERA work? :confused:

Ryan M. 25-07-2005 19:34

Re: Flags????
 
Work for what? The flag you mention there just tells the compiler whether or not to compile the default code with the CMU cam code.

If you're looking for someplace to store your own state, then you have to declare your own variables.

P.S. The flag you mentioned isn't really a variable, as a warning. It's actually a preprocessor directive. If you don't know what that is, just ignore my whole PS and know you can't use the "_USE_CMU_CAM" thing.

sciguy125 25-07-2005 20:21

Re: Flags????
 
The way it is implemented in the code, _USE_CMU_CAM is a compiler directive. It tells the compiler to conditionally compile certain sections of code. Specifically, it will compile the code that makes the camera work.

#ifdef _USE_CMU_CAM
...
some code
...
#endif

If _USE_CMU_CAM is defined, the compiler will compile all the code between the #ifdef and #endif. If you're using MPLAB, go to the compiler options and you can define/undefine it. (I don't have MPLAB in front of me, so I'm not sure exactly where it is, but I think it's Project > Settings) If you intend on using the camera, you must have it defined, if you aren't using the camera, you must NOT have it defined. If the code was compiled with the camera code enabled, it will complain about not being able to find the camera when you run it.


All times are GMT -5. The time now is 17:58.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi