Accepting Input

In order to accept a single character from the keyboard
System.in.read() is used. However what do you use if you
want to accept a String.
e.g To accept one character I would say
char n = (char)System.in.read();
How then can I accept a String?

check out the BufferedReader class.
here is example I am using:
cmdStr = new BufferedReader(new InputStreamReader(System.in)).readLine();

Similar Messages

  • PC as a bluetooth Device and accept input from other devices

    I need to set my PC up as a bluetooth device by use of a bluetooth dongle connected to my PC. I need to have a program running on my PC that will detect other bluetooth devices and connect with them, accept input from them. Please help me do this. anyone got code for this? Thank you a gazillion in advance !! :)

    There's no way to do is with standard Java as far as i know. You'll have to use JNI to use native libraries.

  • BAdI: Field LIFNR not ready to accept input (Change will not be adopted)

    Dear Guruz...\
    given below is the warning with message number
    BAdI: Field LIFNR not ready to accept input (Change will not be adopted)
    Message no. MIGO050
    while i am trying to enter the batch name for removal for scrapping and clicking check this warning is being displayed.
    KIndly if you are having any other solutions in customizing other than using BADI... pl discuss..

    Hi,
    You must have some kind of BAdI (probably MB_MIGO_ITEM_BADI och MB_MIGO_BADI) that places a value in the field LIFNR (vendor). However, this field is not open for entry and hence SAP ignores the value provided by the BAdI.
    Either correct your BAdI so it doesn't populate the field when the latter is not available (e.g. based on the mvt /special stock ind.) or live with this warning message - it is harmless.
    BR
    Raf

  • Server 2012 not accepting inputs either via console or RDP

    Hello Experts,
    I have a server 2012 standard running in a physical box with 3 virtual machines running in hyper-v session. For sometime now, i have been running into strange issues where it does not accept input. I tried via RDP, console; neither method worked. It still
    holds AD and file server role. It was all working good and driving me into issues for some time now.
    It does not accept inputs via keyboard or mouse either from console or RDP. All resources such as file share, virtual machine are accessible from network. I can logon to server via console or RDP for 3 to 5 min right after server has been hard restarted
    and again it stops accepting inputs.
    Can someone help me out work around this issue as i am new to server 2012 and not sure what goes in error.
    Thanks.

    Hi koneska,
    Did you install any software recently? Please try to unistall the new installed software and if you have AV soft disable the AV soft then try again.
    Regards.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Accepting input in PL/SQL

    My requirement is Accepting Input from KeyBoard in the LOOP PL/SQL Block.
    Becasue of PL/SQL constraints I am not able to accept value in the loop
    except the first time. Please advice me is there any other options in PL/SQL
    to accept input from the keyboard in the loop.

    I'm not sure how you can do this, perhaps someone else does.
    I suggest writing a Shell Script or Batch file which accepts the input and then runs SQL*Plus and your script with arguments.
    Good Luck,
    Eric Kamradt

  • Table Control[Accept Input Only] - "ENTER" Key

    Hi Folks,
    I'm reviving this unanswered thread in relation to table control: when the user press enter, all the values entered disappear.
    [url]Re: Table control (Enter key)[url]
    I have a table control that accepts "ONLY" input, meaning to say, there will be no pre-loading of data in the PBO, so it will loop through the table control itself instead of looping from an internal table.
    Issue: Whenever I press "ENTER" in any column/row of my table control, ALL the values I entered disappear.
    PBO:
    PROCESS BEFORE OUTPUT.
      MODULE CLEAR_OKCODE.
      MODULE LOAD_TABLECTRL.
      LOOP WITH CONTROL TC_DATA.
        MODULE READ_DATA.
      ENDLOOP.
    module READ_DATA output.
      READ TABLE T_DATA INTO WA_DATA INDEX TC_DATA-current_line.
      data : line_count type i.
      "to increase the number of lines in table control dynamically
      describe TABLE t_data lines line_count.
      TC_DATA-lines = line_count + 10.
    endmodule. 
    PAI:
    PROCESS AFTER INPUT.
      LOOP WITH CONTROL TC_DATA.
        MODULE MODIFY_DATA.
      ENDLOOP.
    module MODIFY_DATA input.
    WHEN 'CREATE'.
      "subroutines are here, etc.
    WHEN 'DELETE'.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
    endmodule.
    In my ABAP Debug, the value of SY-UCOMM is BLANK whenever I press Enter.
    Thanks.

    Hi
    Your code seems to be rght only the MODIFY statament is useless:
    module READ_DATA output.
      READ TABLE T_ID_CHECK INTO WA_ID_CHECK INDEX TC_ID-current_line.
      IF SY-SUBRC EQ 0.
        ZQID_CHECK-WERKS = WA_ID_CHECK-WERKS.
        ZQID_CHECK-MATNR = WA_ID_CHECK-MATNR.
        ZQID_CHECK-LICHA = WA_ID_CHECK-LICHA.
        ZQID_CHECK-LIFNR = WA_ID_CHECK-LIFNR.
      ELSE.
        CLEAR ZQID_CHECK.
      ENDIF.
    endmodule.
    Now before LOOP of PBO try to set the lines of table control to be display, I've created this report on my system and it works fine:
    .CONTROLS T_CTRL TYPE TABLEVIEW USING SCREEN 100.
    DATA: BEGIN OF ITAB OCCURS 0,
              WERKS LIKE MARC-WERKS,
              MATNR LIKE MARC-MATNR,
              LIFNR LIKE LFA1-LIFNR,
          END   OF ITAB.
    DATA: WA LIKE ITAB.
    START-OF-SELECTION.
      DO 4 TIMES.
        ITAB-WERKS = '5010'.
        ITAB-MATNR = '1234567890'.
        ITAB-LIFNR = '0000000001'.
        APPEND ITAB.
      ENDDO.
      CALL SCREEN 100.
    PROCESS BEFORE OUTPUT.
      MODULE SET_T_CTRL.
      LOOP WITH CONTROL T_CTRL.
        MODULE READ_DATA.
      ENDLOOP.
    PROCESS AFTER INPUT.
      LOOP WITH CONTROL T_CTRL.
        MODULE MODIFY_DATA.
      ENDLOOP.
    MODULE SET_T_CTRL OUTPUT.
      DESCRIBE TABLE ITAB LINES T_CTRL-LINES.
    ENDMODULE.                 " SET_T_CTRL  OUTPUT 
    MODULE READ_DATA OUTPUT.
      READ TABLE ITAB INDEX T_CTRL-CURRENT_LINE.
      IF SY-SUBRC = 0.
        MOVE-CORRESPONDING ITAB TO WA.
      ELSE.
        CLEAR WA.
      ENDIF.
    ENDMODULE.                 " READ_DATA  OUTPUT
    MODULE MODIFY_DATA INPUT.
      MODIFY ITAB FROM WA INDEX T_CTRL-CURRENT_LINE.
      IF SY-SUBRC NE 0.
        CHECK NOT WA IS INITIAL.
        APPEND WA TO ITAB.
      ENDIF.
    ENDMODULE.                 " MODIFY_DATA  INPUT

  • Help on writing pl/sql stored procedure to accept input in xml format

    Hi All,
    I need to write a pl.sql stored procedure which would be getting the input as an xml.
    The requirement is that xml data recieved in below fashion needs to be inserted to 3 different tables.
    The tags under the root node directly needs to be inserted into Table1
    The tags under the first element of the root node needs to be inserted into Table2
    Can anybody help me on how to write a stored procedure which could take up the below xml as input and insert the data received into 3 different tables.
    Any sample code.pointers to achieve this could be of great help.
    The structure of the xml would be as follows:
    <AssemblyProduct>
    <AssemblyHeader>
    <Name></Name>
    <AssemblyId></AssemblyId>
    <ListOfHCSIFFs><HCSIFFHeader><Id></Id> </HCSIFFHeader> </ListOfHCSIFFs>
    <ListOfHCSIFFs><HCSIFFHeader><Id></Id> </HCSIFFHeader> </ListOfHCSIFFs>
    <ListOfHCSIFFs><HCSIFFHeader><Id></Id> </HCSIFFHeader> </ListOfHCSIFFs>
    </AssemblyHeader>
    <AssemblyHeader>
    <Name></Name>
    <AssemblyId></AssemblyId>
    </AssemblyHeader>
    <AssemblyHeader></AssemblyHeader>
    <ApplicationId></ApplicationId>
    <ApplicationName></ApplicationName>
    <ApplicationValidFrom></ApplicationValidFrom>
    <ApplicationValidTo></ApplicationValidTo>
    </AssemblyProduct>

    Well you could write your procedure to accept a parameter of XMLTYPE datatype and then use that value in a query inside the procedure to break the data up as required using something like XMLTABLE e.g.
    -- Nested repeating groups example:
    WITH t as (select XMLTYPE('
    <RECSET>
      <REC>
        <COUNTRY>1</COUNTRY>
        <POINT>1800</POINT>
        <USER_INFO>
          <USER_ID>1</USER_ID>
          <TARGET>28</TARGET>
          <STATE>6</STATE>
          <TASK>12</TASK>
        </USER_INFO>
        <USER_INFO>
          <USER_ID>5</USER_ID>
          <TARGET>19</TARGET>
          <STATE>1</STATE>
          <TASK>90</TASK>
        </USER_INFO>
      </REC>
      <REC>
        <COUNTRY>2</COUNTRY>
        <POINT>2400</POINT>
        <USER_INFO>
          <USER_ID>3</USER_ID>
          <TARGET>14</TARGET>
          <STATE>7</STATE>
          <TASK>5</TASK>
        </USER_INFO>
      </REC>
    </RECSET>') as xml from dual)
    -- END OF TEST DATA
    select x.country, x.point, y.user_id, y.target, y.state, y.task
    from t
        ,XMLTABLE('/RECSET/REC'
                  PASSING t.xml
                  COLUMNS country NUMBER PATH '/REC/COUNTRY'
                         ,point   NUMBER PATH '/REC/POINT'
                         ,user_info XMLTYPE PATH '/REC/*'
                 ) x
        ,XMLTABLE('/USER_INFO'
                  PASSING x.user_info
                  COLUMNS user_id NUMBER PATH '/USER_INFO/USER_ID'
                         ,target  NUMBER PATH '/USER_INFO/TARGET'
                         ,state   NUMBER PATH '/USER_INFO/STATE'
                         ,task    NUMBER PATH '/USER_INFO/TASK'
                 ) y
       COUNTRY      POINT    USER_ID     TARGET      STATE       TASK
             1       1800          1         28          6         12
             1       1800          5         19          1         90
             2       2400          3         14          7          5And then you can extract and insert whatever parts you want into whatever tables as part of the procedure.

  • I am new to working with pdf.  I am trying to fill out a form that was attached to a web site.  I have a Macbook Pro.  I am just learning Acrobat.  How do I get the form to accept input?

    I am new to working with pdf.  I am trying to fill out a form that was attached to a website.  I have a Macbook Pro and I am trying to learn Acrobat.  How do I get the form to accept my input?

    If there are Acrobat PDF form fields, not jus a space for a form field, then you will have to add them. It would be better to ask the provider of the form to add the fields. If you cannot add the fields, then you can use the add text feature.
    Have you looked in the "Tools" panel for the "Forms" category?
    Try Acrobat Users Community Tutorials , http://acrobatusers.com/tutorials.
    See Adobe TV - Acrobat, http://tv.adobe.com/channel/how-to/acrobat-xi-tutorials/.

  • Can biztalk accept input xml with extra tags in it? if yes, How?

    I have the following sample input xml:
    <Students Class='xyz'>
    <Student count='0'>
    <FName value='Alex'/>
    <LName value='James'>
    <Age value='22'>
    <DOB value='01/01/2001'>
    <ID value='123'>
    </Student>
    <Student count='1'>
    <FName value='Victor'/>
    <LName value='Brown'>
    <Age value='23'>
    <DOB value='02/12/2000'>
    <ID value='541'>
    </Student>
    </Students>
    And my input schema accepts the xml which is similar to the above xml except it does not have <Age> and <DOB> tags in it. which means that the <Age> and <DOB> tags are extra tags in my input xml which is not
    required by the input schema.
    Question: is it possible in biztalk to accept the above xml as it is (i.e. along with <Age> and <DOB> tags) to populate the schema which accepts all xml except <Age> and <DOB> tags?
    Can it just pick up the required tags and populate the input schema?
    Thanks
    manibest

    Automatic change in the published schema on the basis of a received messages is still science fiction :)
    There is still a way for you to handle these messages. If in the receive pipeline you do not enforce schema validation, in your orchestration you use bound receive ports [not direct ports] and receive the message as an XMLDocument, you should still be able
    to receive/process the document.
    The ability of an predefined Schema to accept additional data elements is called an OPEN CONTENT Model [refer
    http://msdn.microsoft.com/en-us/library/aa468557.aspx] and you can create a schema to support such things if that is how you expect messages. So in your schema you define elements of type
    "xsd:any" to accept content changes even with schema validation turned on.
    Regards.

  • Ncurses won't show any output nor accept input (SOLVED .sort of)

    Hi
    I have an elderly application (PB/PG for Linux) that builds and runs fine on other distros than ArchLinux (AL). When I build it on AL it builds fine, meaning that the include files and the library are found. When I run the program it does not show any output on the screen and it will not accept keyboard input.
    I must admit that I am somewhat at a loss as to what could be wrong, so any help will be much appreciated.
    Have any of you experienced this (or a similar) problem? And how did you solve it?
    Regards,
    Bent
    EDIT 2007-12-04: The root cause of this problem had nothing to do with Ncurses whatsoever. I have found another tree to bark up. Sorry for the inconvenience.
    Bent
    Last edited by BentB (2007-12-04 13:46:43)

    So rather quick addition.
    I just played with the AccelMethod option in /etc/X11/xorg.conf.d/20-intel.conf and found that this only occurs when it is set to "uxe" or "glamor" changing the setting to "sna" does not result in this problem.
    I had originally changed this setting from sna due to font rendering issues. I'll leave it as sna for now and see if those same issues still exist.
    Marked solved, but may not a good solution if font issues with sna are still present.

  • After installing CS4 Master Suite on new Windows 7 X64 laptop, Premier Pro new projects window will not accept input.

    I'm migrating my CS4 Master Suite to a new computer.  The new system is a Dell M3800 running Windows 7 x64.  Install goes fine except for a failure on Flash install.  Once install is complete Premier Pro won't accept any input on the New Projects window.  You can click on the file name field and change it but that's about it.  No buttons will function.  If you change the name and leave the field you can not change it again.  No further input is accepted and the actual change you made isn't applied.  You can exit out of the window with the X.  You can also go to an existing project no problem.  All other applications seem to be working fine.
    Tried uninstall and cleanup and reinstall.  Problem does not change.  Made sure anti-virus and firewall were disabled before install.  No other applications are running during install.
    Any suggestions would be appreciated.

    reset your preferences -
    acrobat:  http://help.adobe.com/en_US/acrobat/X/pro/using/WS58a04a822e3e50102bd615109794195ff-7feb.w .html
    adobe media encoder: https://forums.adobe.com/thread/1713540
    after effects:  http://helpx.adobe.com/after-effects/using/preferences.html
    dreamweaver:  https://helpx.adobe.com/dreamweaver/kb/restore-preferences-dreamweaver-cs6-cc.html
    flash:  http://helpx.adobe.com/flash/kb/re-create-preferences-flash-professional.html
    illustrator:  http://helpx.adobe.com/illustrator/using/setting-preferences.html
    indesign:  https://forums.adobe.com/thread/526990
    lightroom: https://helpx.adobe.com/lightroom/help/setting-preferences-lightroom.html
    muse (mac): https://forums.adobe.com/thread/1246022?tstart=0
    photoshop:  https://forums.adobe.com/thread/375776
    photoshop elements:  https://helpx.adobe.com/photoshop-elements/kb/preference-file-locations-photoshop-elements .html,  http://www.photokaboom.com/photography/learn/Photoshop_Elements/troubleshooting/1_delete_p references_file.htm
    premiere elements:  https://helpx.adobe.com/photoshop-elements/kb/preference-file-locations-photoshop-elements .html
    premiere pro: http://www.mediacollege.com/adobe/premiere/pro/troubleshooter/trash-preferences.html

  • "Ask Apple Support" in Contacts link won't accept input...

    Trying to get help via Apple Support, but the same screen simply returns after submitting a question. Anyone else having the save problem?

    When I go to "Contact" in Apple Support and click "Get Started," there's a Welcome screen that pops up and asks if this is the same or difference issue. When I try to respond (to either) to "get started," the display just comes back to the same Welcome screen. In other words, I can't get Support to accept any input from my computer:
    https://getsupport.apple.com/GetproductgroupList.action
    Same thing on both my Mac Mini and old iMac, so I figured it had to be some kind of hangup on Apple's end. Exasperating. On the other hand, I've discovered through another poster that my early '09 Mini (2,1) isn't compatible with Mountain Lion anyway, which is what I was trying to install; so for now the Support access issue is moot. If you have any suggestion about viability of upgrading my Mini, I'd appreciate your insight. Thanks so much for your response. 

  • Accept input from commandline

    Hi,
    I have an sql file with multiple accept statements.
    I would like to run this script from the DOS commandline, and supply the script with values for the accept statements.
    How can I do this? (I do not want to alter the sql-file for this)
    Regards,
    HJH

    I have an sql file with multiple accept statements.
    I would like to run this script from the DOS commandline, and supply the script with values for the accept statements.
    How can I do this? (I do not want to alter the sql-file for this)Create text file and put one value per line in proper order. For example, you have the following script script.sql :
    accept V1 char prompt 'Enter value for V1:'
    accept V2 char prompt 'Enter value for V2:'
    prompt Your input : &V1 &V2
    exitText file values.txt can be the following:
    ABC
    DEFThen use the following syntax:
    sqlplus.exe /nolog @script.sql < values.txt

  • Accept input from Shell script in sql*plus

    Hey! Guys..
    i need the following info.
    I am running a shell script from sql*plus. I need to accept a value from shell script into my .sql file.
    thanks..
    Harsh.

    prompt for input, pass to another shell
    # contract_status_prompt.sh
    read udate?"Enter week-ending date in format dd-mmm-yyyy: "
    contract_status_update.sh $udate >$FDWLOG/current/contractstatusupdate`date +%d%h%y`.log
    echo `date`
    # End contract_status_prompt.sh
    Read the variable passed and use in SQLPlus:
    # contract_status_update.sh
    echo "Running contract_status.sh"
    echo "create records for contract_status"
    echo `date`
    echo " "
    echo " date used is "; print $1
    echo " "
    sqlplus <<exit
    @$FDWSQL/sqlparms
    set time on
    prompt *** Set contract_status_period ***
    update contract_status_period
    set period_date = '$1';
    commit;
    exit
    etc.

  • Hiding the users ACCEPT input

    I am developing a report at the moment that asks for user input via an ACCEPT statement. Unfortunately, when the report is shown on the screen i am also shown this:
    old   6:        and     c.customer_id = '&customer_id'
    new   6:        and     c.customer_id = '0001'Are there any techniques to hide this because it has not value to the report itself.

    Maybe SET VERIFY OFF :
    SQL> select ename,sal from emp where empno = &1;
    Enter value for 1: 7902
    old   1: select ename,sal from emp where empno = &1
    new   1: select ename,sal from emp where empno = 7902
    ENAME             SAL
    FORD             3000
    SQL> set verify off
    SQL> /
    Enter value for 1: 7902
    ENAME             SAL
    FORD             3000
    SQL>                                                             

  • How to accept input Text in UpperCase?

    Hi,
    How to accept Character Text from users in UpperCase in inputText Field?
    I am using ADF BC and Jdev10.1.3.1.
    In forms world it is very simple ( setting the visual attributes ), I am searching for such simple solution in Jdev .
    Regards,
    Seshu.

    Hi,
    I'm using CSS for uppercase:
    <af:inputText ... inlineStyle="text-transform: uppercase"/> Note this doesn't influences an internal value, just displays the value in upperscase.
    To store the value in upperscase, you need for example to override setter method.
    public void setCode(String value) {
        if (value != null) {
            value = value.toUpperCase();
        setAttributeInternal(CODE, value);
    }Rado

Maybe you are looking for

  • IPod Touch skips (jumps to the end of) the first track. Bug?

    Hello, I'm experiencing the following problem with my iPod Touch and was unable to find any information about similar cases in different forums: I have several Audible.de audiobooks on my iPod that are by default listed under "audiobooks". Recently I

  • 1.1.3 error- Network connection timed out

    Anyone else get this problem? And if so what should I do about it? Thanks

  • Profit center data in GLPCA and GLPCT Tables

    Hi , We are in ECC 6 but with classic GL and profit center accounting. We have the documents posted with profit center as the assignment object. When i check the documents through document display i could see the profit center in it , but when i exec

  • Organisational Structure replications

    Hi, Does anyone have a best practice guide or something as to the best methods for managing oranisational replications from ECC to SRM. Over the years I have encountered many of the same issues such as users becoming detached and muliple business par

  • Lost app

    Hello everyone I lost all my purchased applications on my iPhone 4. After I connected my phone to the PC, message appeared on iTunes asking me whether I want to transfer all my purchased applications to the PC or not, so I chose "Transfer". The phone