LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-04-2009, 11:36 PM   #1
bullrider
LQ Newbie
 
Registered: Jul 2009
Posts: 5

Rep: Reputation: 1
"Error: syntax before '@' token and Error: syntax at 'OTHER' token"


[SOLVED]

OK, so I know this is probably a very dumb question, but I am very new to programming, well computers in general... but I am catching on fairly quickly. I have run across these error messages and for the life of me can not figure out why I am getting them. I have not changed anything in my programming "style" or anything like that. I am using X-Code 3.0 and writing a very simple command tool following the iPhone Programming class from Stanford U. This is the error message and code I am getting from a custom class implementation.
-(id)description
{
NSString *descriptionString = [[NSString alloc] initWithFormat: @" Hello I am a %f sided polygon (aka a %@) with angles of %f degrees (%f radians).", (self.numberOfSides), (self.name), (self.angleInDegrees), (self.angleInRadians)];

return descriptionString;
}

I know this is not at all a sophisticated program or something that should be worried about but I am trying to learn and have spent hours scratching my head at this... I get three error messages: "Error: syntax before '@' token" and "Error: syntax at 'OTHER' token"(this one I get twice). Any help would be appreciated very much, and I will keep trying to solve this mystery myself. Thank you!


----------------------------------------------------------------------------------------------------------------------

Ok, well I fixed the problem. I do not know how but all I did was delete the method in both the header file and the implementation file and re-wrote it and it built fine with no errors or warnings.

Last edited by bullrider; 07-06-2009 at 07:59 PM. Reason: problem solved
 
Old 07-06-2009, 11:09 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Hello bullrider

Glad you found the solution.

A couple of tips to help you get faster and better responses by following "netiquette". Netiquette has evolved to communicate faster and better.

Now you have found the solution, please mark your thread solved by editing the first message and prefixing the title with [SOLVED].

It would have been helpful if you indicated the programming language in the original title and if you had given the program text in [CODE] tags so it formatted prettily. [CODE] tags are conveniently available via the # icon.

Best

Charles
 
Old 07-27-2009, 08:00 AM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
I especially 2nd putting the language in the post title -- the programming forum encompasses too many languages to force us to guess which you are using. It's likely you'll get more people looking at your post also.

Please use the Thread Tools to add a "solved" tag to your title, please don't just edit "[SOLVED]" into the post body.

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sh: syntax error near unexpected token `(' venkatesh_b Linux - Newbie 1 05-16-2009 05:44 AM
syntax error near unexpected token `set' `if ( $dirhome == "." ) set dirhome = `pwd dayanand patil Linux - General 6 01-21-2009 01:52 AM
syntax error unexpected token near "then" pclimmex Linux - Newbie 1 06-20-2008 10:51 PM
/usr/include/stdio.h", line 346: syntax error at token '__s' casady Linux - Software 4 04-28-2006 12:51 AM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration