Help,how to check a input type?

Dear all experts,
in the selection-screen,user need to key in the vendor consignment code ( vdrcsg  for mslb-lifnr ) some user key in storage location ( mseg-lgort ) in this field. Is there anyway tat i can do verification before procees to the start-of-selection? how to check if the user key in correct data type to the selection screen? thanks

hi Joan,
        Check these links :
http://help.sap.com/saphelp_erp2005vp/helpdata/en/79/34a234d9b511d1950e0000e8353423/frameset.htm
http://www.erpgenie.com/abap/selection_screens.htm
http://www.sapdevelopment.co.uk/reporting/selscr/selscr_loopscreen.htm
priyanka.

Similar Messages

  • How to check current input/output rate on router subintenterface via SNMP?

    How to check current input/output rate on router (2821, etc..) subintenterface via SNMP, like cacti monitoring system.
    I cant find OID to make this with snmpwalk.
    Or there is no way to check current load by this way? Only polling?
    P.S. Ethernet subinterface, of course.
    With great respect, S.A.

    Hi,
    Try to use:
    1.3.6.1.4.1.9.2.2.1.1.6 - InBitRate
    1.3.6.1.4.1.9.2.2.1.1.8 - OutBitRate
    1.3.6.1.4.1.9.2.2.1.1.28 - ifDescription

  • How to check event.target type in "if" statement

    Hi, i have "roll over" event listener and i would like to that works only with MovieClips (without textfields etc.). I would like to write something like that:
    if(event.target == MovieClip){ do something }
    else { do something else}
    This doesn`t work properly.
    How to check type of event.target in "if" statement?
    Thanks for any help.


    if(getQualifiedClassName(event.target) == "flash.display::MovieClip"){ do something }
    else { do something else}
     .

  • How to check users inputs

    hi,there
    i am developing an on-line shop,at the end of checking out process , the users are supposed to submit a details form which including first name ,surname, address,email, phone no, card number etc. Can any one tell me how to check those details are valid before sending to database by using javabean or taglib.
    any information is helpful , thanks in advance.

    You have three choices:
    (1) Client-side checking using JavaScript,
    (2) Server-side checking using JavaBeans,
    (3) Both.
    You can check on the client side using JavaScript to make sure that e-mail address formats are valid, numbers are numbers, strings are the right length and format, dates are correct for the locale, etc. You might want to look at the JSTL I18N capabilities here to make sure your pages can handle different locales. This saves you a network roundtrip if something is formatted incorrectly.
    The server-side checking is different: it makes sure that the input satisfies business rules. You can check for correct format again if you wish, OR assume that the client has already taken care of this. (Depends on how paranoid you want to be.) The business rules for correctness belong on the server side, not in the client.
    I'd recommend both. They really are two different kinds of checks.
    MOD

  • Help--how to check the exact time?

    Pls help me:
    How to check the accurate down-time when the Sun machine (with solaris 8 sparc) abnomally shutdown (eg. power failure)?
    or
    Is there any way to detect the exact time when I shutdown the Sun machine ?
    thanks.

    check /var/adm/messages ; uptime ; last ..
    there are quite a few method u can use

  • How to check 2 condition types (kschl)

    Hi,
    READ TABLE i_komv WITH KEY kposn = ekPo-ebelp kschl EQ 'JEC1' OR
                                                  KSCHL EQ 'JMO1'.
    how to write this above stmt? I have to check 2 condition types with a single read stmt?
    regards,
    Star Shankar

    I guess Kishan wants to refer as:
    READ TABLE i_komv WITH KEY kposn = ekPo-ebelp .
    if <b>i_komv-</b>kschl EQ 'JEC1' OR
    <b>i_komv-</b>KSCHL EQ 'JMO1'.
    ....<code>
    endif.
    As KSCHL is part of internal table I_KOMV.
    or
    READ TABLE i_komv WITH KEY kposn = ekPo-ebelp .
    check i_komv-kschl EQ 'JEC1' OR i_komv-KSCHL EQ 'JMO1'.
    ....<code>
    Kishan,
    Correct me if i am wrong.
    Regards
    Eswar

  • How to check date input.

    In a JText, I input a date valu, when i got the value ,i want to check if it's reasonable.
    but idon't know how to check a number:
    for example:
    i input 31/31/2004,
    you know it's not reasonable.
    how to check it?

    Here is a function that check for a valid date:
    public boolean validDate(String strDatum)
    boolean dane = true;
    Calendar calendarDatum = Calendar.getInstance();
    int godina = 0, mesec = 0, den = 0, najgolemDen = 0;
    int i;
    if(strDatum.length()<10)
    dane = false;
    else
    for(i=0;i<2;i++)
    if(!Character.isDigit(strDatum.charAt(i)))
    dane = false;
    for(i=3;i<5;i++)
    if(!Character.isDigit(strDatum.charAt(i)))
    dane = false;
    for(i=6;i<10;i++)
    if(!Character.isDigit(strDatum.charAt(i)))
    dane = false;
    if(dane)
    godina = Integer.parseInt(strDatum.substring(6,10));
    mesec = Integer.parseInt(strDatum.substring(3,5));
    den = Integer.parseInt(strDatum.substring(0,2));
    if(mesec>12||mesec<1)
    dane = false;
    else
    calendarDatum.set(godina,mesec-1,1);
    najgolemDen = calendarDatum.getActualMaximum(Calendar.DAY_OF_MONTH);
    if(den>najgolemDen)
    dane = false;
    }//if(dane)
    }//else (ako dolzinata e 10)
    return dane;
    }

  • [Help] How to check the object locks held by a specific thread?

    As the title I want to check locks held by a specific thread. How can I do this? In Java lock is acquired and release automatically by stating synchronized keyword. I have no idea on how to check the lock status and who owns whick lock.
    Regards,
    Skeeter

    Look for the method:
        public static native boolean holdsLock(java.lang.Object);Its in the java.lang.Thread class. It will check the lock status for an object for the calling thread.

  • Help, how to check anonymous entry from access logfile.

    Can someone tell me how to check anonymous entry from logfile?
    From which field I can tell it's an anonymous entry?
    Thanks!
    Marvin

    In the Directory's access log you will see a RESULT entry like the following, where the dn="" indicates an anonymous BIND
    [01/Mar/2007:14:24:59 -0500] conn=7 op=0 msgId=1 - RESULT err=0 tag=97 nentries=0 etime=0.127000 dn=""
    If an actual user logged in the RESULT line would include the user's DN, like below
    [01/Mar/2007:14:24:59 -0500] conn=2019877 op=0 msgId=1 - RESULT err=0 tag=97 nentries=0 etime=0.127000 dn="uid=myuserid,ou=people,dc=test,dc=com"
    If you are deloyed on a Unix/Linux system you can count all the anonymouse BINDS using the following
    grep -c "tag=97 .*dn=\"\"" access

  • Data type determined at run time, how to provide the input type in advance

    Hi all,
    Here I have a requirement:
    on my UI, there is an inputfield which receives user's input. But the data type can't be known at design time.
    But I need to bind a context attribute to the inputfield first at design time, which data type should I use( the inputfield can recevie
    data of any type ) ?
    and how to convert the this data type into different data type( can be any type )?

    Hello Aaron,
    There can be a workaround for your requirement.
    you can assign a char data type to that field since Char can accept all characters, numbers, special symbols.
    But, you need to do validations later on the see if it is a number or all alphabets and accordingly you can assign that field to any data type  by doing little bit of manipulations.
    Hope this helps.
    Regards,
    Anand

  • How to check the data type dynamically

    hi all
    my requirement is like this  in one screen field which is of character type user is inputing data .
    now while saving to the database i have to apply one external check for this data if it is integer type or not
    as this data on the screen is refrenced to the database so i can not change the data type on the screen itself .
    i have to check it externally from PAI ....... would any one please help on this
    Thanks and regards
    Papps

    Hi
    Thanks again you are right i missed the space one ..
    but Now another problem...
    I have tried that but in that case even user can input data by mistake like this
    123 4  but this is not an integer it should also give error as this is also not a correct integer ...
    as par asi think . we have to aain check if there is any spaces in the data provided i guess or
    is there any other procedure ?

  • Pls help   how to check the condition in java server faces.....???

    Hi All
    I have strucked with code pls help....
    How can i check the codition in java server faces.....?
    like in my Application when user provides the in put like some state name in the next page i have to display some url for that state .......if he provide some other state name it will be different url .....pls help me how can i do that,,,,,,???
    thanks in advance..

    There are certainly ways to do that. E.g. using the rendered attribute, using conditional statements in EL, using a specialized getter for that (lazily loaded if necessary), etcetera. But your functional requirement is unclear, so I can't go in detail with that.
    In the future, please try to write normal English sentences. Don't write like SMS talk and save the periods and commas. The more effort you put in your question, the more chance you will be taken for serious and the more effort others will post in their answers.
    Also, in the future, JSF related questions should be posted in the JSF forum.
    Edited by: BalusC on 12-aug-2008 7:47

  • Need help: How to key in input array, save in a buffer, and extract them later?

    Hi, I need help. I have several groups of data for input, and need to use them later in the same or different code. When I key in the input data, the code will ask the number of data group first, then in each group, there will be 6 data to key in, each has a specific variable name. The number of group and the data for each group will vary at each time running the code. The data group needs to be numbered sequently. After having all groups of data, these data will be sent to another sub VI to read. This sub VI needs to know each group number and each data of a group.
    I think I should create a 2-D array to read these data in a do loop, but I can't let my do loop read data in each time. Then when I sent the data out, the next sub VI was confused by the sequence of the data group and the sequence of data in each group. Can someone help me or give me some example how to do it? Thank you very much for your help.
    Message Edited by ccyang on 06-06-2006 10:37 AM

    From what I understand of your explanation, an event structure might be
    the way to go (LV 6+ I think).  Events could be based off of
    keypresses in a particular control (a 2D array like you mentioned), and
    once input in that particular field is complete, the user presses say
    the 'enter' key, and you can use the "VKey" of the event data node to
    determine which key is pressed (i.e. VKey = enter?).  From there,
    you would continue to the next portion of data entry or processing of
    entered information.
    Hope this helps.

  • How to check a text type if it is filled or not for specific user status

    Hello;
    I want to check if a text type in a notification is filled or not for a specific user status. I guess that can be done using the BADI "ORDER_SAVE", but not sure how to do that.
    Regards,
    Erkan Kaya

    Hello Erkan.
    You can use the function module CRM_ORDER_READ_OW in method check_before_save of BADI ORDER_SAVE.
    Fill the header_guid of the notification into the it_header_guid table parameter and get the returning table ET_TEXT.
    For performance reason you should provide importing parameter it_requested_objects.
    INCLUDE CRM_DIRECT.
    APPEND gc_object_name-texts TO it_required_objects.
    Then you can check in et_Text if the required text is maintained. If not, you can raise the exception DO_NOT_SAVE in the BADI.
    Regards,
    Timo.

  • Help - how to get 2 inputs

    hi, i am creating this basic program/game. i need to get two inputs from the user. the problem is when i run the program it gets the first input from the user but then doesn't get the second input.. please help, the code is as follows:
    public class game
    public static void main(String[] args)
    char rock = 'r';
    char paper = 'p';
    char sciccsors = 's';
    do
    System.out.println("Player 1 please enter a letter");
    char c1 = SavitchIn.readChar();
    System.out.println("Player 2 please enter a letter");
    char c2 = SavitchIn.readChar();
    winnercalculation(c1,c1);
    game.winnercalculation(c1,c2);
    } while (quitoption());
    public static void winnercalculation(char c1, char c2)
    char rock = 'r';
    char paper = 'p';
    char sciccsors = 's';
    if ((c1 == rock) && (c2 == paper))
    System.out.println("Player 2 Wins");
    private static boolean quitoption()
    System.out.print("Would you like to repeat this program?");
    System.out.println(" (y for yes or n for no)");
    char answer = SavitchIn.readLineNonwhiteChar();
    return ((answer == 'y') || (answer == 'Y'));
    thanks for your help
    alex
    (i will reply to this post with the code required to make the SavitchIn.readline thing work.

    this is the code required for the SavitchIn read- copy the below code and save it as SavitchIn.java:
    import java.io.*;
    import java.util.*;
    *Class for simple console input.
    *A class designed primarily for simple keyboard input of the form
    *one input value per line. If the user enters an improper input,
    *i.e., an input of the wrong type or a blank line, then the user
    *is prompted to reenter the input and given a brief explanation
    *of what is required. Also includes some additional methods to
    *input single numbers, words, and characters, without going to
    *the next line.
    public class SavitchIn
    *Reads a line of text and returns that line as a String value.
    *The end of a line must be indicated either by a new-line
    *character '\n' or by a carriage return '\r' followed by a
    *new-line character '\n'. (Almost all systems do this
    *automatically. So, you need not worry about this detail.)
    *Neither the '\n', nor the '\r' if present, are part of the
    *string returned. This will read the rest of a line if the
    *line is already partially read.
    public static String readLine()
    char nextChar;
    String result = "";
    boolean done = false;
    while (!done)
    nextChar = readChar();
    if (nextChar == '\n')
    done = true;
    else if (nextChar == '\r')
    //Do nothing.
    //Next loop iteration will detect '\n'
    else
    result = result + nextChar;
    return result;
    *Reads the first string of nonwhite characters on a line and
    *returns that string. The rest of the line is discarded. If
    *the line contains only white space, then the user is asked
    *to reenter the line.
    public static String readLineWord()
    String inputString = null,
    result = null;
    boolean done = false;
    while(!done)
    inputString = readLine();
    StringTokenizer wordSource =
    new StringTokenizer(inputString);
    if (wordSource.hasMoreTokens())
    result = wordSource.nextToken();
    done = true;
    else
    System.out.println(
    "Your input is not correct. Your input must");
    System.out.println(
    "contain at least one nonwhitespace character.");
    System.out.println(
    "Please, try again. Enter input:");
    return result;
    *Precondition: The user has entered a number of type int on
    *a line by itself, except that there may be white space before
    *and/or after the number.
    *Action: Reads and returns the number as a value of type int.
    *The rest of the line is discarded. If the input is not
    *entered correctly, then in most cases, the user will be
    *asked to reenter the input. In particular, this applies to
    *incorrect number formats and blank lines.
    public static int readLineInt()
    String inputString = null;
    int number = -9999;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Integer.parseInt(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be");
    System.out.println("a whole number written as an");
    System.out.println("ordinary numeral, such as 42");
    System.out.println("Minus signs are OK,"
    + "but do not use a plus sign.");
    System.out.println("Please, try again.");
    System.out.println("Enter a whole number:");
    return number;
    *Precondition: The user has entered a number of type long on
    *a line by itself, except that there may be white space
    *before and/or after the number.
    *Action: Reads and returns the number as a value of type
    *long. The rest of the line is discarded. If the input is not
    *entered correctly, then in most cases, the user will be asked
    *to reenter the input. In particular, this applies to
    *incorrect number formats and blank lines.
    public static long readLineLong()
    String inputString = null;
    long number = -9999;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Long.parseLong(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be");
    System.out.println("a whole number written as an");
    System.out.println("ordinary numeral, such as 42");
    System.out.println("Minus signs are OK,"
    + "but do not use a plus sign.");
    System.out.println("Please, try again.");
    System.out.println("Enter a whole number:");
    return number;
    *Precondition: The user has entered a number of type double
    *on a line by itself, except that there may be white space
    *before and/or after the number.
    *Action: Reads and returns the number as a value of type
    *double. The rest of the line is discarded. If the input is
    *not entered correctly, then in most cases, the user will be
    *asked to reenter the input. In particular, this applies to
    *incorrect number formats and blank lines.
    public static double readLineDouble()
    String inputString = null;
    double number = -9999;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Double.parseDouble(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be");
    System.out.println("an ordinary number either with");
    System.out.println("or without a decimal point,");
    System.out.println("such as 42 or 9.99");
    System.out.println("Please, try again.");
    System.out.println("Enter the number:");
    return number;
    *Precondition: The user has entered a number of type float
    *on a line by itself, except that there may be white space
    *before and/or after the number.
    *Action: Reads and returns the number as a value of type
    *float. The rest of the line is discarded. If the input is
    *not entered correctly, then in most cases, the user will
    *be asked to reenter the input. In particular,
    *this applies to incorrect number formats and blank lines.
    public static float readLineFloat()
    String inputString = null;
    float number = -9999;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Float.parseFloat(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be");
    System.out.println("an ordinary number either with");
    System.out.println("or without a decimal point,");
    System.out.println("such as 42 or 9.99");
    System.out.println("Please, try again.");
    System.out.println("Enter the number:");
    return number;
    *Reads the first nonwhite character on a line and returns
    *that character. The rest of the line is discarded. If the
    *line contains only white space, then the user is asked to
    *reenter the line.
    public static char readLineNonwhiteChar()
    boolean done = false;
    String inputString = null;
    char nonWhite = ' ';//To keep the compiler happy.
    while (! done)
    inputString = readLine();
    inputString = inputString.trim();
    if (inputString.length() == 0)
    System.out.println(
    "Your input is not correct.");
    System.out.println("Your input must contain at");
    System.out.println(
    "least one nonwhitespace character.");
    System.out.println("Please, try again.");
    System.out.println("Enter input:");
    else
    nonWhite = (inputString.charAt(0));
    done = true;
    return nonWhite;
    *Input should consist of a single word on a line, possibly
    *surrounded by white space. The line is read and discarded.
    *If the input word is "true" or "t", then true is returned.
    *If the input word is "false" or "f", then false is returned.
    *Uppercase and lowercase letters are considered equal. If the
    *user enters anything else (e.g., multiple words or different
    *words), then the user is asked to reenter the input.
    public static boolean readLineBoolean()
    boolean done = false;
    String inputString = null;
    boolean result = false;//To keep the compiler happy.
    while (! done)
    inputString = readLine();
    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(
    "Your input number is not correct.");
    System.out.println("Your input must be");
    System.out.println("one of the following:");
    System.out.println("the word true,");
    System.out.println("the word false,");
    System.out.println("the letter T,");
    System.out.println("or the letter F.");
    System.out.println("You may use either upper-");
    System.out.println("or lowercase letters.");
    System.out.println("Please, try again.");
    System.out.println("Enter input:");
    return result;
    *Reads the next input character and returns that character. The
    *next read takes place on the same line where this one left off.
    public static char readChar()
    int charAsInt = -1; //To keep the compiler happy
    try
    charAsInt = System.in.read();
    catch(IOException e)
    System.out.println(e.getMessage());
    System.out.println("Fatal error. Ending Program.");
    System.exit(0);
    return (char)charAsInt;
    *Reads the next nonwhite input character and returns that
    *character. The next read takes place immediately after
    *the character read.
    public static char readNonwhiteChar()
    char next;
    next = readChar();
    while (Character.isWhitespace(next))
    next = readChar();
    return next;
    *The following methods are not used in the text, except for
    *a brief reference in Chapter 2. No program code uses them.
    *However, some programmers may want to use them.
    *Precondition: The next input in the stream consists of an
    *int value, possibly preceded by white space, but definitely
    *followed by white space.
    *Action: Reads the first string of nonwhite characters
    *and returns the int value it represents. Discards the first
    *whitespace character after the word. The next read takes
    *place immediately after the discarded whitespace.
    *In particular, if the word is at the end of a line, the
    *next reading will take place starting on the next line.
    *If the next word does not represent an int value,
    *a NumberFormatException is thrown.
    public static int readInt() throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Integer.parseInt(inputString);
    *Precondition: The next input consists of a long value,
    *possibly preceded by white space, but definitely
    *followed by white space.
    *Action: Reads the first string of nonwhite characters and
    *returns the long value it represents. Discards the first
    *whitespace character after the string read. The next read
    *takes place immediately after the discarded whitespace.
    *In particular, if the string read is at the end of a line,
    *the next reading will take place starting on the next line.
    *If the next word does not represent a long value,
    *a NumberFormatException is thrown.
    public static long readLong()
    throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Long.parseLong(inputString);
    *Precondition: The next input consists of a double value,
    *possibly preceded by white space, but definitely
    *followed by white space.
    *Action: Reads the first string of nonwhitespace characters
    *and returns the double value it represents. Discards the
    *first whitespace character after the string read. The next
    *read takes place immediately after the discarded whitespace.
    *In particular, if the string read is at the end of a line,
    *the next reading will take place starting on the next line.
    *If the next word does not represent a double value,
    *a NumberFormatException is thrown.
    public static double readDouble()
    throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Double.parseDouble(inputString);
    *Precondition: The next input consists of a float value,
    *possibly preceded by white space, but definitely
    *followed by white space.
    *Action: Reads the first string of nonwhite characters and
    *returns the float value it represents. Discards the first
    *whitespace character after the string read. The next read
    *takes place immediately after the discarded whitespace.
    *In particular, if the string read is at the end of a line,
    *the next reading will take place starting on the next line.
    *If the next word does not represent a float value,
    *a NumberFormatException is thrown.
    public static float readFloat()
    throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Float.parseFloat(inputString);
    *Reads the first string of nonwhite characters and returns
    *that string. Discards the first whitespace character after
    *the string read. The next read takes place immediately after
    *the discarded whitespace. In particular, if the string
    *read is at the end of a line, the next reading will take
    *place starting on the next line. Note, that if it receives
    *blank lines, it will wait until it gets a nonwhitespace
    *character.
    public static String readWord()
    String result = "";
    char next;
    next = readChar();
    while (Character.isWhitespace(next))
    next = readChar();
    while (!(Character.isWhitespace(next)))
    result = result + next;
    next = readChar();
    if (next == '\r')
    next = readChar();
    if (next != '\n')
    System.out.println(
    "Fatal Error in method readWord of class SavitchIn.");
    System.exit(1);
    return result;
    *Precondition: The user has entered a number of type byte on
    *a line by itself, except that there may be white space before
    *and/or after the number.
    *Action: Reads and returns the number as a value of type byte.
    *The rest of the line is discarded. If the input is not
    *entered correctly, then in most cases, the user will be
    *asked to reenter the input. In particular, this applies to
    *incorrect number formats and blank lines.
    public static byte readLineByte()
    String inputString = null;
    byte number = -123;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Byte.parseByte(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be a");
    System.out.println("whole number in the range");
    System.out.println("-128 to 127, written as");
    System.out.println("an ordinary numeral, such as 42.");
    System.out.println("Minus signs are OK,"
    + "but do not use a plus sign.");
    System.out.println("Please, try again.");
    System.out.println("Enter a whole number:");
    return number;
    *Precondition: The user has entered a number of type short on
    *a line by itself, except that there may be white space before
    *and/or after the number.
    *Action: Reads and returns the number as a value of type short.
    *The rest of the line is discarded. If the input is not
    *entered correctly, then in most cases, the user will be
    *asked to reenter the input. In particular, this applies to
    *incorrect number formats and blank lines.
    public static short readLineShort()
    String inputString = null;
    short number = -9999;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Short.parseShort(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be a");
    System.out.println("whole number in the range");
    System.out.println("-32768 to 32767, written as");
    System.out.println("an ordinary numeral, such as 42.");
    System.out.println("Minus signs are OK,"
    + "but do not use a plus sign.");
    System.out.println("Please, try again.");
    System.out.println("Enter a whole number:");
    return number;
    public static byte readByte() throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Byte.parseByte(inputString);
    public static short readShort() throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Short.parseShort(inputString);
    //The following was intentionally not used in the code for
    //other methods so that somebody reading the code could more
    //quickly see what was being used.
    *Reads the first byte in the input stream and returns that
    *byte as an int. The next read takes place where this one
    *left off. This read is the same as System.in.read(),
    *except that it catches IOExceptions.
    public static int read()
    int result = -1; //To keep the compiler happy
    try
    result = System.in.read();
    catch(IOException e)
    System.out.println(e.getMessage());
    System.out.println("Fatal error. Ending Program.");
    System.exit(0);
    return result;

Maybe you are looking for

  • Intel Iris Pro on a mac mini?

    Hello to everyone, well I suppose that Apple is going to replace all intel 4000 GPU with the Intel Iris Pro. Is there any information about using this hardware in mac mini too? Is there any official anouncement about that? This Iris Pro is sharing th

  • Putting songs in chronological order

    I've downloaded a cd directly into my iPad mini.. The question is how can I put it in chronological order.. 1234,etc.. thank u

  • Duplicating an object a certain distance away

    For the life of me, I cannot remember what this is called, or where to find it in the menus.  It doesn't have the word "duplicate" in it, but it should!  You select an object and then go to a dialog box and set up how many times you want to duplicate

  • Error While creating Third Party order in VA01

    HI am trying to create Third Party order in VA01  in my sand box with material ( BANS item category Group)  getting error NOT POSSIBLE TO DETERIMINE A CONSUMPTION ACCOUNT in OBYC GBB  i tried to do some setting in VAX , VBR with valuation class 0001

  • Form 16

    Hi, While i m executing the form 16, i m getting the error, Device type unsuitable for ADS documents. How to solve this one. Thanks and Regards, Revathi.