Storing input in strings

im reading strings in off a serial port using the simpleRead demo program. They come in every second or so. HOw would i store these in one long string that i could then search for correct section and do someting with this section????

StringBuffer?

Similar Messages

  • Convert exponent stored in a string to decimal

    I have the value 8.000000000000+E01 stored in a string. I want to display the value as 80.
    Please help. Is there any standard function module for this ???

    Try this code -
    data: i_s type string value '1E-02',
    i_f type f, " value '1E-02',
    i_p(12) type p decimals 5.
    write: / i_s.
    i_f = i_s.
    write:/ i_f.
    i_p = i_f.
    write: / i_p.
    Regards,
    Amit

  • Input a string and assign to a variable in the console window

    i'm absolutely and completely new to java
    i need to be able to input a string and then assign it to a variable, entirely using the console window, basically i'm looking for the Java alternative to C++'s "cin"
    i've tried the System.in. method but nothing seems to work
    i know this should be simple, but i cant find it anywhere
    cheers

    i've tried the System.in. method That thing is not a method: it's an object, an intstantiation of the InputStream
    class. If you read the API documentation for that class you'll notice that it
    isn't much more sophisticated than C's file IO. You can wrap an
    object if this class in a more high level class (see InputStreamReader
    and BufferedReader).
    The latter allows you to read an entire line of characters. If you really want
    to go fancy you can wrap the first class in a Scanner which is only
    available in Java 1.5
    kind regards,
    Jos

  • How to find out the type of the value stored in a string variable?

    Hi,
    How do i find out the type of the value stored in a string variable?
    for example,
    I have a string variable str, in which the following type of values wil be stored
    1) Intger
    2) Long
    3) boolean
    4) Char
    Is there any method to find out the type of the value, anything like str.getType()?. Please kindly help me. Thanks in advance.

    Hi All, i'm sorry for the double posting, by mistake it occured.
    Thanks for your replies, i have a string variable str, in which the value is stored and i have another string variable type, in which the type of the value is stored.
    For example,
    String str = "15";
    String type = "Integer";
    Is there any way to verify whether the value stroed in str is of type stored in the variable 'type'. I want to write a method of type boolean, it will throw true of the value stored in str is of type 'type'. Thanks

  • Problem in sending XML input as String in BPEL

    Hi,
    We have a BPEL flow (assign, invoke, assign) which takes an XML input as String.
    <RegisterCustomerOnVAS><CustomerID>100</CustomerID><MSISDN>9999999</MSISDN><CustomerName>sanjeev</CustomerName><customerInfo>new user</customerInfo></RegisterCustomerOnVAS>
    Assignment is doing fine, but when Invoke calls partner link, the input is getting parsed and only the first text value (eg 100) is getting passed to the partner webservice instead of the entire XML as string.
    Can any one please help us in fixing in this problem.
    Thanks

    Hi,
    You should watch your assign activity (maybe a bad assigment level in copy rule). I think the probem is there.
    Cyryl

  • How to create an instance of a class which is stored in a String?

    I've class name stored in a String Object.
    now i've to create an instance of that class name.
    How?

    This is very dangerous ground because you give up compile-time safety, but you can get a Class object using Class.forName(String). Then you can use methods of the class Class to operate on it (including creating an instance).

  • Can I Execute a function whose name is stored in a string variable?

    Can I execute a function whose name is stored in a string variable?
    Like
    Depending on the condition I will stroed the name of the function in a string variable. Then using that string variable i want to execute the function.
    String str=��
    iVal an int can take ne value
    Switch(iVal)
    Case 1:
    str=�test1()�;
    Case 2:
    str=�test2()�;
    I want whatever function name is in str to be executed.
    ----------------------------------------------------------------------------------

    For just executing a method or two, reflection might be easier than beanshell (or it might not). For executing entire scripts, beanshell will be preferable over reflection.
    (I assume beanshell uses reflection under the hood, but I've never bothered to peek.)

  • How to create a new file  having a name that is stored in a string

    Hello friends i am new to java and i need your help .
    I have a string which will take different values at run time. I want to create a file which has the same name as stored in the string . Can anyone help me?

    The Java Almanac example I linked to uses createNewFile() - the API documentation is not particularly clear about exactly what happens if c:\some\value\assigned\at doesn't already exist. But you're only a small experiment away from finding out!
    Another page gives examples of directory creation.
    http://www.exampledepot.com/egs/java.io/CreateDir.html
    Once (or if) the file is created using a File then, yes, that File is the name of the file: parent directories and all. If you create a FileReader based on the File it will read from the right place.

  • Inputting a string to the console

    Do someone happen to know a method for the Scanner class that lets you
    input a string as a sentence. I understood that I can do this with
    the nextLine() method but it doesn't always work for me.
    In the following code I am able to read in the first input ("title") as a sentence,
    but when I try to input another sentence ("publisher") a couple of inputs later,
    output console skips down to next line input ("price") before I can enter the
    "publisher". I just want to know if there is a general method I can
    use to input more than one string seperated by spaces to the console.
    Thanks in advance,
    M
            Scanner console = new Scanner(System.in);
            System.out.println("Enter the Title: ");
            String title = console.nextLine();
            System.out.println("Enter the ISBN: ");
            int isbn = console.nextInt();
            System.out.println("Enter the publisher: ");
            String pub = console.nextLine();
            System.out.println("Enter the price: ");
            double price = console.nextDouble();

    Scanner.nextLine() is exactly the method you want.
    Your problem comes from a misreading of the docs for .nextInt(). All of the .nextFoo() methods in Scanner will read up to the end of whatever input matches the type you're reading in and no further. This means that the newline at the end of the line of input will NOT be parsed when you call .nextInt().
    You need to either call .nextLine() to clear the newline left over from the previous input or always call .nextLine() to get input and use the wrapper classes to parse the line you read in.
    Edited by: DeltaGeek on Mar 31, 2009 11:29 AM

  • Input a string value

    What is the simplest method to accept an input of string value? Is buffering or string tokenizer required to perform this?

    vinayv wrote:
    What is the simplest method to accept an input of string value? Is buffering or string tokenizer required to perform this?It depends what you're doing. StringTokenizer isn't used to get an input value, it's used to separate it out into tokens. It's also deprecated in favor of String.split.
    You might want to use BufferedReader's readLine method. Or you might want to use Scanner's next, nextLine, nextInt, etc. It depends on how you're consuming and parsing input. You might even want to check out the Console class introduced in version 6.
    Start here, and play around with the above until you find what best suits your needs.
    http://java.sun.com/docs/books/tutorial/essential/io/index.html

  • Barcode reader input to string control

    Hi, 
    I am using a barcode reader that uses keyboard emulation.  The barcode types on the computer the same way a keyboard would.  When I open notepad and use the barcode reader to read a barcode, the following meesage is typed: 
    S/N: 17967
    Lin: 0.591%
    Ph: 1.32deg
    In that exact format.  However, when I try use the reader in labview with a string control the format changes.  The following meassages are printed instead: 
    S/N: 17967mn: 0.591%m: 1.32deg
    S/N: 17967mn: 0.591%mn: 1.32deg
    S/N: 17967mnLin: 0.591%mPh: 1.32deg
    S/N: 17967mn: 0.591%m:1.32deg
    So the format changes.  Sometimes the Lin and Ph are printed other times they are not, spacing in the string changes, and in all cases the carriage return is no longer there.  
    Could you please let me know what might be causing this.  Ideally I would like the message to be read in the same format it is in notepad.  My code is attached. 
    Thanks
    Attachments:
    barcodereader.vi ‏16 KB

    Is there a reason you have a timeout event?  You are not doing anything in there.  So I would remove the timeout (you can just remove the timeout input or set it to -1).
    I'm just thinking that if you set the focus while the scanner is doing its thing is causing the issue you are seeing.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Using an array name stored in a String in a Statement

    In my sequence, I build an array in one section and store it in a variable called Locals.Test_Array.
    I build the name of the permanent place I would like to store this array and store it in a string called Locals.SG_Test_Array_Name.
    I would like to move the values from Locals.Test_Array to the Station Globals Array name stored in Locals.SG_Test_Array_Name.
    For example:
    the string stored in Locals.SG_Test_Array_Name is "StationGlobals.Coolant_Temperature_Test_Array" (already created in Station Globals)
    What I am trying to do is this:
    Statement                        StationGlobals.Coolant_Temperature_Test_Array=Loca​ls.Test_Array  (this works)
    The Station Global Array name needs to change as the sequence executes and the data in Locals.Test_Array changes.
    What I need is something like this.
    Statement                         Locals.SG_Test_A​rray_Name=Locals.Test_Array  (where SG_Test_Array_Name is a string that holds the name of the array)
    Thanks, Big_Will

    Evaluate(Locals.SG_Test_Array_Name + " = Locals.Test_Array " )

  • URGENT!.....accepting user input and string conversion

    I have a problem with a text-based menu I am trying to create for a Shape class with rectangle, circle, etc... subclasses below it...here is a code clip
    //The menu choices given to the user.
              System.out.println("Please select which shape you would like to create:\n");
              System.out.println("(1)Rectangle");
              System.out.println("(2)Square");
              System.out.println("(3)Circle");
              System.out.println("(4)Ellipse");
              System.out.println("(5)Exit the program\n");
              System.out.print("Enter your choice (1,2,3,4 or 5): ");
         menuChoice=(char)System.in.read();
    switch(menuChoice) {
    case '1':                              
    System.out.println("\nTo create a rectangle, please enter the following dimensions below (integers only)...\n");                    
         System.out.print("Center X co-ordinate = ");
              while((x=(char)System.in.read()) !='\n')
              CentXBuf.append(x);     
         System.out.print("Center Y co-ordinate = ");
              while((y=(char)System.in.read()) !='\n')
              CentYBuf.append(y);
    The above works fine, however, when the the user inputs the menu choice, it does not let me input the center x co-ordinate and goes on to the second input of the center y co-ordinate then the program crashes with a NumberFormatException
    I tried to replace
         menuChoice=(char)System.in.read();
    with
         while((z=(char)System.in.read()) !='\n'){
              zBuff.append(z);
         String v = new String(zBuff);
         int menuChoice = Integer.valueOf(v).intValue();
    but the above itself gives me a NumberFormatException also!
    What do I do?!?!

    Try this:
    BufferedReader reader = new BufferedReader(
    new InputStreamReader(System.in)
    String input = reader.readLine();

  • Hex input from string problem

    Hi!
    Whenever I try to input a hex integer by readLine method
    of BufferedReader and parse it I get a NuberFormatException . Please tell me a solution?

    Hi...
    Have you tried using the static method decode in the Integer class?
    I don't know if this is where you're goign with this problem but try this (I assume you read a line, parse it, and then stuff the hex number string you want to decode into a temporary String variable)
    String tempNumber = //your BufferedReader readline stuff here...
    try {
        int hexNumber = Integer.decode (tempNumber);
        //do futher processing here
    catch (NumberFormatException e) {
        System.err.println (e.getMessage ( ))
    }

  • Storing a secret string

    Hi,
    Our ATG based site has to make a call to a REST web services located in the cloud (somewhere on the internet). The call only executes when we send a secret api key along with it. This key is configurable. It can change over time. Normally we would store similar configuration strings in ATG nucleus property files. However, in this case, we do not want the key to be stored unencrypted on the file system of the ATG server.
    We are now looking for some sort of vault in which we can store the key. Does anyone happen to know of such a solution? We checked if the Java keystore/keytool could help us but that requires a specific format. Any other suggestions are very welcome.
    Thanks in advance,
    Bart.

    If you want to encrypt any sensitive information that is stored in a Nucleus component properties file, you can do that by providing an implementation of atg.nucleus.PropertyValueDecoder. Then within your component you can decode the value of encoded property before you actually use it.
    http://docs.oracle.com/cd/E26180_01/Platform.94/ATGProgGuide/html/s0206decodingencryptedpropertiesinnuc01.html
    PropertyValueDecoder has two variants of decode() method as: public String decode(String s) and public Object decode(Object o). There are two default OOB implementation provided also for PropertyValueDecoder which are atg.service.jdbc.SimpleLoginDecoder and atg.crypto.CipherPropertyValueDecoder. SimpleLoginDecoder uses the OOB class atg.core.util.Base64 for decoding the encrypted value in the properties file while CipherPropertyValueDecoder class can use a atg.crypto.Cipher object where you can have you own encrypt/decrypt implementations.

Maybe you are looking for

  • Question regarding bleeding and facing pages.

    Hello, i'm in trouble with my first InDesign document which is a 96 pages Magazine. It will be printed on A3 sheets stapled in the middle. My printing guy said that it's ok as A4 pages with 3mm bleed. So now when i'm trying to export as a printed pdf

  • WebLogic Portal 7.0 - Sample Portal

    Hi, I've downloaded and installed WebLogic 7.0. Followed the quick start instructions to start the portal examples server, then tried to invoke the sample portal. I get the following error in the console, and the portal doesn't appear (the sample por

  • Compare transmission speed between thunderbolt gigabit and usb ethernet adapters

    As the new MBA has an accessory (Thunderbolt ethernet adapter), will its transmission speed be significantly faster than using an old USB ethernet adapter in one of the new MBA's USB ports?

  • Lost files after exporting library to external HD

    I recently exported my iTunes music folder to my external HD to free up space on my internal HD. Now when I try to play some songs a window pops up and says original file could not be found. I have lost alot of music and a great deal of it was purcha

  • Diagnostics Agent Installation in MCOD enabled systems

    Hi Experts, We are connecting MCOD anabled managed systems to Solution Mamager 7.1 SPS10. But little confused with Dagnostics agent strategy; whether Agent-On-the-fly feature can be used in this case or not? I am following SAP Note 1365123 - Installa