Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Explain these syntax errors please

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi people, this is my first post but I have a feeling I way be coming here a lot! I just started working with Flash Proffesional CS5 in University and I've been given some tasks to do and have hit a dead end! I need to create code that works out how many days are in a month depending on which month it is.

These are the Syntax Errors that I cant seem to fix:
1. 1084: Syntax error: expecting identifier before logicalor.
2. 1084: Syntax error: expecting semicolon before rightparen.
3. 1084: Syntax error: expecting leftparen before else.
4. 1084: Syntax error: expecting identifier before rightbrace.
5. 1084: Syntax error: expecting rightparen before rightbrace.
6. 1084: Syntax error: expecting identifier before rightbrace.

And this is the code I have so far (excuse the layout and such):

package {
import flash.display.Sprite;

public class Main extends Sprite {

public function Main() {
var month:int = 8;

if (month = 4) || (month = 6) || (month = 9) || (month = 11)
trace ("DaysInMonth = 30");
else if (month = 2)
if (isLeapYear)
trace ("DaysInMonth = 29") ;
else
trace ("DaysInMonth = 28") ;
end if
else
trace ("DaysInMonth = 31") ;
end if
}

I'd apreciate if somebody could fix this code for me, whilst indicating (in a different colour font?) what has been added to the code and any general tips to avoid these mistakes in the first place.

Much thanks!
 
Marshal
Posts: 28288
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, first of all, that code doesn't appear to be Java code. Is it some other language? (You mentioned that your course was about Flash...) If it is, then it wouldn't be all that surprising if a Java compiler got all tangled up trying to deal with it.
 
Joel Afemi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah I see, thats not good! I'll see If I can find somewhere that could help... Im not too sure on the language either, guess I'll have to find out!
 
Paul Clapham
Marshal
Posts: 28288
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joel Afemi wrote:Im not too sure on the language either, guess I'll have to find out!



Yup, that should be the first thing you do!
 
Sheriff
Posts: 22796
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could be JavaFX Script.
 
Joel Afemi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ActionScript 3.0... could that be the language?
 
Marshal
Posts: 79632
380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With end if as two words, it might not be any language. It might be pseudo-code.
 
reply
    Bookmark Topic Watch Topic
  • New Topic