Error in compile smol program identifier expected

I CAN'T Compile this code - the ansuer <identifier> expected
the code
// Exercicio - Ticker.java
import java.applet.*;
import java.awt.*;
public class Ticker extends Applet implements Runnable {
private volatile Thread tickerThread = null;
String tickertext = "Exercicio - fita do registrador";
int tickerSpeed = 1;
String tickerFontName = "TimesRoman";
int tickerFontSize = 12;
Font tickerFont = null;
String tickerDirection = "Left";
Dimension tickerSize = null;
int tickerTextWidth = 0;
int tickerHeight = 0;
int tickerPosition = -63000;
public void init() {
if (getParameter("tickerText") != null) {
tickerText = getParameter("tickerText");
if (getParameter("tickerSpeed") != null) {
tickerSpeed = Integer.parseInt(getParameter("tickerSpeed"));
if (getParameter("tickerFontName") != null) {
tickerFontName = getParameter("tickerFontName");
if (getParamenter("tickerFontSize") != null); {
tickerFontSize = Integer.parseInt(getParameter("tickerFontSize"));
tickerFont = new java.awt.Font(tickerFontName, Font.PLAIN, tickerFontSize);
if (getParameter("tickerReverse") == null) {
tickerDirection = "Left";
tickerPosition = -63000;
else {
tickerDirection = "Right";
tickerPosition = 63000;
this.setBackground(Color.white);
public void start() {
if (tickerThread == null) {
tickerThread = new Thread(this);
tickerThread.start();
public void stop() {
tickerThread = null;
public void run() {
Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
Thread thisThread = Thread.currentThread();
while (thisThread == tickerThread) {
try {
Thread.sleep(10);
catch (InterruptedException e) {}
repaint();
public void paint(Graphics ticker) {
tickerSize = getSize();
     ticker.setFont(tickerFont);
     if (tickerTextHeight == 0) {
tickerTextHeight = ticker.getFontMetrics().getHeight();
if (tickerTextWidth == 0) {
     tickerTextWidth = ticker.getFontMetrics().stringWidth(tickerText);
if (tickerDirection == "Left") {
if (tickerPosition <= tickerTextWidth * -1) {
tickerPosition = tickerSize.width ;
else {
tickerPosition = tickerPosition - tickerSpeed;
else {
if (tickerPosition > tickerTextWidth) {
tickerPosition = 0 - tickerSize.width ;
     else {
                         tickerPosition = tickerPosition + tickerSpeed;
          ticker.setColor(Color.black);
          ticker.drawString(tickerText, tickerPosition, (tickerSize.height + tickerTextHeight) / 2);

Hello,
The last *}* is not placed on the correct line... It should be after the two last lines:
    ticker.setColor(Color.black);
    ticker.drawString(tickerText, tickerPosition,(tickerSize.height + tickerTextHeight) / 2);
}since ticker is known only in paint meethod...
By the way, using code tags makes things easier for us to help...
Hope this helps

Similar Messages

  • Error When Compiling MailTest  Program ?

    HI. Guys. I am getting this error when i try to compile a program which send an email.
    Compiling 1 source file to F:\Projects\JavaMail\war\WEB-INF\classes
    [javac] F:\Projects\POC\JavaMail\src\SendMailBean.java:3: package javax.mail does not exist
    [javac] import javax.mail.*; //JavaMail packages
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:4: package javax.mail.internet does not exist
    [javac] import javax.mail.internet.*; //JavaMail Internet packages
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:24: cannot find symbol
    [javac] symbol : class Session
    [javac] location: class SendMailBean
    [javac] Session l_session = Session.getDefaultInstance(l_props, null);
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:24: cannot find symbol
    [javac] symbol : variable Session
    [javac] location: class SendMailBean
    [javac] Session l_session = Session.getDefaultInstance(l_props, null);
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:29: cannot find symbol
    [javac] symbol : class MimeMessage
    [javac] location: class SendMailBean
    [javac] MimeMessage l_msg = new MimeMessage(l_session); // Create a New message
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:29: cannot find symbol
    [javac] symbol : class MimeMessage
    [javac] location: class SendMailBean
    [javac] MimeMessage l_msg = new MimeMessage(l_session); // Create a New message
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:31: cannot find symbol
    [javac] symbol : class InternetAddress
    [javac] location: class SendMailBean
    [javac] l_msg.setFrom(new InternetAddress(p_from)); // Set the From address
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:34: package Message does not exist
    [javac] l_msg.setRecipients(Message.RecipientType.TO,
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:35: cannot find symbol
    [javac] symbol : variable InternetAddress
    [javac] location: class SendMailBean
    [javac] InternetAddress.parse(p_to, false));
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:38: package Message does not exist
    [javac] l_msg.setRecipients(Message.RecipientType.CC,
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:39: cannot find symbol
    [javac] symbol : variable InternetAddress
    [javac] location: class SendMailBean
    [javac] InternetAddress.parse(p_cc, false));
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:43: package Message does not exist
    [javac] l_msg.setRecipients(Message.RecipientType.BCC,
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:44: cannot find symbol
    [javac] symbol : variable InternetAddress
    [javac] location: class SendMailBean
    [javac] InternetAddress.parse(p_bcc, false));
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:49: cannot find symbol
    [javac] symbol : class MimeBodyPart
    [javac] location: class SendMailBean
    [javac] MimeBodyPart l_mbp = new MimeBodyPart();
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:49: cannot find symbol
    [javac] symbol : class MimeBodyPart
    [javac] location: class SendMailBean
    [javac] MimeBodyPart l_mbp = new MimeBodyPart();
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:53: cannot find symbol
    [javac] symbol : class Multipart
    [javac] location: class SendMailBean
    [javac] Multipart l_mp = new MimeMultipart();
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:53: cannot find symbol
    [javac] symbol : class MimeMultipart
    [javac] location: class SendMailBean
    [javac] Multipart l_mp = new MimeMultipart();
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:64: cannot find symbol
    [javac] symbol : variable Transport
    [javac] location: class SendMailBean
    [javac] Transport.send(l_msg);
    [javac] ^
    [javac] F:\Projects\JavaMail\src\SendMailBean.java:79: cannot find symbol
    [javac] symbol : class MessagingException
    [javac] location: class SendMailBean
    [javac] } catch (MessagingException mex) { // Trap the MessagingException Error
    [javac] ^
    [javac] 19 errors

    Looks like you're using ant. You need to configure your ant build.xml file
    so that mail.jar (and activation.jar unless you're using JDK 6) is in your
    classpath when you compile (and run, of course).

  • Error when compiling C program

    Hello,
    I am trying to compile a small C program in X11 with the gcc command and got the following error message:
    cut_fid_mf_mac.c: In function 'main':
    cut_fid_mf_mac.c:57: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:62: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:65: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:86: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
    cut_fid_mf_mac.c:90: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:100: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:118: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:122: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:126: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:130: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:166: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:174: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:197: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:204: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:208: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:230: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
    cut_fid_mf_mac.c:241: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:274: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:284: warning: incompatible implicit declaration of built-in function 'exit'
    cut_fid_mf_mac.c:287: warning: incompatible implicit declaration of built-in function 'exit'
    I have XQuarts2.3.6
    Can anyone tell me what's the problem and how can I resolve it?
    THanks.

    For the printf type format issue, try llu instead of d. For the others, I think you are missing some include.  Also, these are warnings, so your code should have compiled.

  • Error when compile my program.

    Can someone help me out, please. I've been trying to figure out why I got this error message when I compile the app.
    This is the error message:
    Account.java:27: cannot find symbol
    symbol : variable balance
    location: class Account
    currentBalance = balance amount;
    +^+
    Account.java:27: incompatible types
    found   : <nulltype>
    required: double
    currentBalance = balance amount;
    ^
    Account.java:32: cannot find symbol
    symbol : variable balance
    location: class Account
    if(balance >= amount){
    ^
    Account.java:33: cannot find symbol
    symbol : variable balance
    location: class Account
    currentBalance = balance - amount;
    ^
    This is my program:
    import java.util.Scanner;
    public class Account
    protected String accountHolder;
    protected int accountNumber;
    protected double currentBalance;
    public Account(String holder, int number, double balance)
    accountHolder = holder;
    accountNumber = number;
    if(balance > 00.00){
    currentBalance = balance;
    public Account()
    currentBalance = 00.00;
    public void deposit(double amount)
    currentBalance = balance + amount;
    public double withdraw(double amount)
    if(balance >= amount){
    currentBalance = balance - amount;
    return amount;
    public void setHolder( String holder )
    accountHolder = holder;
    public String getHolder()
    return accountHolder;
    public void setNumber(int number)
    accountNumber = number;
    public int getNumber()
    return accountNumber;
    public void setBalance(double balance)
    currentBalance = balance;
    public double getBalance()
    return currentBalance;
    public String toString()
    return String.format("%s %s\n %s %f\n %s %.2f\n", "Name", accountHolder, "AccountNmber", accountNumber, "Current balance", currentBalance);
    }//end class Account

    Yanepe wrote:
    Can someone help me out, please. I've been trying to figure out why I got this error message when I compile the app.
    This is the error message: No, that is *4* error messages. It pays to write, compile & debug code in small steps. Ending up with 71 lines of code with 4 compilation errors is not doing things in small steps.
    Account.java:27: cannot find symbol
    symbol : variable balance
    location: class Account
    currentBalance = balance amount;
    +^+Where did you declare the 'balance' variable?
    As an aside, is this a template you are working from? I find it hard to understand how you got this far, yet are unable to identify what to do with that compile error.
    Also, when posting code, code snippets, HTML/XML or input/output, please use the code tags. Using the code tags helps rreatin the indentation and formatting of the sample. To use the code tags, select the sample and click the CODE button.
    Here is how your code might appear in the code tags.
    import java.util.Scanner;
    public class Account
       protected String accountHolder;
       protected int    accountNumber;
       protected double currentBalance;
       public Account(String holder, int number, double balance)
           accountHolder = holder;
           accountNumber = number;
           if(balance > 00.00){
              currentBalance = balance;
       public Account()
           currentBalance = 00.00;
       public void deposit(double amount)
           currentBalance = balance + amount;
       public double withdraw(double amount)
           if(balance >= amount){
              currentBalance = balance - amount;
              return amount;
       public void setHolder( String holder )
           accountHolder = holder;
       public String getHolder()
           return accountHolder;
       public void setNumber(int number)
           accountNumber = number;
       public int getNumber()
           return accountNumber;
       public void setBalance(double balance)
           currentBalance = balance;
       public double getBalance()
           return currentBalance;
       public String toString()
           return String.format("%s %s\n %s %f\n %s %.2f\n", "Name", accountHolder, "AccountNmber", accountNumber, "Current balance", currentBalance);
    }//end class Account

  • Error while compiling a program from api....URGENT

    i am trying to use a api for apell checking, and their is one program that i am trying to compile using command
    javac -Xlint org\tiling\didyoumean\DidYouMeanIndexer.java
    and it gives me an error like this
    org\tiling\didyoumean\DidYouMeanIndexer.java:36: cannot find symbol
    symbol  : method indexDictionnary(org.apache.lucene.search.spell.Dictionary)
    location: class org.apache.lucene.search.spell.SpellChecker
                            spellChecker.indexDictionnary(dictionary);
                                        ^
    org\tiling\didyoumean\DidYouMeanIndexer.java:54: warning: [deprecation] getDirectory(java.lang.String,boolean) in org.apache.lucene.store.FSDirectory
    has been deprecated
                            FSDirectory origDir = FSDirectory.getDirectory(origIndex, false);
                                                             ^
    org\tiling\didyoumean\DidYouMeanIndexer.java:55: warning: [deprecation] getDirectory(java.lang.String,boolean) in org.apache.lucene.store.FSDirectory
    has been deprecated
                            FSDirectory spellDir = FSDirectory.getDirectory(spellIndex, true);
                                                              ^
    1 error
    2 warningshere is the code for the program
    package org.tiling.didyoumean;
    import org.apache.lucene.index.IndexWriter;
    import org.apache.lucene.analysis.standard.StandardAnalyzer;
    import org.apache.lucene.document.Document;
    import org.apache.lucene.document.Field;
    import java.io.File;
    import java.io.IOException;
    import java.io.FileReader;
    import java.util.Date;
    * This code was originally written for
    * Erik's Lucene intro java.net article
    public class Indexer {
         public static void main(String[] args) throws Exception {
              if (args.length != 2) {
                   throw new Exception("Usage: java " + Indexer.class.getName()
                             + " <index dir> <data dir>");
              File indexDir = new File(args[0]);
              File dataDir = new File(args[1]);
              long start = new Date().getTime();
              int numIndexed = index(indexDir, dataDir);
              long end = new Date().getTime();
              System.out.println("Indexing " + numIndexed + " files took "
                        + (end - start) + " milliseconds");
         public static int index(File indexDir, File dataDir) throws IOException {
              if (!dataDir.exists() || !dataDir.isDirectory()) {
                   throw new IOException(dataDir
                             + " does not exist or is not a directory");
              IndexWriter writer = new IndexWriter(indexDir, new StandardAnalyzer(),
                        true);
              writer.setUseCompoundFile(false);
              indexDirectory(writer, dataDir);
              int numIndexed = writer.docCount();
              writer.optimize();
              writer.close();
              return numIndexed;
         private static void indexDirectory(IndexWriter writer, File dir)
                   throws IOException {
              File[] files = dir.listFiles();
              for (int i = 0; i < files.length; i++) {
                   File f = files;
                   if (f.isDirectory()) {
                        indexDirectory(writer, f); // recurse
                   } else if (f.getName().endsWith(".txt")) {
                        indexFile(writer, f);
         private static void indexFile(IndexWriter writer, File f)
                   throws IOException {
              if (f.isHidden() || !f.exists() || !f.canRead()) {
                   return;
              System.out.println("Indexing " + f.getCanonicalPath());
              Document doc = new Document();
              doc.add(Field.Text("contents", new FileReader(f)));
              doc.add(Field.Keyword("filename", f.getCanonicalPath()));
              doc.add(Field.Keyword("name", f.getName()));
              doc.add(Field.Keyword("url", f.toURI().toURL().toExternalForm()));
              writer.addDocument(doc);

    ping.sumit wrote:
    ok.........thank you so much....
    any idea about other errors??There telling you that getDirectory(boolean) has been replaced
    getDirectory(String, boolean) - Static method in class org.apache.lucene.store.FSDirectory
    Deprecated. Use IndexWriter's create flag, instead, to create a new index. Found on [http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc//core/index-all.html]

  • Linker error when compiling Fortran program

    I have some problems when linking a Fortran program. The compiling (with gfortran) works without problems and produces (amongst others) several ".mod" files. As soon as the products are to be linked, these .mod-files provoke a "bad magic number (not a Mach-O file)" error from the linker.
    I use gcc 4.3 with gfortran. Any ideas?
    Powerbook G4 12", 1.33 GHz/MacBook Pro 2GHz   Mac OS X (10.4.8)  

    Possibly, but the error doesn't come from gfortran itself, but from the linker (ld), so I don't see right now, why this should make a difference.
    You think it is because these .mod-files are compiled incorrectly?

  • Getting an error when running my program but it compiles.

    Hey guys, I'm having a problem running the program. Everything compiles correctly, but then I get the error code linked below. Everything I think is correct here. Any ideas? I posted CinReader as well in case you wanted to try compiling and running it yourself.
    Thanks
    public class TextShuffleLevel
         private String jumble;
         private String [] matchString;
         public TextShuffleLevel ()
              jumble = "dunops";
              matchString = new String[5];
              matchString[0] = new String("abound");
              matchString[1] = new String("bound");
              matchString[2] = new String("undo");
              matchString[3] = new String("band");
              matchString[4] = new String("bond");
         public TextShuffleLevel (int whichDefaultLevel)
              if (whichDefaultLevel == 1)
                   jumble = "dunops";
                   matchString = new String[5];
                   matchString[0] = new String("abound");
                   matchString[1] = new String("bound");
                   matchString[2] = new String("undo");
                   matchString[3] = new String("band");
                   matchString[4] = new String("bond");
              else if (whichDefaultLevel == 2)
                   jumble = "srcaso";
                   matchString = new String[11];
                   matchString[0] = new String("across");
                   matchString[1] = new String("crass");
                   matchString[2] = new String("cross");
                   matchString[3] = new String("scars");
                   matchString[4] = new String("soars");
                   matchString[5] = new String("arcs");
                   matchString[6] = new String("soar");
                   matchString[7] = new String("scar");
                   matchString[8] = new String("oars");
                   matchString[9] = new String("cars");
                   matchString[10] = new String("orcs");
              else
                   jumble = "eplcis";
                   matchString = new String[19];
                   matchString[0] = new String("splice");
                   matchString[1] = new String("spiel");
                   matchString[2] = new String("plies");
                   matchString[3] = new String("slice");
                   matchString[4] = new String("clips");
                   matchString[5] = new String("epics");
                   matchString[6] = new String("spice");
                   matchString[7] = new String("epic");
                   matchString[8] = new String("lice");
                   matchString[9] = new String("slip");
                   matchString[10] = new String("clip");
                   matchString[11] = new String("pile");
                   matchString[12] = new String("lisp");
                   matchString[13] = new String("pies");
                   matchString[14] = new String("isle");
                   matchString[15] = new String("lips");
                   matchString[16] = new String("lies");
                   matchString[17] = new String("ices");
                   matchString[18] = new String("pics");
         public TextShuffleLevel (String newJumble, String [] newMatchString)
              jumble = newJumble;
              matchString = newMatchString;
         /* This is the nasty one */
         public boolean findMatch (String matchTry)
              boolean foundMatch = false;
              for (int i=0; i<matchString.length; i++)
                   if (matchTry.equalsIgnoreCase(matchString))
                        foundMatch = true;
                        break;
              return foundMatch;
         public void setJumble (String newJumble)
              jumble = newJumble;
         public void setMatchStrings (String [] newMatchString)
              matchString = newMatchString;
         public String getJumble ()
              return jumble;
         public int getJumbleLength ()
              return jumble.length();
         public int getNumberOfMatches ()
              return matchString.length;
         public String[] getMatchString ()
              return matchString;
    public class TextShuffleGame
         private int playerLevel = 1; // start them on level 1
         private CinReader reader;
         private TextShuffleLevel l1;
         private TextShuffleLevel l2;
         private TextShuffleLevel l3;
         private TextShuffleLevel onTheFly;
         public TextShuffleGame ()
              reader = new CinReader();
              // Using Statically Set Levels
              l1 = new TextShuffleLevel(1);
              l2 = new TextShuffleLevel(2);
              l3 = new TextShuffleLevel(3);
              // this one allows for a 'custom' level
              String fly[] = {"tea","at", "ate"};
              onTheFly = new TextShuffleLevel("eta", fly);
         //Setup for levels
         public void go ()
              boolean quit = false;
              char choice = 'z';
              int lastLevel = 0;
              while (quit == false)
                   lastLevel = playerLevel;
                   if (playerLevel == 1)
                        play(l1);
                   else if (playerLevel == 2)
                        play(l2);
                   else if (playerLevel == 3)
                        play(l3);
                   else
                        play(onTheFly);
                   if (lastLevel == playerLevel)
                        System.out.print("Play the level again");
                   else
                        System.out.print("Play next level");
                   System.out.print("(y/n)? ");
                   choice = reader.readChar();
                   if (choice == 'N' || choice == 'n')
                        quit = true;
         //Playing each level the same
         public void play (TextShuffleLevel theLevel)
              int numGuesses = 0;
              int numCorrect = 0;
              String userString = "";
              System.out.println("What " + theLevel.getJumbleLength() + "-letter words can you get out of " +
                                                 theLevel.getJumble() + "?\n");
              while (numGuesses < 5 && numCorrect < theLevel.getNumberOfMatches())
                        System.out.print("Enter a string: ");
                        userString = reader.readString();
                        if (theLevel.findMatch(userString) == true)
                             System.out.println("Great! A match!");
                             numCorrect = numCorrect + 1;
                        else
                             System.out.println("Drat... not a match");
                             numGuesses = numGuesses + 1;
              if (numCorrect == theLevel.getNumberOfMatches())
                   System.out.println("Terrific! You are ready to try a harder jumble");
                   playerLevel = playerLevel + 1;
         /* FOR TESTING ONLY -- TO BE REMOVED FOR RELEASE */
         public static void main (String [] args)
              TextShuffleGame tsg = new TextShuffleGame();
              tsg.go();
    import java.io.*;
    import java.util.*;
    public class CinReader
         private static final int INT_MESSAGE = 0;
         private static final int DOUBLE_MESSAGE = 1;
         private static final int CHAR_MESSAGE = 2;
         private static final int STRING_MESSAGE = 3;
         private static final int BOOLEAN_MESSAGE = 4;
         private static final String DEFAULT_ERROR_MESSAGE = "Please reenter. ";
         private String prompt = "> ";
         private String [] errorMessages;
         public CinReader ()
              prompt = "> ";
              setDefaultMessages();
         public CinReader (String newPrompt)
              prompt = newPrompt;
              setDefaultMessages();
         public CinReader (String newPrompt, String [] newErrorMessages)
              prompt = newPrompt;
              if (newErrorMessages != null)
                   setErrorMessages(newErrorMessages);
              else
                   setDefaultMessages();
         public void setPrompt (String newPrompt)
              prompt = newPrompt;
         public void setErrorMessages (String [] newErrorMessages)
              if (newErrorMessages != null)
                   int diff = errorMessages.length - newErrorMessages.length;
                   // NEED A MINIMUM OF 5 ERROR MESSAGES TO AVOID ERRORS
                   if (diff > 0)
                        errorMessages = new String[5];
                        for (int i=0; i<5; i++)
                             if (i < newErrorMessages.length)
                                  errorMessages[i] = new String(newErrorMessages);
                             else
                                  errorMessages[i] = new String(DEFAULT_ERROR_MESSAGE);
                   else
                        errorMessages = newErrorMessages;
         public void setErrorMessage (int idx, String msg)
              if (idx >= 0 && idx < errorMessages.length)
                   errorMessages[idx] = msg;
         public void setErrorMessageString (String msg)
              errorMessages[STRING_MESSAGE] = msg;
         public void setErrorMessageInt (String msg)
              errorMessages[INT_MESSAGE] = msg;
         public void setErrorMessageDouble (String msg)
              errorMessages[DOUBLE_MESSAGE] = msg;
         public void setErrorMessageChar (String msg)
              errorMessages[CHAR_MESSAGE] = msg;
         public void setErrorMessageBoolean (String msg)
              errorMessages[BOOLEAN_MESSAGE] = msg;
         public String readString()
              char theChar = 'x';
              String result = "";
              boolean done = false;
              while (!done)
                   theChar = nextChar();
                   if (theChar == '\n')
                        done = true;
                   else if (theChar == '\r'){}
                   else
                        result = result + theChar;
              return result;
         public String readString (boolean allowEmpty)
              String result = readString();
              if (!allowEmpty)
                   while (result.length() == 0)
                        System.out.println("Empty input not allowed. " + errorMessages[STRING_MESSAGE]);
                        System.out.print(prompt);
                        result = readString();
              return result;
         public String readString (int charLimit)
              String result = readString();
              if (result.length() > charLimit)
                   result = result.substring(0, charLimit);
              return result;
         public String readString (boolean allowEmpty, int charLimit)
              String result = readString(allowEmpty);
              if (result.length() > charLimit)
                   result = result.substring(0, charLimit);
              return result;
         public int readInt()
              String inputString = "";
              int number = 0;
              boolean done = false;
              while (!done)
                   try
                        inputString = readString();
                        inputString = inputString.trim();
                        number = (Integer.valueOf(inputString).intValue());
                        done = true;
                   catch (NumberFormatException e)
                        System.out.println("Input is not an integer. " + errorMessages[INT_MESSAGE]);
                        System.out.print(prompt);
              return number;
         public int readInt(int min, int max)
              String inputString = "";
              int number = 0;
              boolean done = false;
              while (!done)
                   try
                        inputString = readString();
                        inputString = inputString.trim();
                        number = (Integer.valueOf(inputString).intValue());
                        if (number < min || number > max)
                             System.out.println("Please enter an integer between " + min + " and " + max);
                        else
                             done = true;
                   catch (NumberFormatException e)
                        System.out.println("Input is not an integer. " + errorMessages[INT_MESSAGE]);
                        System.out.print(prompt);
              return number;
         public double readDouble()
              String inputString = "";
              double number = 0;
              boolean done = false;
              while (!done)
                   try
                        inputString = readString();
                        inputString = inputString.trim();
                        number = (Double.valueOf(inputString).doubleValue());
                        done = true;
                   catch (NumberFormatException e)
                        System.out.println("Input is not an integer. " + errorMessages[DOUBLE_MESSAGE]);
                        System.out.print(prompt);
              return number;
         public char readChar()
              boolean done = false;
              String inputString = "";
              char nonWhite = 'x';
              while (!done)
                   inputString = readString();
                   inputString = inputString.trim();
                   if (inputString.length() != 1)
                        System.out.println("Input must be a single character. " + errorMessages[CHAR_MESSAGE]);
                        System.out.print(prompt);
    else
    nonWhite = (inputString.charAt(0));
    done = true;
              return nonWhite;
         public char readChar (String range)
              char theChar = 'x';
              boolean done = false;
              while (!done)
                   theChar = readChar();
                   for (int i=0; i<range.length(); i++)
                        if (theChar == range.charAt(i))
                             done = true;
                             break;
                   if (!done)
                        System.out.print("Invalid input. Please enter one of the following -> ");
                        for (int i=0; i<range.length(); i++)
                             System.out.print(range.charAt(i) + " ");
                        System.out.print("\n" + prompt);
              return theChar;
         public boolean readBoolean()
              boolean done = false;
              String inputString = "";
              boolean result = false;
              while (!done)
                   inputString = readString(false);
                   inputString = inputString.trim();
                   if (inputString.equalsIgnoreCase("true") || inputString.equalsIgnoreCase("t"))
                        result = true;
                        done = true;
                   else if (inputString.equalsIgnoreCase("false") || inputString.equalsIgnoreCase("f"))
                        result = false;
                        done = true;
                   else
                        System.out.println("Input must be [t]rue or [f]alse. " + errorMessages[BOOLEAN_MESSAGE]);
                        System.out.print(prompt);
              return result;
         private void setDefaultMessages ()
              errorMessages = new String[5];
              for (int i=0; i<errorMessages.length; i++)
                   errorMessages[i] = new String(DEFAULT_ERROR_MESSAGE);
         private char nextChar()
              int charAsInt = -1;
              try
                   charAsInt = System.in.read();
              catch(IOException e)
                   System.out.println(e.getMessage());
                   System.out.println("Fatal error. Exiting program.");
                   System.exit(0);
              return (char)charAsInt;

    Ok, here's what I did using the JSE 8.1 IDE.
    1) I copied your code into a .java file named "TextShuffleGame".
    It generated about half a dozon errors.
    There are three classes in the program:
    TextShuffleLevel
    TextShuffleGame
    CinReader
    Each of these classes is declared "public" and I got the same error message on each one:
    "class ... is public, should be declared in a file name ... .java"
    so, I...
    2) tried changing them to "private".
    It then said: "modifier private not allowed here".
    so, I...
    3) deleted the modifiers for these three classes and left them as just class. No errors.
    The next two errors had to do with the two import statements:
    "import java.io.*;" and "import java.util.*;".
    It said: "'class' or 'identifier' expected" for both. So, I...
    4) moved them to the top of the source file.
    Didn't help at first. So, I...
    5) fiddle around with them a bit.
    I tried "java.io;" and "java.util;" and then "java.*;" by itself. Still got errors. So, I put them back as you had them and for some mysterious reason, my editor decided they were fine. oO
    This also corrected the last errors in the "CinReader" class. Here is the error-free code I now have in my "TextShuffleGame.java" file:
    import java.io.*;
    import java.util.*;
    class TextShuffleLevel
         private String jumble;
         private String [] matchString;
         public TextShuffleLevel ()
              jumble = "dunops";
              matchString = new String[5];
              matchString[0] = new String("abound");
              matchString[1] = new String("bound");
              matchString[2] = new String("undo");
              matchString[3] = new String("band");
              matchString[4] = new String("bond");
         public TextShuffleLevel (int whichDefaultLevel)
              if (whichDefaultLevel == 1)
                   jumble = "dunops";
                   matchString = new String[5];
                   matchString[0] = new String("abound");
                   matchString[1] = new String("bound");
                   matchString[2] = new String("undo");
                   matchString[3] = new String("band");
                   matchString[4] = new String("bond");
              else if (whichDefaultLevel == 2)
                   jumble = "srcaso";
                   matchString = new String[11];
                   matchString[0] = new String("across");
                   matchString[1] = new String("crass");
                   matchString[2] = new String("cross");
                   matchString[3] = new String("scars");
                   matchString[4] = new String("soars");
                   matchString[5] = new String("arcs");
                   matchString[6] = new String("soar");
                   matchString[7] = new String("scar");
                   matchString[8] = new String("oars");
                   matchString[9] = new String("cars");
                   matchString[10] = new String("orcs");
              else
                   jumble = "eplcis";
                   matchString = new String[19];
                   matchString[0] = new String("splice");
                   matchString[1] = new String("spiel");
                   matchString[2] = new String("plies");
                   matchString[3] = new String("slice");
                   matchString[4] = new String("clips");
                   matchString[5] = new String("epics");
                   matchString[6] = new String("spice");
                   matchString[7] = new String("epic");
                   matchString[8] = new String("lice");
                   matchString[9] = new String("slip");
                   matchString[10] = new String("clip");
                   matchString[11] = new String("pile");
                   matchString[12] = new String("lisp");
                   matchString[13] = new String("pies");
                   matchString[14] = new String("isle");
                   matchString[15] = new String("lips");
                   matchString[16] = new String("lies");
                   matchString[17] = new String("ices");
                   matchString[18] = new String("pics");
         public TextShuffleLevel (String newJumble, String [] newMatchString)
              jumble = newJumble;
              matchString = newMatchString;
         /* This is the nasty one */
         public boolean findMatch (String matchTry)
              boolean foundMatch = false;
              for (int i=0; i<matchString.length; i++)
                   if (matchTry.equalsIgnoreCase(matchString))
                        foundMatch = true;
                        break;
              return foundMatch;
         public void setJumble (String newJumble)
              jumble = newJumble;
         public void setMatchStrings (String [] newMatchString)
              matchString = newMatchString;
         public String getJumble ()
              return jumble;
         public int getJumbleLength ()
              return jumble.length();
         public int getNumberOfMatches ()
              return matchString.length;
         public String[] getMatchString ()
              return matchString;
    class TextShuffleGame
         private int playerLevel = 1; // start them on level 1
         private CinReader reader;
         private TextShuffleLevel l1;
         private TextShuffleLevel l2;
         private TextShuffleLevel l3;
         private TextShuffleLevel onTheFly;
         public TextShuffleGame ()
              reader = new CinReader();
              // Using Statically Set Levels
              l1 = new TextShuffleLevel(1);
              l2 = new TextShuffleLevel(2);
              l3 = new TextShuffleLevel(3);
              // this one allows for a 'custom' level
              String fly[] = {"tea","at", "ate"};
              onTheFly = new TextShuffleLevel("eta", fly);
         //Setup for levels
         public void go ()
              boolean quit = false;
              char choice = 'z';
              int lastLevel = 0;
              while (quit == false)
                   lastLevel = playerLevel;
                   if (playerLevel == 1)
                        play(l1);
                   else if (playerLevel == 2)
                        play(l2);
                   else if (playerLevel == 3)
                        play(l3);
                   else
                        play(onTheFly);
                   if (lastLevel == playerLevel)
                        System.out.print("Play the level again");
                   else
                        System.out.print("Play next level");
                   System.out.print("(y/n)? ");
                   choice = reader.readChar();
                   if (choice == 'N' || choice == 'n')
                        quit = true;
         //Playing each level the same
         public void play (TextShuffleLevel theLevel)
              int numGuesses = 0;
              int numCorrect = 0;
              String userString = "";
              System.out.println("What " + theLevel.getJumbleLength() + "-letter words can you get out of " +
                                                 theLevel.getJumble() + "?\n");
              while (numGuesses < 5 && numCorrect < theLevel.getNumberOfMatches())
                        System.out.print("Enter a string: ");
                        userString = reader.readString();
                        if (theLevel.findMatch(userString) == true)
                             System.out.println("Great! A match!");
                             numCorrect = numCorrect + 1;
                        else
                             System.out.println("Drat... not a match");
                             numGuesses = numGuesses + 1;
              if (numCorrect == theLevel.getNumberOfMatches())
                   System.out.println("Terrific! You are ready to try a harder jumble");
                   playerLevel = playerLevel + 1;
         /* FOR TESTING ONLY -- TO BE REMOVED FOR RELEASE */
         public static void main (String [] args)
              TextShuffleGame tsg = new TextShuffleGame();
              tsg.go();
    class CinReader
         private static final int INT_MESSAGE = 0;
         private static final int DOUBLE_MESSAGE = 1;
         private static final int CHAR_MESSAGE = 2;
         private static final int STRING_MESSAGE = 3;
         private static final int BOOLEAN_MESSAGE = 4;
         private static final String DEFAULT_ERROR_MESSAGE = "Please reenter. ";
         private String prompt = "> ";
         private String [] errorMessages;
         public CinReader ()
              prompt = "> ";
              setDefaultMessages();
         public CinReader (String newPrompt)
              prompt = newPrompt;
              setDefaultMessages();
         public CinReader (String newPrompt, String [] newErrorMessages)
              prompt = newPrompt;
              if (newErrorMessages != null)
                   setErrorMessages(newErrorMessages);
              else
                   setDefaultMessages();
         public void setPrompt (String newPrompt)
              prompt = newPrompt;
         public void setErrorMessages (String [] newErrorMessages)
              if (newErrorMessages != null)
                   int diff = errorMessages.length - newErrorMessages.length;
                   // NEED A MINIMUM OF 5 ERROR MESSAGES TO AVOID ERRORS
                   if (diff > 0)
                        errorMessages = new String[5];
                        for (int i=0; i<5; i++)
                             if (i < newErrorMessages.length)
                                  errorMessages[i] = new String(newErrorMessages[i]);
                             else
                                  errorMessages[i] = new String(DEFAULT_ERROR_MESSAGE);
                   else
                        errorMessages = newErrorMessages;
         public void setErrorMessage (int idx, String msg)
              if (idx >= 0 && idx < errorMessages.length)
                   errorMessages[idx] = msg;
         public void setErrorMessageString (String msg)
              errorMessages[STRING_MESSAGE] = msg;
         public void setErrorMessageInt (String msg)
              errorMessages[INT_MESSAGE] = msg;
         public void setErrorMessageDouble (String msg)
              errorMessages[DOUBLE_MESSAGE] = msg;
         public void setErrorMessageChar (String msg)
              errorMessages[CHAR_MESSAGE] = msg;
         public void setErrorMessageBoolean (String msg)
              errorMessages[BOOLEAN_MESSAGE] = msg;
         public String readString()
              char theChar = 'x';
              String result = "";
              boolean done = false;
              while (!done)
                   theChar = nextChar();
                   if (theChar == '\n')
                        done = true;
                   else if (theChar == '\r'){}
                   else
                        result = result + theChar;
              return result;
         public String readString (boolean allowEmpty)
              String result = readString();
              if (!allowEmpty)
                   while (result.length() == 0)
                        System.out.println("Empty input not allowed. " + errorMessages[STRING_MESSAGE]);
                        System.out.print(prompt);
                        result = readString();
              return result;
         public String readString (int charLimit)
              String result = readString();
              if (result.length() > charLimit)
                   result = result.substring(0, charLimit);
              return result;
         public String readString (boolean allowEmpty, int charLimit)
              String result = readString(allowEmpty);
              if (result.length() > charLimit)
                   result = result.substring(0, charLimit);
              return result;
         public int readInt()
              String inputString = "";
              int number = 0;
              boolean done = false;
              while (!done)
                   try
                        inputString = readString();
                        inputString = inputString.trim();
                        number = (Integer.valueOf(inputString).intValue());
                        done = true;
                   catch (NumberFormatException e)
                        System.out.println("Input is not an integer. " + errorMessages[INT_MESSAGE]);
                        System.out.print(prompt);
              return number;
         public int readInt(int min, int max)
              String inputString = "";
              int number = 0;
              boolean done = false;
              while (!done)
                   try
                        inputString = readString();
                        inputString = inputString.trim();
                        number = (Integer.valueOf(inputString).intValue());
                        if (number < min || number > max)
                             System.out.println("Please enter an integer between " + min + " and " + max);
                        else
                             done = true;
                   catch (NumberFormatException e)
                        System.out.println("Input is not an integer. " + errorMessages[INT_MESSAGE]);
                        System.out.print(prompt);
              return number;
         public double readDouble()
              String inputString = "";
              double number = 0;
              boolean done = false;
              while (!done)
                   try
                        inputString = readString();
                        inputString = inputString.trim();
                        number = (Double.valueOf(inputString).doubleValue());
                        done = true;
                   catch (NumberFormatException e)
                        System.out.println("Input is not an integer. " + errorMessages[DOUBLE_MESSAGE]);
                        System.out.print(prompt);
              return number;
         public char readChar()
              boolean done = false;
              String inputString = "";
              char nonWhite = 'x';
              while (!done)
                   inputString = readString();
                   inputString = inputString.trim();
                   if (inputString.length() != 1)
                        System.out.println("Input must be a single character. " + errorMessages[CHAR_MESSAGE]);
                        System.out.print(prompt);
    else
    nonWhite = (inputString.charAt(0));
    done = true;
              return nonWhite;
         public char readChar (String range)
              char theChar = 'x';
              boolean done = false;
              while (!done)
                   theChar = readChar();
                   for (int i=0; i<range.length(); i++)
                        if (theChar == range.charAt(i))
                             done = true;
                             break;
                   if (!done)
                        System.out.print("Invalid input. Please enter one of the following -> ");
                        for (int i=0; i<range.length(); i++)
                             System.out.print(range.charAt(i) + " ");
                        System.out.print("\n" + prompt);
              return theChar;
         public boolean readBoolean()
              boolean done = false;
              String inputString = "";
              boolean result = false;
              while (!done)
                   inputString = readString(false);
                   inputString = inputString.trim();
                   if (inputString.equalsIgnoreCase("true") || inputString.equalsIgnoreCase("t"))
                        result = true;
                        done = true;
                   else if (inputString.equalsIgnoreCase("false") || inputString.equalsIgnoreCase("f"))
                        result = false;
                        done = true;
                   else
                        System.out.println("Input must be [t]rue or [f]alse. " + errorMessages[BOOLEAN_MESSAGE]);
                        System.out.print(prompt);
              return result;
         private void setDefaultMessages ()
              errorMessages = new String[5];
              for (int i=0; i < errorMessages.length; i++)
                   errorMessages[i] = new String(DEFAULT_ERROR_MESSAGE);
         private char nextChar()
              int charAsInt = -1;
              try
                   charAsInt = System.in.read();
              catch(IOException e)
                   System.out.println(e.getMessage());
                   System.out.println("Fatal error. Exiting program.");
                   System.exit(0);
              return (char)charAsInt;
    Hope that helps.

  • .class expected error when compiling

    Ive been getting this frustrating error when compiling. My program is essentially supposed to add the values in two matrixes and return a new matrix using the added values
    Heres my code:
       public Matrix add(Matrix comp)
            int[][] temp = new int[this.numRows()][this.numCols()];
            for (int a = 0; a < comp.numRows(); a++) {
                for (int b = 0; b < comp.numCols(); b++) {
                    temp[a] = this.myCells[a][b] + comp.getVal(a, b);
    Matrix addedMatrix = new Matrix(temp[][]);
    return addedMatrix;
    heres the constructor for Matrix object:
      public Matrix(int[][] mat)
            int[][] myCells = new int[mat.length][mat[0].length];
            for (int i = 0; i < mat.length; i++) {
                for (int j = 0; j < mat[0].length; j++) {
                    myCells[i][j] = mat[i][j];
        }getVal, numRows, and numCols are all helper methods that just return values.
    The error is '.class' expected in the line which says Matrix addedMatrix = new Matrix(temp[][]); I checked for extra brackets but there dont seem to be any.
    Any help would be appreciated. Thanks.

    I think you just needMatrix addedMatrix = new Matrix(temp);

  • Idenifier expected error when compiling

    I am attempting running a selection sort at the moment .
    i wrote the following invoking method
    sort(characters, 0, characters.length-1); which passed the array characters and the first and last index of the array .
    The called method is :
    static sort (int a[], int left , int right )
    and the method code for the selection sort is as follows:
         for (int l =left ; l<right; l++)
         int p =l;
    int least =a[p];
         for (int k = l +1;k< right; k++ )
         if (a[k] < least )
         p=k;
              least =a[p];
    if ((p!=1)
    a{p} =a[1};
    a[l] = least;
    However when I try to compile I am getting the error : <identifier expected > static sort (int a[], int left , int right );
    ^
    I reckon I am missing something basic. would be glad of assistance

    Your method should return a datatype, or void.

  • Identifier expected error......plzz help

    it is showing the error ....identifier expected where i am declaring the variables JTextArea and JButton....
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.filechooser.*;
    import javax.swing.SwingUtilities.*;
    //import javax.swing.JEditorPane;
    import java.net.URL;
    public class tm extends JPanel implements ActionListener
         public static void main(String args[]) throws Exception
         JTextArea = program, input, state;
         JButton = loadp, run, step,loadi;
         public tm()
              JPanel c = new JPanel();
              c.setLayout(new GridLayout(1,1));
              loadi = new JButton("LOAD INPUT STRING");
              contentPane.add(loadi);
              loadi.addActionListener(this);
              loadp = new JButton("LOAD PROGRAM");
              contentPane.add(loadp);
              loadp.addActionListener(this);
              run = new JButton("RUN");
              contentPane.add(run);
              run.addActionListener(this);
              step = new JButton("STEP");
              contentPane.add(step);
              step.addActionListener(this);
              program=new JTextArea("");
              program.setBounds(100,400,100,400);
              input=new JTextArea("");
              input.setBounds(300,400,200,50);
              state=new JTextArea("");
              state.setBounds(700,400,100,50);
         public void actionPerformed(ActionEvent e)
           try{
             if(e.getSource()==loadp)
                  JFileChooser chooser=new JFileChooser();
                   int r= chooser.showOpenDialog(this);
                   if(r==JFileChooser.APPROVE_OPTION)
                        String name=chooser.getSelectedFile().getName();
                        File f=chooser.getSelectedFile();
                        FileInputStream filestream = new FileInputStream(f); 
                        BufferedInputStream bufferstream = new BufferedInputStream(filestream); 
                        DataInputStream datastream = new DataInputStream(bufferstream); 
                        String record = null;
                        tapep.setText("");
                        try { 
                               while ( (record=datastream.readLine()) != null )
                                  program.append(record);                         
                            catch (Exception p)
                              System.out.println(p);                      
              else if(e.getSource()==run)
              else if(e.getSource()==step)
              else if(e.getSource()==loadi)
           catch(Exception t)
                System.out.println(t);
    }

         public static void main(String args[]) throws Exception
         JTextArea = program, input, state;
         JButton = loadp, run, step,loadi;That's not valid Java syntax.
    The Java? Tutorial - Trail: Learning the Java Language
    ~

  • Can't find (and possibly don't have) the -lglut -lGLU -lGL libraries... or at least when I try to compile a program, it returns with that error.  Any ideas (I really need to get this popgen program running on Lion)? Thx!

    Hi all,
        I'm trying to compile a population genetic software program onto my Mac Lion.  It was originally compiled to Tiger and worked beautifully.  But now I'm getting an error  'library not found for -lglut', and now I'm trying to figure out how to download the library. I've installed the command line code for Xcode, and am thinking I possibly missed installing the libraries.  I could be very wrong here... all I know is that I'm no longer near the people I would ask to help me with this so I'm asking you!  Thanks in advance for any help!  I guess my questions are: 1) where can I download the glut (potentially OpenGL) libraries (if I don't have them already)? And 2) once downloaded, how do I install it so the makefile will compile my program (in terminal, not Xcode)? Cheers,
    C

    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!

  • Error while compiling program unit

    Hi All,
    I am working on oracle forms 10g.
    I am getting an error "wrong no or types of arguments in call to 'COUNTCDRSTODELETE' ", while trying to compile my program unit.
    The extract of my program unit is as written below:
    PROCEDURE CALL_PCK_BACKOUT IS
    -- type bmpf_id_arr is varray(100) of bmp_files.bmpf_id%type;
    type bmpf_id_arr is varray(100) of integer;
    id_arr bmpf_id_arr := bmpf_id_arr();
    file_cnt number := 0;
    BEGIN
    GO_BLOCK('B_FILE');
    first_record;
    LOOP
         --     EXIT WHEN :SYSTEM.RECORD_STATUS='NEW';
              IF UPPER(:B_FILE.FILE_ON_OFF_IND) = 'Y' THEN
         FOR I IN ( SELECT BMPF_ID FROM BMP_FILES
                             WHERE BMPF_FILENAME = :B_FILE.BMPF_FILENAME
                             AND BMPF_PROCESSING_STATE = 'P'
                             ORDER BY BMPF_ID ASC)
         LOOP
              if file_cnt < id_arr.limit then
                   id_arr.extend;
                   id_arr(id_arr.last) := i.bmpf_id;                
                   INSERT INTO bmp_files_to_backout (file_id, job_id) values (i.bmpf_id,pkg_constants.gt_bat_code_bckout_cdr);
                   file_cnt := file_cnt + 1;
              else
                   msg_alert('You can select maximum 100 files at a time','E',FALSE);
                   RAISE FORM_TRIGGER_FAILURE;     
              end if;                                         
         END LOOP;
         END IF;
         EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
         NEXT_RECORD;
    END LOOP;
    if file_cnt = 0 then
         msg_alert('Please select at least one file in order to initiate the backout','E', FALSE);
         go_item('b_ctrl.file_name');
         RAISE FORM_TRIGGER_FAILURE;     
    end if;
    if file_cnt > 0 then
    commit;
    end if;
    -- check if the backout request has been accepted or not
    if pck_backout.CountCDRStodelete(id_arr,file_cnt) = 0 and pck_backout.AreallCDRSOpen(id_arr,file_cnt) = 0 then
         msg_alert('Backout request can be scheduled for the selected input','E',FALSE);
    elsif     pck_backout.CountCDRStodelete(id_arr,file_cnt) != 0 and pck_backout.AreallCDRSOpen(id_arr,file_cnt) != 0 then
         msg_alert('Backout request has been rejected due to maximum number of cdrs exceeded and not all cdrs belonging to open invoices','E',FALSE);
         RAISE FORM_TRIGGER_FAILURE;
    elsif     pck_backout.CountCDRStodelete(id_arr,file_cnt) != 0 then
    msg_alert('Backout request has been rejected due to maximum number of cdrs exceeded','E',FALSE);
    RAISE FORM_TRIGGER_FAILURE;
    elsif pck_backout.AreallCDRSOpen(id_arr,file_cnt) != 0 then
         msg_alert('Backout request has been rejected due to not all cdrs belonging to open invoices','E',FALSE);
         RAISE FORM_TRIGGER_FAILURE;
    end if;
    END;
    pck_backout is a stored database package. The definition of two functions used above is as given below:
    FUNCTION countcdrstodelete (
    p_bmpf_id_array IN pkarray,
    p_batch_size IN NUMBER
    RETURN NUMBER;
    FUNCTION areallcdrsopen (p_bmpf_id_array IN pkarray, p_batch_size IN NUMBER)
    RETURN NUMBER;
    where pkarray is defined as :
    TYPE pkarray IS VARRAY (100) OF INTEGER;
    Can anyone please tell me why i am getting wronf type or no of arguments error while calling the databse functions.
    I guess, it has to do with the varray field. Can you please tell me if i am using any wrong syntax??
    I request all the forms gurus to please help me with this.

    Hi Fabrio,
    I solved my problem.
    I'd to actually define pkarray as sql type rather than PL/SQL type.
    It's because oracle forms wasn't able to bind the varray defined locally in program unit with the varray defined in stored PL/SQL function.
    Once i created pkarray as sql type and removed the declaration of varray in program unit and PL/SQL code, it worked.
    Thanks for your reply though.
    Regards,
    Navnit

  • Syntax error on token "Enum", Identifier expected

    Hello,
    We are using the LinkType class(com.sapportals.wcm.repository.enum.LinkType) but at the import statement we get an error message: Syntax error on token "Enum", Identifier expected
    Configuration:
    JDK version: jdk1.5.0_17
    NWDS 7.1 SP7 CE
    import com.sapportals.wcm.repository.enum.LinkType;
    Has anyone experienced the same issue and found a workaround or solution?
    Regards,
    Edwin.

    Thanks, but that is not the problem... Unfortunately.
    The class we needed (linkType) is found in the KM API for NWDS 04, but this KM API is not available anymore in NWDS 7.1...
    So we will have to redesign the application and re-do the developments...
    Regards,
    Edwin.

  • Program not compiling giving Error : Invalid path, "C:\Program Files\Java--

    I am using jcreator where i am getting this error while compiling
    Error : Invalid path, "C:\Program Files\Java\j2re1.4.2_05\bin\javac.exe" -classpath "C:\Program Files\Xinox Software\JCreatorV3LE\MyProjects\zeroCode\classes" -d C:\Program" Files\Xinox "Software\JCreatorV3LE\MyProjects\zeroCode\classes C:\Program" Files\Xinox Software\JCreatorV3LE\MyProjects\zeroCode\src\BasicServiceLister.java
    Instead of that same program is compiling in textpad/eclipse easily.
    Please tell me what should i do to set what.
    present settings are:
    User Variable:
    classpath C:\Program Files\Xinox JCreatorV3LE\MyProjects\zeroCode\ classes
    Java_HOme: C:\Program Files\Java\j2re1.4.2_05\bin\javac.exe
    Path:C:\Program Files\Java\j2re1.4.2_05\bin
    Classpath is System Variables:
    C:\Program Files\Xinox Software\JCreatorV3LE\MyProjects\zeroCode\ classes
    Path :C:\Program Files\Java\j2re1.4.2_05\bin
    wher i really need to modify the settings:
    May be thorugh command prompt.
    I never did. windowds environment varaibles i can set.
    Thanks
    Vijendra

    ... -d C:\Program" Files\Xinox "Software\JCreatorV3LE\MyProjects\zeroCode\classes ...
    Looks like you are typing in things wrong with the double quotes.

  • Can't compile Servlet program(error in setting classpath in XP)

    I encountered a similar problem as 'hereispaddy'.
    "I have recently written a servlet program. When I compile the program (let's say "HelloWorld.java"), I've got the following error message:
    package javax.servlet does not exist
    I've download the class files and set the classpath already. Have I missed anything? "
    i would like to ask, how to set the following in Windows XP:
    set CATALINE_HOME=C:\PROGRA~1\APACHE~1.0
    set CLASSPATH=.;%CATALINE_HOME%\COMMON\LIB\SERVLET.JAR;C:\JDK1.4\BIN;
    *ive tried in control panel->system->advanced->environment variables->
    variable name:CATALINE_HOME
    variable value:C:\Program Files\Apache Tomcat4.0 (and)
    variable name:CLASSPATH
    variable value:.;%CATALINE_HOME%\common\lib\servlet.jar;C:\jdk1.4\bin
    but failed!
    Could anyone kindly tell me what's wrong with my setting?
    Thx a lot!!!

    Does Tomcat work? Can run the examples on the home page?
    The only suggestion I have at this point is to get rid of the spaces in
    C:\Program Files\Apache Tomcat4.0
    But I am still in Win98 , so I am just guessing.

Maybe you are looking for

  • How to use iphoto after yosemite 10.10.3, that have disabled it for new photo app?

    My iMac did install new yosemite 10.10.3 telling me that new Photo app was "best ever" but now I can't open old iPhoto library because it was in old format of iPhoto library and the iPhoto app was now unusable because new Photo app. Can you help me!!

  • How do I find an Apple email address to log a fault?

    I have sat in a phone queue for 30 mins - only to have my call dropped I have booked an appointment at a genius bar - as my retina has faulty pixels BUt I am unable to email to log this officially I am concerned that as my 1 year warrent is due to ex

  • PO details not getting updated in PO

    Dear all, In one of my PR i have found that PO details in PR status tab is not getting updated. In PO  line item in PR reference field it contains the PR no & i am able to navigate to PR document from their, but i have noticed that in PO in delivery

  • Simple Search is not working as expected

    I am trying to execute code from the Brian "Bex" Heff book. The code is simple but I cannot figure out an error I'm getting. When I hit the search button I get following error. A Runtime Error has occurred. Do you with to Debug? Line:1433 Error: 'doc

  • Does QuickTime Pro convert an ISO DVD movie to an mp4?

    I'm thinking about purchasing the Pro version of QuickTime; but what I REALLY want to do is convert some ISO DVD Image files to the QuickTime mp4 format so I can put it on my iPod or view it with my AppleTV. Does anyone out there know if this is poss