Go to Post Most members of the CD community are happy to help one another. But searching before you post is standard forum etiquette... - KathieK [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
  #1   Spotlight this post!  
Unread 13-02-2006, 11:22
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 751
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Pre-Load Arrays in EasyC, Possible?

Can anyone tell us if it is possible to pre-load your array with constant values in easyC? We want to create a lookup table and just need to create a single dimension array and load it with constants.

We have tried to define the constants as show in the screen shot. Look at "power[3]" It's a 1 x 4 array and when we set the value field to something like 0,0,0,0 we get an Error: 1 when we try and compile this.

If we leave it value field blank, such as the variable "sign[3]" then it will compile just fine.

We have tried formatting the value field:
0,0,0,0
{0,0,0,0}
(0,0,0,0)

The only thing that seems to work is leave it blank, then in code somewhere we have to do this:

power[0] = value0
power[1] = value1
power[2] = value2
power[3] = value3
(or write a loop to load up several constants...)

Is this the only way to pre-load the arrays in EasyC?
Attached Thumbnails
Click image for larger version

Name:	array.jpg
Views:	51
Size:	24.9 KB
ID:	3975  
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
 


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
EasyC Wish List dcbrown Programming 32 14-08-2006 09:24
Battery Life, 50A load discharge test method/results Dale(294engr] Electrical 5 22-01-2006 09:14
EasyC v2.0 is mandatory for FVC! skimoose FIRST Tech Challenge 7 14-01-2006 18:37
Kickoff easyC workshop integrated into EasyC help file Dan Larochelle Programming 0 11-01-2006 06:12


All times are GMT -5. The time now is 20:59.

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