How to program chapter returns

How can I program chapters to return to the menu and also have a play all?

David, stories and/or scripting depending on how you feel, a recent thread discussing the approaches below with alot of detail
http://discussions.apple.com/message.jspa?messageID=1511151#1511151

Similar Messages

  • How to call a dialog program with return value in another dialog program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    You can you SET/GET parameters to do this.
    This is some information about this.
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETERstatements.
    To fill one, use:
    SET PARAMETER ID pid FIELD f.
    This statement saves the contents of field f under the ID pid in the SAP memory. The ID pid can be up to 20 characters long. If there was already a value stored under pid, this statement overwrites it. If you double-click pid in the ABAP Editor, parameters that do not exist can be created as a Repository object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID pid FIELD f.
    This statement places the value stored under the pid ID into the variable f. If the system does not find any value for pid in the SAP memory, sy-subrc is set to 4. Otherwise, it sets the value to 0.
    Thanks,
    SriRatna

  • How to fetch the return parameter while running the concurrent program

    Hi,
    I have created one Pl/SQLl function and register into a apps concurrent programs. how to add the return type parameter in to CP and to get the out put..
    Please help me.. i am new to oracle apps technical.
    Thanks in advance..
    Winsky

    Hi,
    i don't understand the return part? You need to fetch it to where?
    Simple pl/sql code for concurrent program writing to standard FND log and output file:
    CREATE OR REPLACE PROCEDURE TEST(errbuf OUT varchar2, retcode OUT varchar2, param1 IN number ) AS
    BEGIN
    fnd_file.put_line(FND_FILE.LOG,'LOG'); --text for log
    fnd_file.put_line(FND_FILE.OUTPUT,'OUTPUT'); -- text for output
    errbuf := '';
    retcode := 0;
    EXCEPTION
    WHEN OTHERS THEN
    retcode := 2;
    END TEST;

  • Modify the TicTacToeServer /client from deitel How to program

    We've been given example code from the deitel & deitel book how to program and have to carry out the following alterations:
    a) Modify the TicTacToeServer class to test for a win, loss or draw on each move in the game. Send a message to each client applet that indicates the result of the game when the game is over.
    b) Modify the TicTacToeClient class to display a button that when clicked allows the client to play another game. The button should be enabled only when a game completes. Note that both class TicTacToeClient and class TicTacToeServer must be modified to reset the board and all state information. Also, the other TicTacToeClient should be notified that a new game is about to begin so its board and state can be reset.
    c) Modify the TicTacToeClient class to provide a button that allows a client to terminate the program at any time. When the user clicks the button, the server and the other client should be notified. The server should then wait for a connection from another client so a new game can begin.
    d) Modify the TicTacToeClient class and the TicTacToeServer class so the winner of a game can choose game piece X or O for the next game. Remember: X always goes first.
    So far I have only been able to do part a) of the exercise im having a lot of difficulty with part b) which allows the client to play a new game.The code ive done so far is listed below if anyone can help i would be forever greatful. Thanks
    // Fig. 18.9: TicTacToeClient.java
    // Client that let a user play Tic-Tac-Toe with another across a network.
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    public class TicTacToeClient extends JApplet implements Runnable, ActionListener {
    private JButton Button;
    private JTextField idField;
    private JTextArea displayArea;
    private JPanel boardPanel, panel2;
    private Square board[][], currentSquare;
    private Socket connection;
    private DataInputStream input;
    private DataOutputStream output;
    private char myMark;
    private boolean myTurn;
    private final char X_MARK = 'X', O_MARK = 'O';
    boolean done=false;
    Container container;
    // Set up user-interface and board
    public void init()
    container = getContentPane();
    // set up JTextArea to display messages to user
    displayArea = new JTextArea( 4, 30 );
    displayArea.setEditable( false );
    container.add( new JScrollPane( displayArea ), BorderLayout.SOUTH );
    // set up panel for squares in board
    boardPanel = new JPanel();
    boardPanel.setLayout( new GridLayout( 3, 3, 0, 0 ) );
    // create board
    board = new Square[ 3 ][ 3 ];
    // When creating a Square, the location argument to the constructor
    // is a value from 0 to 8 indicating the position of the Square on
    // the board. Values 0, 1, and 2 are the first row, values 3, 4,
    // and 5 are the second row. Values 6, 7, and 8 are the third row.
    for ( int row = 0; row < board.length; row++ ) {
    for ( int column = 0; column < board[ row ].length; column++ ) {
    // create Square
    board[ row ][ column ] = new Square( ' ', row * 3 + column );
    boardPanel.add( board[ row ][ column ] );
    // textfield to display player's mark
    idField = new JTextField();
    idField.setEditable( false );
    container.add( idField, BorderLayout.NORTH );
    Button = new JButton("New Game");
    container.add(Button, BorderLayout.BEFORE_FIRST_LINE);
    // set up panel to contain boardPanel (for layout purposes)
    panel2 = new JPanel();
    panel2.add( boardPanel, BorderLayout.CENTER );
    container.add( panel2, BorderLayout.CENTER );
    } // end method init
    // Make connection to server and get associated streams.
    // Start separate thread to allow this applet to
    // continually update its output in textarea display.
    public void start()
    // connect to server, get streams and start outputThread
    try {
    // make connection
    connection = new Socket( getCodeBase().getHost(), 12345 );
    // get streams
    input = new DataInputStream( connection.getInputStream() );
    output = new DataOutputStream( connection.getOutputStream() );
    // catch problems setting up connection and streams
    catch ( IOException ioException ) {
    ioException.printStackTrace();
    // create and start output thread
    Thread outputThread = new Thread( this );
    outputThread.start();
    } // end method start
    // control thread that allows continuous update of displayArea
    public void run()
    // get player's mark (X or O)
    try {
    myMark = input.readChar();
    // display player ID in event-dispatch thread
    SwingUtilities.invokeLater(
    new Runnable() {
    public void run()
    idField.setText( "You are player \"" + myMark + "\"" );
    myTurn = ( myMark == X_MARK ? true : false );
    // receive messages sent to client and output them
    while ( !done) {
    processMessage( input.readUTF() );
    } // end try
    // process problems communicating with server
    catch ( IOException ioException ) {
    ioException.printStackTrace();
    } // end method run
    // process messages received by client
    private void processMessage( String message )
    // valid move occurred
    if ( message.equals( "Valid move." ) ) {
    displayMessage( "Valid move, please wait.\n" );
    setMark( currentSquare, myMark );
    // invalid move occurred
    else if ( message.equals( "Invalid move, try again" ) ) {
    displayMessage( message + "\n" );
    myTurn = true;
    // opponent moved
    else if ( message.equals( "Opponent moved" ) ) {
    // get move location and update board
    try {
    int location = input.readInt();
    int row = location / 3;
    int column = location % 3;
    setMark( board[ row ][ column ],
    ( myMark == X_MARK ? O_MARK : X_MARK ) );
    displayMessage( "Opponent moved. Your turn.\n" );
    myTurn = true;
    } // end try
    // process problems communicating with server
    catch ( IOException ioException ) {
    ioException.printStackTrace();
    } // end else if
    else if ( message.equals("Game Over") ){
    displayMessage("fuck sake" );
    // simply display message
    else
    displayMessage( message + "\n" );
    } // end method processMessage
    // utility method called from other threads to manipulate
    // outputArea in the event-dispatch thread
    private void displayMessage( final String messageToDisplay )
    // display message from event-dispatch thread of execution
    SwingUtilities.invokeLater(
    new Runnable() {  // inner class to ensure GUI updates properly
    public void run() // updates displayArea
    displayArea.append( messageToDisplay );
    displayArea.setCaretPosition(
    displayArea.getText().length() );
    } // end inner class
    ); // end call to SwingUtilities.invokeLater
    // utility method to set mark on board in event-dispatch thread
    private void setMark( final Square squareToMark, final char mark )
    SwingUtilities.invokeLater(
    new Runnable() {
    public void run()
    squareToMark.setMark( mark );
    // send message to server indicating clicked square
    public void sendClickedSquare( int location )
    if ( myTurn ) {
    // send location to server
    try {
    output.writeInt( location );
    myTurn = false;
    // process problems communicating with server
    catch ( IOException ioException ) {
    ioException.printStackTrace();
    // set current Square
    public void setCurrentSquare( Square square )
    currentSquare = square;
    public void actionPerformed(ActionEvent e) {
    // I need code here
    // private inner class for the squares on the board
    private class Square extends JPanel {
    private char mark;
    private int location;
    public Square( char squareMark, int squareLocation )
    mark = squareMark;
    location = squareLocation;
    addMouseListener(
    new MouseAdapter() {
    public void mouseReleased( MouseEvent e )
    setCurrentSquare( Square.this );
    sendClickedSquare( getSquareLocation() );
    } // end Square constructor
    // return preferred size of Square
    public Dimension getPreferredSize()
    return new Dimension( 30, 30 );
    // return minimum size of Square
    public Dimension getMinimumSize()
    return getPreferredSize();
    // set mark for Square
    public void setMark( char newMark )
    mark = newMark;
    repaint();
    // return Square location
    public int getSquareLocation()
    return location;
    // draw Square
    public void paintComponent( Graphics g )
    super.paintComponent( g );
    g.drawRect( 0, 0, 29, 29 );
    g.drawString( String.valueOf( mark ), 11, 20 );
    } // end inner-class Square
    } // end class TicTacToeClient
    // Fig. 18.8: TicTacToeServer.java
    // This class maintains a game of Tic-Tac-Toe for two client applets.
    import java.awt.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    public class TicTacToeServer extends JFrame {
    private char[] board;
    private JTextArea outputArea;
    private Player[] players;
    private ServerSocket server;
    private int currentPlayer;
    private final int PLAYER_X = 0, PLAYER_O = 1;
    private final char X_MARK = 'X', O_MARK = 'O';
    int moves=0;
    // set up tic-tac-toe server and GUI that displays messages
    public TicTacToeServer()
    super( "Tic-Tac-Toe Server" );
    board = new char[ 9 ];
    for (int i = 0; i<9; i++){
    board[i] = ' ';
    players = new Player[ 2 ];
    currentPlayer = PLAYER_X;
    // set up ServerSocket
    try {
    server = new ServerSocket( 12345, 2 );
    // process problems creating ServerSocket
    catch( IOException ioException ) {
    ioException.printStackTrace();
    System.exit( 1 );
    // set up JTextArea to display messages during execution
    outputArea = new JTextArea();
    getContentPane().add( outputArea, BorderLayout.CENTER );
    outputArea.setText( "Server awaiting connections\n" );
    setSize( 300, 300 );
    setVisible( true );
    } // end TicTacToeServer constructor
    // wait for two connections so game can be played
    public void execute()
    // wait for each client to connect
    for ( int i = 0; i < players.length; i++ ) {
    // wait for connection, create Player, start thread
    try {
    players[ i ] = new Player( server.accept(), i );
    players[ i ].start();
    // process problems receiving connection from client
    catch( IOException ioException ) {
    ioException.printStackTrace();
    System.exit( 1 );
    // Player X is suspended until Player O connects.
    // Resume player X now.
    synchronized ( players[ PLAYER_X ] ) {
    players[ PLAYER_X ].setSuspended( false );
    players[ PLAYER_X ].notify();
    } // end method execute
    // utility method called from other threads to manipulate
    // outputArea in the event-dispatch thread
    private void displayMessage( final String messageToDisplay )
    // display message from event-dispatch thread of execution
    SwingUtilities.invokeLater(
    new Runnable() {  // inner class to ensure GUI updates properly
    public void run() // updates outputArea
    outputArea.append( messageToDisplay );
    outputArea.setCaretPosition(
    outputArea.getText().length() );
    } // end inner class
    ); // end call to SwingUtilities.invokeLater
    // Determine if a move is valid. This method is synchronized because
    // only one move can be made at a time.
    public synchronized boolean validateAndMove( int location, int player )
    boolean moveDone = false;
    // while not current player, must wait for turn
    while ( player != currentPlayer ) {
    // wait for turn
    try {
    wait();
    // catch wait interruptions
    catch( InterruptedException interruptedException ) {
    interruptedException.printStackTrace();
    // if location not occupied, make move
    if ( !isOccupied( location ) ) {
    // set move in board array
    board[ location ] = currentPlayer == PLAYER_X ? X_MARK : O_MARK;
    // change current player
    currentPlayer = ( currentPlayer + 1 ) % 2;
    // let new current player know that move occurred
    players[ currentPlayer ].otherPlayerMoved( location );
    notify(); // tell waiting player to continue
    // tell player that made move that the move was valid
    return true;
    // tell player that made move that the move was not valid
    else
    return false;
    } // end method validateAndMove
    // determine whether location is occupied
    public boolean isOccupied( int location )
    if ( board[ location ] == X_MARK || board [ location ] == O_MARK )
    return true;
    else
    return false;
    void gameOverCheck() {
    boolean over = false;
    // Check rows
    for (int start=0; start < 9; start += 3)
    over = over || ((board[start] != ' ') &&
    (board[start] == board[start+1]) &&
    (board[start] == board[start+2]));
    // Check columns
    for (int start=0; start < 3; start++)
    over = over || ((board[start] != ' ') &&
    (board[start] == board[start+3]) &&
    (board[start] == board[start+6]));
    // Check diagonals
    over = over || ((board[0] != ' ') &&
    (board[0] == board[4]) && (board[0] == board[8]));
    over = over || ((board[2] != ' ') &&
    (board[2] == board[4]) && (board[2] == board[6]));
    if (over || (moves>=9))
    for ( int i = 0; i < players.length; i++ )
    players.gameOver(over ? (currentPlayer+1)%2 : -1 );
    public static void main( String args[] )
    TicTacToeServer application = new TicTacToeServer();
    application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    application.execute();
    // private inner class Player manages each Player as a thread
    private class Player extends Thread {
    private Socket connection;
    private DataInputStream input;
    private DataOutputStream output;
    private int playerNumber;
    private char mark;
    protected boolean suspended = true;
    boolean done = false;
    // set up Player thread
    public Player( Socket socket, int number )
    playerNumber = number;
    // specify player's mark
    mark = ( playerNumber == PLAYER_X ? X_MARK : O_MARK );
    connection = socket;
    // obtain streams from Socket
    try {
    input = new DataInputStream( connection.getInputStream() );
    output = new DataOutputStream( connection.getOutputStream() );
    // process problems getting streams
    catch( IOException ioException ) {
    ioException.printStackTrace();
    System.exit( 1 );
    } // end Player constructor
    // send message that other player moved
    public void otherPlayerMoved( int location )
    // send message indicating move
    try {
    output.writeUTF( "Opponent moved" );
    output.writeInt( location );
    // process problems sending message
    catch ( IOException ioException ) {
    ioException.printStackTrace();
    void gameOver(int winner) {
    try {
    output.writeUTF( "Game Over. " +
    (( winner == -1 ) ? "No winner." :
    ( "Winner is " + ( winner == 0 ? 'X' : 'O' ) + "." ) ) );
    done=true;
    output.writeUTF("Game Over");
    } catch( IOException e ) {
    e.printStackTrace(); System.exit( 1 );
    public void run()
    // send client message indicating its mark (X or O),
    // process messages from client
    try {
    displayMessage( "Player " + ( playerNumber ==
    PLAYER_X ? X_MARK : O_MARK ) + " connected\n" );
    output.writeChar( mark ); // send player's mark
    // send message indicating connection
    output.writeUTF( "Player " + ( playerNumber == PLAYER_X ?
    "X connected\n" : "O connected, please wait\n" ) );
    // if player X, wait for another player to arrive
    if ( mark == X_MARK ) {
    output.writeUTF( "Waiting for another player" );
    // wait for player O
    try {
    synchronized( this ) {
    while ( suspended )
    wait();
    // process interruptions while waiting
    catch ( InterruptedException exception ) {
    exception.printStackTrace();
    // send message that other player connected and
    // player X can make a move
    output.writeUTF( "Other player connected. Your move." );
    while ( ! done ) {
    // get move location from client
    int location = input.readInt();
    // check for valid move
    if ( validateAndMove( location, playerNumber ) ) {
    displayMessage( "\nlocation: " + location );
    output.writeUTF( "Valid move." );
    gameOverCheck();
    else
    output.writeUTF( "Invalid move, try again" );
    // close connection to client
    } // end try
    // process problems communicating with client
    catch( IOException ioException ) {
    ioException.printStackTrace();
    System.exit( 1 );
    // end method run
    // set whether or not thread is suspended
    public void setSuspended( boolean status )
    suspended = status;
    } // end class Player
    } // end class TicTacToeServer

    reply #1:
    http://forum.java.sun.com/thread.jspa?threadID=5114663
    &tstart=0@Op. Don't multi/cross-post

  • Subtle bug in Deitel & Deitel "Java How to Program" book

    Merry x mas and happy new year, guys.
    I have this applet (which is at the same time runnable and listener) its printed in Deitel & Deitel "Java How to Program" book 3rd ed.
    The program works but as you turn on and off the "suspend" checkboxes some of the threads are not notified, so they go to infinite wait state, deadlock. I couldn't figure out what is wrong or how to fix the problem.. please read the code below, or copy and paste this code to your eclipse, its just one file, then play with the check boxes, some of the threads don't wake up after wait... technically they don't shift from WAITING to TIMED_WAITING state.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    * @author
    // Fig. 15.7: RandomCharacters.java
    // Demonstrating the Runnableinterface
    public class RandomCharacters extends JApplet implements Runnable, ActionListener {
        private String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        private JLabel outputs[];
        private JCheckBox checkboxes[];
        private final static int SIZE = 3;
        private Thread threads[];
        private boolean suspended[];
        public void init() {
            outputs = new JLabel[SIZE];
            checkboxes = new JCheckBox[SIZE];
            threads = new Thread[SIZE];
            suspended = new boolean[SIZE];
            Container c = getContentPane();
            c.setLayout(new GridLayout(SIZE, 2, 5, 5));
            for (int i = 0; i < SIZE; i++) {
                outputs[i] = new JLabel();
                outputs.setBackground(Color.green);
    outputs[i].setOpaque(true);
    c.add(outputs[i]);
    checkboxes[i] = new JCheckBox("Suspended");
    checkboxes[i].addActionListener(this);
    c.add(checkboxes[i]);
    public void start() {
    // create threads and start every time start is called
    for (int i = 0; i < threads.length; i++) {
    threads[i] = new Thread(this, "Thread " + (i + 1));
    threads[i].start();
    public void run() {
    Thread currentThread = Thread.currentThread();
    int index = getIndex(currentThread);
    char displayChar;
    while (threads[index] == currentThread) {
    // sleep from 0 to 1 second
    try {
    Thread.sleep((int) (Math.random() * 1000));
    synchronized (this) {
    while (suspended[index]
    && threads[index] == currentThread) {
    wait();
    } catch (InterruptedException e) {
    System.err.println("sleep interrupted");
    displayChar = alphabet.charAt(
    (int) (Math.random() * 26));
    outputs[index].setText(currentThread.getName() + ": " + displayChar);
    System.err.println(currentThread.getName() + " terminating");
    private int getIndex(Thread current) {
    for (int i = 0; i < threads.length; i++) {
    if (current == threads[i]) {
    return i;
    return -1;
    public synchronized void stop() {
    // stop threads every time stop is called
    // as the user browses another Web page
    for (int i = 0; i < threads.length; i++) {
    threads[i] = null;
    notifyAll();
    public synchronized void actionPerformed(ActionEvent e) {
    for (int i = 0; i < checkboxes.length; i++) {
    if (e.getSource() == checkboxes[i]) {
    suspended[i] = !suspended[i];
    outputs[i].setBackground(
    !suspended[i] ? Color.green : Color.red);
    if (!suspended[i]) {
    notify();
    return;
    Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Abiel wrote:
    No, notifyAll() is used to tell the threads that we're stopping.... see that it's written in the stop() method of the applet. Eg if the user browses away from our applet we set the array of threads to null and notify them all. So notifyAll() makes sense.Yes, it does make sense there too (!!!!!!!).
    However, I gave it a try with what u suggested, and it didn't work (as expected) .... Apparently you did not really read my suggestion or my explanation. If you had, you'd have expected it to work and it would have worked.
    the problems still remains, some threads are getting in wait state even if their check box is not suspended.Maybe you should add the following code to understand the root cause and solution.
        System.out.println("Thread " + index + " will wait to be notified.");
        wait();
        System.out.println("Thread " + index + " was notified.");
    what could the problem be?Improper use of notify()
    With kind regards
    Ben

  • Deitel, Java How To Program exercise question

    Hi, :)
    I'm new to programming and I'm using the Java How To Program Fourth Edition from Deitel and Deitel as my text. I've run into a problem with Exercise 2.16 Where I'm asked:
    "Write an application that asks the user to enter two numbers, obtains the numbers from the user and prints the sum, product, difference, and quotient of the numbers."
    From that I have written this code:
    // Exercise 2.16
    /* An application that asks the user to enter two numbers, obtains the numbers from the use and prints the sum,
    product, difference and quotient of the numbers. Using the techniques shown in Fig 2.9 */
    //Java extension packages
    import javax.swing.JOptionPane;
    public class Exercise2_16{
         //Main method
         public static void main(String args[]){
         String firstNumber, secondNumber;                          //introduce variables
         int number1, number2, sum, product, difference, quotient;          //introduce variables
         firstNumber=JOptionPane.showInputDialog("Enter first integer:");     //Create input window
         secondNumber=JOptionPane.showInputDialog("Enter second integer:");     //Create input window
         number1=Integer.parseInt(firstNumber);                         //String to integer
         number2=Integer.parseInt(secondNumber);                         //String to integer
         //perform operations
         sum = number1+number2;
         product = number1*number2;
         difference = number1-number2;
         quotient = number1/number2;
         //Display results
         JOptionPane.showMessageDialog(null, "The sum is " + sum,
         "The product is " + product, "The difference is " + difference,
         "The quotient is " + quotient, "Results", JOptionPane.INFORMATION_MESSAGE);
         //End program
         System.exit(0);
         }//End main method
    }//end class Exercise2_16
    When I compile this code I get an error and I can't figure out why. Any help is really appreciated as I'm stumped and given the simplicity of the app I'm kinda bummed it has me stuck :(.

    I substituted your line and this is the error I'm receiving now:
    F:\jdk1.3\Learning Java>javac Exercise2_16.java
    Exercise2_16.java:32: unclosed string literal
    JOptionPane.showMessageDialog(null, "The sum is " + sum + ", The product is" + product + ",
    The difference is" + difference + ", The quotient is" + quotient + ", \"Results\", JOptionPane.INFORMATION_MESSAGE);
    ^
    Exercise2_16.java:35: ')' expected
    System.exit(0);
    ^
    2 errors
    It doesn't really matter to me if there are returns but maybe for readability there should be and so I learn how to as well.

  • Error compiling FPGA VI: ERROR:Xflow - Program xst returned error code 6.

    When I use the Linear Interpolation function in my FPGA VI i get the compilation error:
    ERROR:Xflow - Program xst returned error code 6. Aborting flow execution...
    the Compile Server also gives the more detailed information:
    ERROR:Xst:1749 - "C:/NIFPGA85/srvrTmp/LOCALH~1/TRAPCO~2/NiLvFxpFloor.vhd" line 68: error: The output for the floor function should not have any fractional bits.
    I'll be happy for any suggestions how to solve this.

    Hello!
    Could you compile a program with only the Linear Interpolation.vi and only some constants and indicator as input and output?
    I tried on my PC and compile a simple VI containing only the Linear Interpolation.vi
    Which Version of NI-RIO do you use?
    Do you also placed the FPGA VI in library? If yes put out all FPGA VIs from the library and check that they aren't reentrant.
    This could cause problems to the compiling of FPGA VI.
    Try to create a new project with only a VI with the linear interpolation and check if it is compiled.
    Best regards
    Ken

  • How the program work ???

    hi everyont i am doubt about how the program work???
    public class TestClone implements Cloneable{
         int count;
         TestClone next;
         public TestClone(int count){
              this.count=count;
              if(count>0)
              next=new TestClone(count-1);
         void add(){         
         count++;
         if(next!=null) // how it can loop and
         next.count++; //execution next.count++ ??
         public String toString(){    // from the result  the object execut  the method  automatic, but i think  it isnot  definite as static ,it cannot execut
              String s=String.valueOf(count)+"";
              if(next!=null) //the same question as about
              s+=next.toString();
              return s;
         public Object clone(){
              Object o=null;
              try{
                   o=super.clone();
                   }catch(Exception e)
                   {System.out.println("cannot clone");}
                   return o;
    public static void main(String []args){
         TestClone c=new TestClone(5);
         System.out.println("c="+c);
    //the result is 5 4 3 2 1 0
    //c is object why it can print out
         TestClone cl=(TestClone)c.clone();
         System.out.println("c="+c);
         c.add();
         System.out.println("after added\nc="+c+"\ncl="+"cl");
    //the result is 6 5 3 2 1 0 but where is 4 ??
    // 5 4 3 2 1 0
         }     }

    Is this your code? What do you WANT it to do? What's the purpose?
    Thanks!
    -Zach

  • How to get the return values from a web page

    Hi all :
       how to get the return values from a web page ?  I mean how pass values betwen webflow and web page ?
    thank you very much
    Edited by: jingying Sony on Apr 15, 2010 6:15 AM
    Edited by: jingying Sony on Apr 15, 2010 6:18 AM

    Hi,
    What kind of web page do you have? Do you have possibility to for example make RFCs? Then you could trigger events (with parameters that could "return" the values) and the workflow could react to those events. For example your task can have terminating events.
    Regards,
    Karri

  • How to trap null return values from getters when using Method.invoke()?

    Hi,
    I am using Method.invoke() to access getters in an Object. I need to know which getters return a value and which return null. However, irrespective of the actual return value, I am always getting non-null return value when using Method.invoke().
    Unfortunately, the API documentation of Method.invoke() does not specify how it treats null return values.
    Can someone help?
    Thanks

    What do you get as a result?I think I know what the problem is.
    I tested this using following and it worked fine:
    public class TestMethodInvoke {
    public String getName() {
    return null;
    public static void main(String args[]) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
    Object o = new TestMethodInvoke();
    Class cls = o.getClass();
    Method m = cls.getMethod("getName", (Class[]) null);
    Object result = m.invoke(o, (Object[])null);
    if (result == null) {
    System.err.println("OK: Return value was null as expected");
    else {
    System.err.println("FAILED: Return value was NOT null as expected");
    However, when I use the same technique with an EJB 3.0 Entity class, the null return value is not returned. Instead, I get a String() object. Clearly, the problem is the the EJB 3.0 implementation (Glassfish/Toplink) which is manipulating the getters.
    Regards
    Dibyendu

  • How to program a midi foot controller on Mainstage? Does anyone knows how to program the foot controller with exclusive solo channel in order not to dance "tip tap" while from clean guitar I go to crunch or solo? How to do this programming on Mainstage?

    How to program a midi foot controller on Mainstage? Does anyone knows how to program the foot controller with exclusive solo channel in order not to dance "tip tap" while from clean guitar I go to crunch or solo? How to do this programming on Mainstage?
    I basically managed to learn how to invert parameters which allows me to be as default in the clean guitar channel and if I switch the first button on the midi foot controller I switch to crunch, but at this point I tryied so hard to programm the second and third button to switch, only through a button in one step, to a third channel for distorsion or a 4th channel for solo guitar but I couldn't figured out how this work can be done!
    I would appreciate if anyone could help or share this experience with others who are experiencing the same problem.
    Cheers.
    F.

    I cannot seem to get mainstage to recognize my FCB either. I am using IFCB. Anyone figure this out?
    Thanks,
    Eric

  • How to program mails to be sent in future date

    hi
    i would like to knwo how to program my mails to be sent in a future date.
    in the mail application and Outlook for Mac.
    (outlook for windows allows me to program de date a mail may be sent)
    best regards    

    You can use the Automator app to set an alarm on your calendar which sends the mail at a future time.
    It's simpler than it might sound.  This explains how:
    http://joannalaforet.wordpress.com/2010/02/08/schedule-mail-on-mac-the-easier-wa y-automator-ical-alarm/

  • I want to send 10 bit ADC from PIC via serial communicaton. i send it separetly 8 bit first then the other 2 bit. how to program in labview to capture those two packet then combine it togother

    i want to send 10 bit ADC from PIC mCu via serial communicaton.
     i send it separetly 8 bit first then the other 2 bit (2 bit --> with zero at 6 bit from LSB).
    how to program in labview to capture those two packet and then combine it together
    so i have 10 bit in lab view
    thank you

    Close, but now quite. You need to specify to the VISA Read how many bytes to read, not how many bits. Thus, the input would be 2, not 16. It's also not clear why you're trying to use the "String to Byte Array". The Type Cast will give you a number based on what data type you wired. You're basically telling it how to interpret the string. In this case we're telling it to interpret the string a 16-bit value, so we'll get a 16-bit integer. I know you said you wanted a 10-bit, but you can't have that. You'll get a 16-bit with 6 bits set to zero. Note: I did not completely understand what you said so we may need to change this slightly, but we want to get the communication and reading collection working first.
    Also, since you seem to be setting this in a loop you probably want to monitor this or to collect the data. For that you need a shift register. See attached for a modified version of your attempt. You need to set the datatype to I16 or U16 based on whether the value you get from the PIC is signed or unsigned.
    Message Edited by smercurio_fc on 05-01-2007 02:28 PM
    Attachments:
    Read PIC.vi ‏21 KB
    Read PIC.png ‏7 KB

  • How to transfer customr return stock to jobwork ( reapir) vendor

    Dear All,
    Please let me know -
    Suppose i had a customer defective (customer returns)stock in my plant ( which is non valuated stock). I would like to send the same for repair/ service to outside from my plant.
    I do not want any valuation / accounting effect while sending the customer defective material outside. So please suggest me-
    How to transfer customr return stock to jobwork ( reapir) vendor ? Through which movement type ? GR MvT ?
    Waiting for reply.
    Thanks & Regards
    Mangesh

    Hi,
    You can send the material using movement type 512 in MIGO using option Goods Issue > Others. And cancel the same material document when you get the materials back from vendor after repair.
    Then follow Service Process Cycle for paying the repair charges to vendor
    1. ME21N - Create Service PO (With Item Category D and Account Assignment Category K )
    2. ML81N - Create Service Entry Sheet w.r.t. Service PO
    3. MIRO - LIV for Service Charges w.r.t. Service PO or Service Entry Sheet
    For Service Process, refer following link;
    [SAP External Service Management|http://www.sap123.com/showthread.php?t=52]

  • I don't know how to program my DVR to edit out the commercial​s

    Does anyone know how to program the DVR not to record the commercials?  Its not a problem on public television, of course.

    Actually often very easy to do, but we will not see it again.  The Industry has fought against it and made all the manufacturers remove such features.

Maybe you are looking for

  • IPhone crashes and not turning back on

    Hi to all of you. First I wanna apoligize if I'm posting this in the wrong discution board, I am new here So, here's my problem. I have an iPhone 3GS with iOS 4.0.1.  I got the phone last summer, with iOS 3 point something, and I updated it to it's c

  • When Installing iTunes I get an Error Message About A Registry Key

    It gives me this error message: Could not open key: HKEYLOCALMACHINE\Software\Classes\QuickTimePlayerLib.QuickTimePlayerApp\CLSID. Verify that you have sufficient access to that key, or contact your support personnel. I can't find that error listed a

  • Cannot invert a b/w layer

    In the past I have always been able to create a duplicate layer, make it b/w and then invert. I have tried select/invert, and Ctrl-I. Nothing happerns. I think I am going crazy. What have I done wrong? Windows 7 Prof, CS6

  • HT1212 Still doesn't work

    but every time I try to restore it iTunes keeps asking for my pass code. How do I get past this?

  • Is there a deadline for updating Photoshop CS5?

    I use CS5.  I am wondering if there is a deadline for updating to CS 6 or beyond? Thank you. Al Charbonneau