JOptionPane.showInputDialog error checking?

menu = JOptionPane.showInputDialog("What would you like to do next: \n" +
"1: Enter another person (" + (data.length - index - 1) + " entries left)\n" +
"2: Display data sorted by First Name\n" +
"3: Display data sorted by Last Name\n" +
"4: Display data sorted by Birth Date\n" +
"5: Search data by First Name\n" +
"6: Search data by Last Name\n" +
"7: Search data by Birth Date\n\n" +
"0: Exit");How can I error check that to make only those values will be entered. I thought I would be able to say something like, if(menu != "0") and so on, but that doesn't seem to work, neither does if(menu == null). Thanks in advance for any help, I am probably just doing something stupid.

You will get more chance on a suitable answer if you post this Swing related question in the Swing forum: http://forum.java.sun.com/forum.jspa?forumID=57

Similar Messages

  • Catch user entry error in JOptionPane.showInputDialog()

    i just want to know if the user entered a String instead of a int...
    i tryed instanceof but didnt worked..
    m_sQuantite = JOptionPane.showInputDialog("How much do you need : " + itmSelect.toString());

    what r u about to ask, what the statement returns.

  • JOptionPane.showInputDialog and the cancel button

    so i'm using a JOptionPane.showInputDialog, and everything works except when i click the cancel button to exit the window, it gives me an error.
    how can i remedy this?
    here's a section of my code: (a is an array, as is b)
    firstWord = JOptionPane.showInputDialog
    ("What company's sloagan is/was: "+a[count]+"?");
    if(firstWord.equalsIgnoreCase(b[count]))
    JOptionPane.showMessageDialog (null,
    "Thats Right, the company was "+b[count]+".");
    count++;
    int YesNo = JOptionPane.showConfirmDialog (null,
    "Do you want to play again?", "Choose One", JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE);
    if(YesNo==1) //this should exit out if you click no
    System.exit (0);
    if(count==10)
    JOptionPane.showMessageDialog(null,
    "Game Over. You Won.");
    System.exit (0);
    else
    JOptionPane.showMessageDialog (null,
    "Sorry, you aren't that smart. Guess again.");
    }]

    1- Seems like you misstyped your code tags...
    2- When you say: "it gives me an error", please provide details (e.g. stack trace)
    3- Read the API doc, it says: showInputDialog returns user's input, or null meaning the user canceled the input.
    So firstWord.equalsIgnoreCase(b[count]) will throw a NullPointerException in that case.
    You might check for null value.
    Note:str1.equals(str2) will throw a NullPointerException when str1 is null, but str2 can be null without a NullPointerException being thrown:String str1 = null;
    String str2 = "toto";
    System.out.println(str1.equals(str2)); // NullPointerException
    System.out.println(str2.equals(str1)); // ok (prints false)

  • JOptionPane Compilling error

    Can someone please help me with this compiling error....java:17: incompatible types
    found : void
    required: java.lang.String
    String output = JOptionPane.showMessageDialog(null,message,"Rectangle Properties", JOptionPane.PLAIN_MESSAGE);
    1 error
    I know it probally has to do with the null but i dont know what to change it to....can someone please help
    import javax.swing.JOptionPane;
    import java.text.NumberFormat;
    public class RectangleApp
         public static void main(String[] args)
              String lenString = JOptionPane.showInputDialog(null,"Enter the length of a rectangle",
                                                                        "Length input", JOptionPane.INFORMATION_MESSAGE);
              double length = DataValidator.parseDouble(lenString);
              String widString = JOptionPane.showInputDialog(null,"Enter the width of a rectangle",
                                                                       "Width input", JOptionPane.INFORMATION_MESSAGE);
              double width = DataValidator.parseDouble(widString);
              Rectangle rectangle;
              rectangle = new Rectangle(length,width);
              String message = rectangle.toString();
              String output = JOptionPane.showMessageDialog(null,message,"Rectangle Properties", JOptionPane.PLAIN_MESSAGE);
              System.exit(0);                                                                                                                  
    }

    If you look at the API docs, which you always should...
    showMessageDialog() returns void and you are assigning it to String.
    Change the last line
    String output = JOptionPane.showMessageDialog(null,message,"Rectangle Properties", JOptionPane.PLAIN_MESSAGE);
    to
    JOptionPane.showMessageDialog(null,message,"Rectangle Properties", JOptionPane.PLAIN_MESSAGE);
    Regards
    $ Carol

  • HELP --JOPtionPane.showInputDialog

    I was developing a employee information system in swing.
    On the way of development,the major problem the is occuring
    is that two JOPtionPane.showInput Dialog boxes are appearing
    at a time.When I fetching the data to the JOPtionPane.showInput Dialog box and then clicking the "ok" option button,another JOPtionPane.showInput Dialog box appears making the program difficult to
    bug.
    Please suggest ways to solve this bug.

    It is more likely that your program has logical errors, just search for all JOptionPane.showInputDialog(...) statements and insert a println statement before it to trace the source of the problem.
    Visual Paradigm - http://visual-paradigm.com/

  • Error checking no longer works when filling in a form - FF 29

    I am running FF 29.0 and when I try to fill in the following form, the error checking on the form does not work, I cannot tick the checkbox and the 'Submit' button remains 'greyed-out'.
    The problem persists in 'Safe' mode. Here is the form in question:-
    https://digitalmailbox.com.au/registration
    Hope a solution can be found.
    Regards
    Dennis W

    I don't normally use Internet Explorer but on this occasion I thought I would give it a try.
    IE 11.0.9600.17105 handles the above registration page without a problem.
    Is the problem with FF 29 or with the webpage in question?
    Regards
    Dennis W

  • JOptionPane.showInputDialog and Focus

    I have a program that allows the user to type in a String in a text box and when they hit the enter key the text will appear in a text area. I've also added a menu bar to the program. When the user clicks on File and then Connect from the menu bar I want a JOptionPane to pop up that asks for the user to type in a username and then prompt for a password. And I've gotten all of that to work. Now for the problem. I click on file from the menu bar and then connect and it prompts me for the username as it should. I am able to just type in a phrase in the text field of the username dialog box and hit the enter key and then it prompts me for my password. I am still able to type in a phrase in the text field of the password Dialog box, however when I hit the enter key, the Dialog box does not close as it did for the username Dialog box. It will still close if I click on the OK button, but just pressing the enter key does not close the Dialog box as it did when it prompted for a username. I'm thinking I need to direct the focus to the password dialog box, but not sure how to go about doing this. Any help in solving this problem would be greatly appreciated.
    Here is my code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class TestJOptionPane extends JFrame implements ActionListener{
         private static int borderwidth = 570;
         private static int borderheight = 500;
         private JPanel p1 = new JPanel();
         private JMenu m1 = new JMenu("File");
         private JMenuBar mb1 = new JMenuBar();
         private JTextArea ta1 = new JTextArea("");
         private JTextField tf1 =new JTextField();
         private Container pane;
         private static String s1, username, password;
         private JMenuItem [] mia1 = {new JMenuItem("Connect"),new JMenuItem("DisConnect"),
              new JMenuItem("New..."), new JMenuItem ("Open..."), new JMenuItem ("Save"),
              new JMenuItem ("Save As..."), new JMenuItem ("Exit")};
    public TestJOptionPane (){
         pane = this.getContentPane();
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
         dispose();
    System.exit(0);
         setJMenuBar(mb1);
    mb1.add(m1);
    for(int j=0; j<mia1.length; j++){
         m1.add(mia1[j]);
    p1.setLayout( new BorderLayout(0,0));
    setSize(borderwidth, borderheight);
    pane.add(p1);
              p1.add(tf1, BorderLayout.NORTH);
              p1.add(ta1, BorderLayout.CENTER);
              this.show();
              tf1.addActionListener(this);
              for(int j=0; j<mia1.length; j++){
                   mia1[j].addActionListener(this);
         public void actionPerformed(ActionEvent e){
              Object source = e.getSource();
              if(source.equals(mia1 [0])){
                   username = JOptionPane.showInputDialog(pane, "Username");
                   password = JOptionPane.showInputDialog(pane, "Password");
              if(source.equals(tf1)){
                   s1=tf1.getText();
                   ta1.append(s1+"\n");
                   s1="";
                   tf1.setText("");
         public static void main(String args[]){
              TestJOptionPane test= new TestJOptionPane();
    }

    But using JOptionPane doesn't get the focus when you call itworks ok like this
    import javax.swing.*;
    import java.awt.event.*;
    class Testing
      public Testing()
        final JPasswordField pwd = new JPasswordField(10);
        ActionListener al = new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            pwd.requestFocusInWindow();}};
        javax.swing.Timer timer = new javax.swing.Timer(250,al);
        timer.setRepeats(false);
        timer.start();
        int action = JOptionPane.showConfirmDialog(null, pwd,"Enter Password",JOptionPane.OK_CANCEL_OPTION);
        if(action < 0)JOptionPane.showMessageDialog(null,"Cancel, X or escape key selected");
        else JOptionPane.showMessageDialog(null,"Your password is "+new String(pwd.getPassword()));
        System.exit(0);
      public static void main(String args[]){new Testing();}
    }

  • Error checking transport group configuration in System BQS

    Hi Everyone,
    I made a client export from Production to Quality. It went successfully,, I noted the requests numbers and transported them from PRD to Quality, but while transporting there was a tp error(which i did not note), next i went to the quality import queue and saw all the 3 requests had come. But when i click the adjust queue icon im getting the following error message "Error checking transport group configuration in System BQS" .  Afterwards i tried to delete the requests from quality to retransport  from production but still im not able to delete those requests from quality. Can anyone help me solve this.
    Regards,
    Rahul

    Hello Rahul,
    regarding the error message:
    "Error checking transport group configuration in system"
    It's mostly related to the TMSADM RFC destination. Kindly follow the below mention steps:
    1. Logon to client 000 with user DDIC.
    2. STMS   > System   > Overview   > Select the system in which you are logged in   > Click on the menu says EXTRAS   > Generate RFC Destinations
    Perform the above steps in all the systems configure in your TMS. This should resolve the issue.
    Best regards,
    Tomas Black

  • Windows vista system, continuously trying to download a DRM file in Adobe Digital Editions application shows "Error check activation". I have authorized the Fire Wall and still the same.

    windows vista system, continuously trying to download a DRM file in Adobe Digital Editions application shows "Error check activation". I have authorized the Fire Wall and still the same.

    Since Re-activation as suggested by the link above is not working for you, Can you please confirm the following:
    The OperatorURL is reachable. ( you can find the operatorURL from the acsm file by opening it in notepad,etc)
    And Book is still available on the book-store for purchase.
    (If any of first two are not available, you might have to talk to distributor for next action item to get the book. Since you will have record of purchasing the book, (in my opinion) they should provide you the new token for downloading the book)
    And please confirm this that you used the same userID for downloading that you used when you first fulfilled/downloaded the book.
    (If it is the case, then you have to use the correct userID)
    I hope it helps.

  • Hp laserjet m1536dnf mfp. "Connection error Check connection".

    i have hp laserjet m1536dnf mfp.  when tried to enable eprint at the web services setup menu... i get "Connection error Check connection".  Network and Internet connection works fine.  Please help?
    It seems like the Printer is having a hard time connecting to the ePrint server to get me the email address. 
    Thanks,
    John

    Hi,
    My firmware is up todate.
    I have tried all the recommended support steps... currently had the printer on manual IP.  Still same connection error.
    Product Name: HP LaserJet M1536dnf MFP Formatter Number: P932T2L Serial Number: CNC9C7WB2W Service ID: 21270 Firmware Date: 20110405 Disable Fax: No Telecom Version: 04-015-001 Location: USA ADF Installed: Yes Max Monochrome Print Quality: FastRes 1200 Controller Number: 52 Duplexer Version: 0 Device Description: HP LaserJet M1536dnf MFP Language: English Asset Number: 153 Company Name:   Contact Person:   Device Location: warehouse Product Security: Off Quiet Mode: Off
    Hardware Address: 10:1f:74:46:4f:20 Host Name: NPI464F20 IPv4 Address: 10.0.1.112 Status Ready   IPv4 Address: 10.0.1.112 Subnet Mask: 255.255.255.0 Default Gateway: 10.0.1.1 IP Configured By: Manual WINS Server: 0.0.0.0 Preferred DNS Address: 205.152.37.23 Alternate DNS Address: 205.152.150.23 Status: Connected Hardware Address: 10:1f:74:46:4f:20 Link Speed and Duplex Negotiation: Automatic
    Link Speed: 100 Mbps Duplex: Full Auto Crossover: Enabled

  • What do you think of my Bash Script? What about the error checking?

    Well what do you think of this Bash script
    It works
    I gave it some problems (i.e. unpluged the ethernet, messed up the URL's, uninstaled some programs...) to see if would report errors and stop or just keep going... But it did
    I just kind of thought up a way to do some error checking with the commands that I know.....
    What is a better way to do error checking?
    What do you think I should add/Do to this script?
    #!/bin/bash
    # Shell script to make a USB Tumb Drive for Flashing BIOS on a Lenovo Ideapad Y510.
    # This script needs to be owned and run as ROOT with the "sudo command"
    # i.e. sudo usbbiosflasher
    # If you have anyideas send me a PM on ubuntufourms.org my user name is HunterThomson
    # Name/Rename this script usbbiosflasher and save it to the ~/home directory.
    # Then run the command- chown root:root usbbiosflasher
    # Then run the command- chmod 755 usbbiosflasher
    # Then copy the script to the directory /usr/bin.
    # Run this comand to do that- sudo cp ~/usbbiosflasher /usr/bin
    # You also must have the program "mbr" installed
    # You can install the mbr program by running this comand in the shell on Ubuntu
    # sudo apt-get install mbr
    # In Arch Linux you have to get it from Aur
    # First you will need to know a few things...
    # You will also need to know the Mount Point i.e. /media/disk and the /dev path i.e. /dev/sdb1.
    # You can find these by using the df -T comand.
    # Run df -T in the shell. Then plug in the USB Thumb Drive and run the df -T comand agin.
    # The new listing is the USB Thumb Dirve.
    # Also check to make sure the File System tipe is vFAT or FAT16 or FAT32.
    # If it is not use gparted to format it to FAT32.
    # I am farly certen that all USB Thumb drives come formated with FAT file system out of the BOX.
    # You may want to fromat it anyway just to make sure.
    echo "Interactive Shell Script to Make a USB Thumb Drive \for Flashing BIOS On a Lenovo Ideapad Y510"
    echo ""
    echo "You will need to have the program mbr installed"
    echo "If you are on Ubuntu Linux you can retreve it form the repositories"
    echo "If you are on Arch Linux you will need to get it from the Aur repository"
    echo "Open anuther shell and \do that now..."
    echo ""
    verify="n"
    while [ "$verify" != y ]
    do
    printf "Do you have mbr installed... yes or no?"
    read AN1
    echo ""
    printf "You answered... $AN1 I have installed mbr. Is this correct... y or n?"
    read verify
    done
    echo ""
    if [ "$AN1" == "no" ]
    then
    echo "Install mbr now. Then run this script agin"
    exit
    else
    echo "contunuing script"
    fi
    echo ""
    # The next comand will make a directory to put needed files into. Note this file and everything init will be owned by root.
    mkdir ~/usbbiosfiles && check1="yes"
    if [ "$check1" = "yes" ]
    then
    echo "Made directory usbbiosfiles... OK"
    else
    echo "Could not \make directory usbbiosfiles"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    exit
    fi
    # The next two comands will get the FreeDOS file and the .ROM file.
    cd ~/usbbiosfiles && checka="yes"
    if [ "$checka" = "yes" ]
    then
    echo "Changing to the usbbiosfiles directory... OK"
    else
    echo "Could not Change to the usbbiosfiles directory"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    wget "http://www.fdos.org/bootdisks/autogen/FDOEM.144.gz" && check2="yes"
    if [ "$check2" = "yes" ]
    then
    echo "Download of FreeDOS... OK"
    else
    echo "Could not Download FreeDOS"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    wget "http://ubuntuforums.org/attachment.php?attachmentid=78460&d=1216648756" && check3="yes"
    if [ "$check3" = "yes" ]
    then
    echo "Download of the BIOS.ROM \file... OK"
    else
    echo "Could not Downlad the BIOS.ROM \file"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    # The next comand will name the .ROM file to the right name.
    mv ~/usbbiosfiles/attachment.php?attachmentid=78460\&d=1216648756 ~/usbbiosfiles/06CN29WW.bios.update.tar.bz2 && check4="yes"
    if [ "$check4" = "yes" ]
    then
    echo "Renameing of the BIOS.ROM \file... OK"
    else
    echo "Could not rename the BIOS.ROM \file"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    echo ""
    # The next two comands set the variables. DEVX for the path i.e. /dev/xxx and MOUNTX for the mount point i.e. /media/xxx
    verify="n"
    while [ "$verify" != y ]
    do
    echo "You will need to know the Mount Point and the dev Path. You will also need to \make sure the File System \type is vFAT, FAT16 or FAT32."
    echo ""
    echo "With the USB Thumb Drive unpluged, Open another shell and run the comand df -T Then plug \in the USB Thumb Drive and run the comand df -T one \more time. The new device listed is the USB Thumb Drive. Note the Mount Point and The dev Path and the File system Type i.e. vFAT... If the File System \type is not vFAT, FAT16 or FAT32 you will need to fromat it with gparted. You may want to format the USB Thumb Drive anyway just to \make sure. In any \case delete all files and directorys on the USB drive before you go any ferther with this program."
    echo ""
    printf "Enter the dev path the USB Thumb Drive is at?"
    read DEVX
    echo ""
    echo "Are you sure $DEVX is the dev path of the USB Thumb Drive... y or n?"
    read verify
    done
    echo ""
    verify="n"
    while [ "$verify" != y ]
    do
    printf "What is the Mount Point of the USB Thumb Drive?"
    read MOUNTX
    echo ""
    echo "Are you sure $MOUNTX is the Mount Point of the USB Drive... y or n?"
    read verify
    done
    echo ""
    install-mbr --enable A1 --partition 1 --force --timeout 0 $DEVX && check5="yes"
    if [ "$check5" = "yes" ]
    then
    echo "Installing MBR on USB Thumb Dirve... OK"
    else
    echo "Could not install MBR on USB Thumb Drive"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    tar xjf ~/usbbiosfiles/*.tar.bz2 && check7="yes"
    if [ "$check7" = "yes" ]
    then
    echo "Unpacking BIOS.ROM file... OK"
    else
    echo "Could not unpack BIOS.ROM file"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    gunzip ~/usbbiosfiles/FDOEM.144.gz && check8="yes"
    if [ "$check8" = "yes" ]
    then
    echo "Unpacking FreeDOS files... OK"
    else
    echo "Could not unpack FreeDOS files"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    mkdir ~/usbbiosfiles/fdoem144 && check9="yes"
    if [ "$check9" = "yes" ]
    then
    echo "Made directory fdoem144 in direcoty usbbiosfiles... OK"
    echo ""
    echo "Going to \sleep \for 5secs"
    else
    echo "Could not make directory fdoem144 in usbbiosfiles directory"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    modprobe loop && sleep 5 && check0="yes"
    if [ "$check0" = "yes" ]
    then
    echo "Modprobeing loop... OK"
    else
    echo "Could not \modprobe loop"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    mount -o loop ~/usbbiosfiles/FDOEM.144 ~/usbbiosfiles/fdoem144 && check10="yes"
    if [ "$check10" = "yes" ]
    then
    echo "Mounting FreeDOS on the fdoem144 directory... OK"
    else
    echo "Could not \mount FreeDOS on the fdoem144 directory"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    cp ~/usbbiosfiles/fdoem144/* $MOUNTX && check11="yes"
    if [ "$check11" = "yes" ]
    then
    echo "Copying FreeDOS files to $MOUNTX... OK"
    else
    echo "Could not copy FreeDOS files to $MOUNTX"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    cp ~/usbbiosfiles/*.ROM $MOUNTX && check12="yes"
    if [ "$check12" = "yes" ]
    then
    echo "Copying BIOS.ROM files to $MOUNTX... OK"
    else
    echo "Could not copy BIOS.ROM files to $MOUNTX"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    sync && check13="yes"
    if [ "$check13" = "yes" ]
    then
    echo "Runing the syncing command... OK"
    else
    echo "Could not run the syncing command"
    echo "look above \for \info"
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this scrip agin"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    rm -r ~/usbbiosfiles
    exit
    fi
    umount ~/usbbiosfiles/fdoem144 && check14="yes"
    if [ "$check14" = "yes" ]
    then
    echo "Unmounting of FreeDOS... OK"
    else
    echo "Could not unmount FreeDOS"
    echo "Look above for errors or problems reported and fix the problem"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this script agin"
    rm -r ~/usbbiosfiles
    exit
    fi
    verify="n"
    while [ "$verify" != y ]
    do
    printf "Do you see any errors... yes or no?"
    read AN2
    echo ""
    printf "You answered... $AN2 to errors. Is this correct... y or n?"
    read verify
    done
    echo ""
    if [ "$AN2" == "yes" ]
    then
    echo "User Repoted... Error"
    echo "Look above for errors or problems reported and fix the problem"
    echo ""
    echo "removeing directory usbbiosfiles..."
    echo ""
    echo "Reformat the USB Stick to FAT32 with gparted"
    echo "Fix the problem and run this script agin"
    rm -r ~/usbbiosfiles
    exit
    else
    echo "Success"
    echo "I did a lot of error checking too and didnt find anything"
    echo ""
    echo "Go get a pen and paper to write down these instructions"
    printf "Then hit the Enter to continue"
    read WAIT
    echo ""
    echo "Now leave the USB Thumb Drive pluged into your computer and Reboot. When the Lenovo Logo POST screen appears hit F2 to enter the CMOS setup utility. Go over to BOOT tab and go down to HardDrive \(Not Boot Order) \then \select the USB Thumb Drive as the 1st hard drve. Then F10 and yes to save changes. Your compter will reboot agin. Then when the Lenovo Logo POST Screen appers on reboot hit F4 to enter the BIOS FLASHING program. The USB Thumb Drive will be seen as the C drive \in the list on the Left, Select it. Then \select the .ROM \file \in the list on the Right and start the BIOS FLASH. \(NOTE Your hart may stop beating... This is normal) Pray to any God you know of and your computer should restart just like normal. Hit F2 and the BIOS will now stay it is 06CN29WW. You will need to \set the boot order to the way you like it and other things \if you need to because they have been changed to the default."
    fi
    echo ""
    echo "End of script"
    Last edited by hunterthomson (2008-08-10 11:17:47)

    Personally.....  (this is just how I would have written it - if it works, then it's good enough for me though )
    I would change this whole block:
    verify="n"
    while [ "$verify" != y ]
    do
    printf "Do you have mbr installed... yes or no?"
    read AN1
    echo ""
    printf "You answered... $AN1 I have installed mbr. Is this correct... y or n?"
    read verify
    done
    echo ""
    if [ "$AN1" == "no" ]
    then
    echo "Install mbr now. Then run this script agin"
    exit
    else
    echo "contunuing script"
    fi
    To this much shorter code:
    MBR='/usr/bin/install-mbr' # Or where ever you expect it to be
    if [ ! -x $MBR ] ; then
    echo "mbr doesn't appear to be installed."
    echo "If it is installed, check it's location, make sure it's executable and then make sure the MBR variable in this script is correct"
    exit 1
    fi
    I wouldn't have used the checkXX variables for each stage:
    mkdir ~/usbbiosfiles
    if [ $? != 0 ] ; then
    #failed
    echo "Could not \make directory usbbiosfiles"
    echo "look above \for \info"
    echo "Fix the problem and run this scrip agin"
    exit 1
    else
    echo "Made directory usbbiosfiles... OK"
    fi
    There is an issue with the way you do your verifications - the user can never get out unless they answer 'y' or hit CTRL+C. Something like this gives them options:
    verify="n"
    while [ "$verify" != "y" && "$verify" != "n" ]; do
    echo "You need to answer 'y'es or 'n'o"
    read verify
    echo $verify | tr "[:upper:]" "[:lower:]" # This converts the answer to lowercase so replies entered in upper case will still work
    done
    if [ $verify != 'y' ] ; then
    exit 1
    fi
    One last thing I try to do in scripts... Declare all your binaries as variables at the start of the program, then execute the binary program by using the variable. For example:
    # Binaries
    TAR='/bin/tar'
    CP='/bin/cp'
    CHMOD='/bin/chmod'
    # Execute tar and chmod the created file
    $TAR cvzf /tmp/tarfile.tar.gz /etc/*.conf
    $CHMOD 400 /etc/*.conf
    This way, it's easy to change the path in future without having to hunt through the script if the paths change, and it also ensures you're calling the programs using the full paths to make sure you're not executing some strange variant or alias that someone has setup. If I use `chmod` 30 times in a script, and the path changes in the future or on a different system (`chmod` is a bad example cause it's highly unlikely to change, but you know what I mean), then all you need to do is update the variable at the start of the script, and it all works again without having to script-hunt and change it 30 times.

  • Error "Check Table TFBEFU_CR : entry 10 does not exist" getting

    Hi All ,
    While doing Goods Receipt for Prodn Order , error "Check Table TFBEFU_CR : entry 10 does not exist" getting Prompted.
    Could u pls help me to solve it
    Regards
    Sandeep

    you need to apply the OSS  note 107588. it is excatly for the same problem yoy mentioned here.
    check the note

  • Using a Counter to error-check External Sample Clock

    Hi all,
    I am newish to labview and am working on a data acquisition project. I've managed to get the basics under control, but here's my situation and question...
    -- I am using the S-6123 card to capture and record data on two or more AI channels.  I am using a rotary encoder to generate a pulsetrain that I am using via PFI0 as the sample clock for recording the AI data.
    -- This rotary encoder gives 720 pulses per revolution and an index pulse once per revolution.
    -- In my data acquisition, I am pulling 1440 samples at a time with the DAQmx "read" function.
    I have been experimenting with counters and can get the RPM out of the pulse trains well enough, however I was wondering...
    Is there some way to use the 2 counters on the card (and signal routing of the two pulse trains) to double-check that the 1440 samples I take correspond to two exact revolutions, and that I'm not getting ahead of or behind the rotation of the encoder due to missing clock pulses or reading false pulses. I have a couple of ideas on how to attempt to do it, but to me they don't seem very reliable or efficient, so I thought I'd put it to the experts to point out of there is a more obvious way of doing it.
    I have attached a pdf of the specifications of the encoder family, the pulses that will be output are on the right hand side of page 2.
    With many thanks in advance,
    Peter
    Message Edited by mumech on 07-22-2008 01:05 AM
    Attachments:
    REncoder Specs.pdf ‏312 KB

    Thanks very much for your reply. I had come across the use of counters with angular encoders but hadn't quite thought of the concept in this way.
    I will have to experiment a bit over the next day or to see what this is capable of, the examples seem quite comprehensive, however I'm not sure if I will run into issues due to the fact that I am using the rotary encoder as the sample clock for my analogue data.
    Would I indeed be able to compare these values (ideally check the position of the encoder after each set of data acquisition) without a "third party" sample clock common to both? (which isn't appropriate for this application)
    If I was only running at low speeds, I might be able to implement this by simply checking the position of the encoder after each read of the data. However, at higher speeds there might be synchronization issues due to the buffering of the analogue data. So when getting the measurement from the encoder counter chances are the analogue data was acquired at an earlier time.
    I know I haven't worded this very well, but how might I synchronise this error checking method?

  • Error checking for OS X updates

    hi,
    im getting this message when checking for updates (App Store)   " an error has occurred
    Could not load data from Apple's software update server "
    bootcamp assistant is giving me this message too "Could not download the software due to a network problem." when trying to download windows drivers..
    can´t find a solution.
    thanks.

    Cross reference
    error checking for OS X updates – MacRumors Forums (2015-04-05)

  • Lumira Login Error "Check the Server Name and Instance ID"

    Dear Experts
      I installed Lumira Desktop and was able to connect to the
    HANA Server.
    Later while I was working the software hanged and I had to
    shut it down.
        Now, after re-opening the software I receive error "Check the Server Name and Instance ID"
    (though the server credentials are same as error and correct”
    Any suggests on how to rectify

    I wonder if one of the following KBAs may give you a clue?
    1995325 - Error HDB 11009: The dataset could not be published to SAP Lumira Server because publishing to the SAP HANA layer failed. Lumira Server
    2134259 - Lumira LaunchPad Logon Hangs
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow me on Twitter (#SAPLumira)
    Got Enhancement ideas? Use the SAP Idea Place 

Maybe you are looking for