Go to Post (Respecting a decision) != (Agreeing with it) - dtengineering [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 20-02-2007, 11:05
Joohoo's Avatar
Joohoo Joohoo is offline
Registered User
FRC #0340 (G.R.R.)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Rochester
Posts: 241
Joohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really nice
Send a message via AIM to Joohoo Send a message via Yahoo to Joohoo
old style functions??

Hello every one, as I sit here waiting to give the robot some tlc I wrote a function to drive our robot based upon encoders attached to the drive wheels

I go to compile it and the compiler says that [qutoe]old style function declarations not supported[/quote]
when ni go to look at where the compiler says the problem is it points to the last } of the function. I checked that all the {}'s are ending themselves.

SO if any one is free at the moment could they tell me what the old style is and what I have to do to convert it over to the 'new' style

thankyou in advance
  #2   Spotlight this post!  
Unread 20-02-2007, 11:09
buddy.smith buddy.smith is offline
Master Control
FRC #1795
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: atlanta
Posts: 20
buddy.smith is an unknown quantity at this point
Re: old style functions??

Why don't you post the code?

Here's an "old style" function declaration:
Code:
int myFunc( param1, param2, param3)
     char param1;
     int param2;
     short param3;
{
     printf("Got %d %d %d\n", param1, param2, param3);
}
Here's a "new style" function declaration:
Code:
int myFunc( char param1, int param2, short param3 )
{
    .....
}
(edited for correctness, as pointed out below)

Last edited by buddy.smith : 20-02-2007 at 14:25.
  #3   Spotlight this post!  
Unread 20-02-2007, 11:43
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: old style functions??

Quote:
Originally Posted by buddy.smith View Post
Why don't you post the code?

Here's an "old style" function declaration:
Code:
int myFunc( param1, param2, param3)
{
     char param1;
     int param2;
     short param3;
     printf("Got %d %d %d\n", param1, param2, param3);
}
Close, for "old style" function declarations the parameters went between the ) and the {:

Code:
int myFunc( param1, param2, param3)
     char param1;
     int param2;
     short param3;
{
     printf("Got %d %d %d\n", param1, param2, param3);
}
Usually you get this error when the { character has been omitted.
  #4   Spotlight this post!  
Unread 20-02-2007, 11:31
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: old style functions??

http://support.microsoft.com/kb/79845 explains the difference.
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
Camera functions. winners Programming 1 21-01-2006 19:42
Source for old style CIM motor (fr801-001) Rob Motors 9 09-01-2006 09:31
Bringing Back the Old School...picture style Greg Needel Chit-Chat 1 19-10-2005 13:20
Auton + Functions ten3brousone Programming 0 27-02-2005 20:11
Old Delph Ide Style? INF3RN0666 Programming 6 14-06-2003 08:56


All times are GMT -5. The time now is 04:51.

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