|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#8
|
|||
|
|||
|
Just a few nits (not ninnies) to pick
Posted by Gregory Ross at 03/19/2001 1:28 PM EST
Engineer on team #330, Beach Bots, from Hope Chapel Academy and NASA/JPL. In Reply to: YES Posted by Stephen on 03/18/2001 8:58 PM EST: I hate it when my kids get nit-picky, but I guess they come by it honestly ;-) Steven, Actually, constants don't need to be defined in every program (unless, of course, they are used in multiple programs) since they take up no variable space. ...and Gui, It's true that the variable data stays in memory between programs, but one program has no idea of variables defined in another program, or how much variable space is used by other programs unless you tell it (by defining all variables in all programs.) Also, defining variables takes up no PROGRAM space (EEPROM) only VARIABLE space (RAM). (I realize that may have been what you meant when you wrote "program space" -- Just wanted to be sure all those nasty little nits were gone :-) Of course, since variable space is so much more limited (26 bytes) than program space(64Kytes per program), then conserving variable space may be of much greater concern. Maybe an example would be helpful: Consider the case where you have one program that fills 10 byte variables, and another program that sums those ten bytes and stores the result into a word variable. If the first program only defined the 10 bytes, then since the interpreter puts word variables first in memory, the word variable defined in the second program would overlay the first two byte variables from the first, and the summation would be of the last eight bytes and two undefined bytes! |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 2-week FIRST summer program @ WPI | ColleenShaver | General Forum | 20 | 31-05-2009 03:02 |
| initialization program and speed controllers | rosebud | Programming | 15 | 05-10-2004 03:35 |
| Fried program slots? | Jeff Waegelin | Programming | 18 | 19-03-2003 18:08 |
| Credits for FIRST program. | archiver | 2000 | 6 | 24-06-2002 00:16 |
| An invitation for HS Juniors | archiver | 2000 | 0 | 23-06-2002 22:51 |