Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Array Syntax Error (http://www.chiefdelphi.com/forums/showthread.php?t=43330)

Andrew Blair 04-02-2006 21:15

Array Syntax Error
 
I'm using a lookup table to take joystick values and return a cubic function of them, basically just a drive ramp, but I cannot seem to get my array to compile properly. I have here a drastically reduced version, but one that still returns the same syntax error.

Code:

 
rom const unsigned char[2] = {0,3};

I've consulted all of the lookup table threads, but I feel that I have a small syntax error that is holding this up.

Alan Anderson 04-02-2006 21:27

Re: Array Syntax Error
 
A small syntax error? You left out the name of the array!
Code:

  rom const unsigned char arrname[2] = {0,3};

Mark McLeod 04-02-2006 21:29

Re: Array Syntax Error
 
Code:


rom const unsigned char x[2] = {0,3};


Andrew Blair 04-02-2006 22:09

Re: Array Syntax Error
 
Please give me a moment while I proceed to beat my head against the wall...


Thanks! I knew I was missing something!!!

Matt Krass 05-02-2006 02:05

Re: Array Syntax Error
 
It's ok.

Half an hour...

Over a dozen code downloads...

Two master resets...

Then I remembered to plug the PWM cables in :)

Oh and yeah, this beauty:
Code:

if(x > 0)
{x = 0;}


Eldarion 05-02-2006 02:16

Re: Array Syntax Error
 
Quote:

Originally Posted by Matt Krass
It's ok.

Half an hour...

Over a dozen code downloads...

Two master resets...

Then I remembered to plug the PWM cables in :)

Speaking of which, here's one my mentor did:

He couldn't get a potentiometer value to display with the new 2006 code, so he put the old 2005 code in, only to discover that it still didn't work. A little while later a student walks in and notices that the OI was unplugged the whole time! :D

Then there's always the problem of "why doesn't the camera work!?"...
Oh, wait, the backup battery came loose again!

Maybe a thread should be started with "Top 100 Stupid Programming Mistakes"? ;)

Rick TYler 05-02-2006 13:37

Re: Array Syntax Error
 
Quote:

Originally Posted by Eldarion
Maybe a thread should be started with "Top 100 Stupid Programming Mistakes"?

The MPLAB environment is a great example of the finest IDEs of the 1970s. Modern IDEs save you lots of time during code development. If you can write C everything else looks easy by comparison. Code verifiers, real-time syntax checkers, and instant help systems still won't plug in the battery for you.

Eldarion 05-02-2006 14:11

Re: Array Syntax Error
 
Quote:

Originally Posted by Rick TYler
The MPLAB environment is a great example of the finest IDEs of the 1970s. Modern IDEs save you lots of time during code development. If you can write C everything else looks easy by comparison. Code verifiers, real-time syntax checkers, and instant help systems still won't plug in the battery for you.

I guess what I meant to say was "Top 100 Stupid Mistakes made by the Programmer". :)


All times are GMT -5. The time now is 01:33.

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