Out of loop

is there a .out command to get out of a loop?
In the program i want it to append until a comma is seen from the file(below)
                              while(c != ','){
                                        ssnumb2.append(c);
                                        System.out.println(ssnumb2);
                                   }the problem is that it never gets out of the loop when the comma is recieved it just repeats the word repeditivly

  while(c != ','){
    ssnumb2.append(c);
    System.out.println(ssnumb2);
    break;
This will break you out of the loop, but in effect you don't have a loop them.  The problem you are having is that c is never modified in the loop body, so you nothing controlling your loop you essentially have this:
  while(true){
    ssnumb2.append(c);
    System.out.println(ssnumb2);
you need to do this:
  while(c != ','){
    ssnumb2.append(c);
    System.out.println(ssnumb2);
    <do some modificatin of c here that will eventually
     cause it not to be a ','.>
  }

Similar Messages

  • Program times out while looping at internal table with huge records - Needs fine tuning suggestions

    Hi,
    I am trying to execute a report. It times out while looping at vbap internal table. This internal table has 140000  records and does the validation within this loop and geenrates data for the output. Due to this huge volume, the program times out when executed foreground.
    There are no nested loops, so I cannot apply 'Parallel Cursor' here.
    Is there any way I can fine tune the program so that it doesn't timeout? Is it possible to apply 'Parallel Processing' . If yes, how?
    Thanks,
    Pavan

    Hi Pavan ,
                  ->sort your internal table by all primary key for vbap.
                  ->Read a Record from the table (use your condition here)
                  ->if record satisfys your where condition ,get that record index .
                  ->loop the table from the index (without condition) .
                  its like parallel cursor only but for single loop .;-)
                  ->use field symbols ,wherever possible .
               if still dump is coming ,contact your basis team .
    regards,
    Krishna.

  • How to cast vector to vector with out using loop. and how to override "operator =" of vector for this kind of condition.

    Hi All How to TypeCast in vector<>...  typedef  struct ...  to class... 
    //how to cast the vector to vector cast with out using loop
    // is there any way?
    //================ This is Type Definition for the class of ClsMytype=====================
    typedef struct tagClsMytype
    CString m_Name;
    int m_Index;
    double m_Value;
    } xClsMytype;
    //================ End of Type Definition for the class of ClsMytype=====================
    class ClsMytype : public CObject
    public:
    ClsMytype(); // Constructor
    virtual ~ClsMytype(); // Distructor
    ClsMytype(const ClsMytype &e);//Copy Constructor
    // =========================================
    DECLARE_SERIAL(ClsMytype)
    virtual void Serialize(CArchive& ar); /// Serialize
    ClsMytype& operator=( const ClsMytype &e); //= operator for class
    xClsMytype GetType(); // return the typedef struct of an object
    ClsMytype& operator=( const xClsMytype &e);// = operator to use typedef struct
    ClsMytype* operator->() { return this;};
    operator ClsMytype*() { return this; };
    //public veriable decleare
    public:
    CString m_Name;
    int m_Index;
    double m_Value;
    typedef struct tagClsMyTypeCollection
    vector <xClsMytype> m_t_Col;
    } xClsMyTypeCollection;
    class ClsMyTypeCollection : public CObject
    public:
    ClsMyTypeCollection(); // Constructor
    virtual ~ClsMyTypeCollection(); // Distructor
    ClsMyTypeCollection(const ClsMyTypeCollection &e);//Copy Constructor
    DECLARE_SERIAL(ClsMyTypeCollection)
    virtual void Serialize(CArchive& ar);
    xClsMyTypeCollection GetType();
    ClsMyTypeCollection& operator=( const xClsMyTypeCollection &e);
    ClsMyTypeCollection& operator=( const ClsMyTypeCollection &e); //= operator for class
    void Init(); // init all object
    CString ToString(); // to convert value to string for the display or message proposed
    ClsMyTypeCollection* operator->() { return this;}; // operator pointer to ->
    operator ClsMyTypeCollection*() {return this;};
    public:
    vector <ClsMytype> m_t_Col;
    //private veriable decleare
    private:
    //===================================================
    ClsMytype& ClsMytype::operator=( const xClsMytype &e )
    this->m_Name= e.m_Name;
    this->m_Index= e.m_Index;
    this->m_Value= e.m_Value;
    return (*this);
    //==========================Problem for the vector to vector cast
    ClsMyTypeCollection& ClsMyTypeCollection::operator=( const xClsMyTypeCollection &e )
    this->m_t_Col= (vector<ClsMytype>)e.m_t_Col; // how to cast
    return (*this);
    Thanks in Advance

    Hi Smirt
    You could do:
    ClsMyTypeCollection* operator->() {
    returnthis;};
    // operator pointer to ->
    operatorClsMyTypeCollection*()
    {returnthis;};
    public:
    vector<ClsMytype>
    m_t_Col;//??
    The last line with "vector<xClsMytype>
    m_t_Col;". It compiles but I doubt that is what you want.
    Regards
    Chong

  • Never get out of loop

    With the below example, Im never getting to the "Out of loop message".It iterates through loop alrite but never comes out of it.
    Any ideas anyone?
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while ((line = br.readLine()) != null) {
    System.out.println("In loop");
    System.out.println("Out of loop");

    I think it something to do with the fact that the readline method reads to a '/n' and the stream may not have this termination point.

  • Loops greyed out in loop browser

    Can any one tell me how to make some greyed out loops in the loop browser play?
    The loops in question are in the following location on the HD:
    H/D / LIB / AUDIO / APPLE LOOPS / APPLE / APPLE LOOPS FOR GARAGE BAND.
    About 15% of these loops are greyed out in the loop browser and will not play. They play fine in QT if you select them from the apple loops folder.
    If I drag them into the loop browser then they appear in black above the grey version and WILL play!

    http://www.bulletsandbones.com/GB/FAQPages/NoLoops.html

  • How do I move data from a DAQ into and out of loops and structures?

    I have a set of RTD probes set up to read data into LabView through a DAQ. This block of code is in a while loop
    that executes alongside of several other loops simultaneously. I need to use the data from the RTD probes in other
    loops and case structures specifically for logic tests.
    The problem is that I can't seem to bring the dynamic data out of the DAQ containing while loop or into the other structures.
    Any ideas?
    I have had some success with using multiple DAQs and stopping all others while I need the data inside of a case structure.
    Is there a way to reference data from a DAQ or to run multiple DAQs that read the same data from the same channels without getting a "Task in use error"?
    Thanks,
    -David

    Search the forums for Prodcuer/consumer architecture.
    This uses queues to pass data from the producer loop (such as your data acquisition loop) to other "consumer" loops.  These are the other loops where you want to use the data.
    You won't be able to use multiple DAQ Read functions at the same time.  As you've seen you get error -50103 about the resources already being in use.

  • Come out of loop in debugger

    Hi.,
    While debugging, if we are inside the loop... How to come outside first line of that loop by excuting that loop?
    Also how to come outside of that loop... without excuting that loop?
    ---Its in new debugger!
    --Naveen Inuganti.

    Hi,
    Hope you all know about first screen of module pool programs, where we can't put break points...!
    There we can have LOOPS....
    If I am inside of loop here.... How can I come out of this loop?
    See the following code..is from onwe standard program of SAP..
    PROCESS BEFORE OUTPUT.
            MODULE STATUS_SETZEN_S.
            MODULE DYNPRO_KOPF_MODIF.
            MODULE AUSGLEICHS_VORSCHLAG.
            MODULE D0710_MODIF.
            module dynpro_sel_modif.                       
          LOOP.
            FIELD RF05A-XPOS1.
            FIELD RF05A-AZEI3.
            MODULE SEL_ANZEIGEN_AUSWAHL.
          ENDLOOP.
    PROCESS AFTER INPUT.
            MODULE EXIT AT EXIT-COMMAND.
            MODULE PAI_ANFANG.
            MODULE GET_CURSOR.
    *------- Konto, Buchungskreis ... --------------------------------------
            FIELD RF05A-AGKOA MODULE MC_OBJEKT_SETZEN1.
            FIELD RF05A-AGBUK MODULE MC_AGBUK_PARM_SETZEN.
    *------- Vertrag ----------------------------------------------"contract
            chain.
              field rf05a-vertn.
              field rf05a-vertt.
              field rf05a-xulsd.
              field rf05a-agums.
              module clr_contract.
            endchain.
          CHAIN.
            FIELD RF05A-AGKON.
            FIELD RF05A-VERTN.
            FIELD RF05A-VERTT.
            FIELD RF05A-AGKOA.
            FIELD RF05A-AGUMS.
            FIELD RF05A-XNOPS.
            FIELD RF05A-AGBUK.
            FIELD RF05A-XMULK.
            FIELD RF05A-AVSID.
            FIELD RF05A-XINVS.                                       
            MODULE AUSGLEICHSDATEN.
          ENDCHAIN.
    *------- ... weitere Konten ? ------------------------------------------
            FIELD RF05A-XMULK MODULE RF05A-XMULK ON INPUT.
          CHAIN.
            FIELD RF05A-XAUTS.
            FIELD RF05A-XFIFO.
            MODULE RF05A-XAUTS-XFIFO ON CHAIN-INPUT.
          ENDCHAIN.
    *------- Weitere Suchkriterien -----------------------------------------
          LOOP.
            FIELD RF05A-XPOS1.
            FIELD RF05A-AZEI3.
            MODULE SEL_BEARBEITEN_AUSW.
          ENDLOOP.
          CHAIN.
            FIELD RF05A-AGKON.
            FIELD RF05A-VERTN.
            FIELD RF05A-VERTT.
            FIELD RF05A-AGKOA.
            FIELD RF05A-AGUMS.
            FIELD RF05A-XNOPS.
            FIELD RF05A-AGBUK.
            FIELD RF05A-XMULK.
            FIELD RF05A-XINVS.                                       
            MODULE SEL_PRUEFEN.
            MODULE FUSSZEILE_BEARBEITEN.
          ENDCHAIN.
    PROCESS ON VALUE-REQUEST.
            FIELD RF05A-AGUMS MODULE F4_AGUMS.
            FIELD RF05A-AGKON MODULE F4_AGKON.
            FIELD RF05A-AVSID MODULE F4_AVSID.
    --Naveen Inuganti.

  • Not breaking out of loop

    I've written this piece of code to search through a file until it finds:
              BufferedReader in = new BufferedReader (new FileReader(outputFile));
              String name = null;
              String data = in.readLine();
              while (name == null)
                   System.out.print("Please enter your name: ");
                   name = kybd.nextLine();
                   kybd.nextLine();
                   while (data != null)
                        if (name.equalsIgnoreCase(data))
                             name = data;
                        else
                             name = null;
                        data = in.readLine();
                   System.out.println("Sorry, name not found.");
                   System.out.println();
              }I have some problems with the logic of it and it doesn't break out of the loops, can someone give me some advice as to where it's going wrong and how to correct this, thanks.
    I've now discovered that the "kybd.nextLine();" was causing it not to enter the first loop, however now I get a NullPointerException and I know what that is, but I do not know why it is happening here.
    Edited by: jnaish on Jul 2, 2008 6:40 AM

    jnaish wrote:
    Changed it to look like this:
              while (name == null || name == "no match")
    Don't do this. You're comparing object identity instead of comparing their values. Compare strings with .equals().
                   System.out.print("Please enter your name: ");
                   name = kybd.nextLine();
                   //kybd.nextLine();
                   while (data != null)You never set data (you did in your first example), so data will be null and your loop will not execute.
                        if (name.equalsIgnoreCase(data))
                             name = data;
                             System.out.println("Found.");
                        else
                             name = "no match";
                        data = in.readLine();
                   System.out.println("Sorry, name not found.");
                   System.out.println();
              }No exception anymore but, name doesn't become equal data either.Restructure your loop. What you're doing is just awkward.
    Pseudocode:
    function {
      get line of user input
      loop over lines in file {
        if user input is equal to line from file {
          print "found"
    }Edited by: nclow on Jul 2, 2008 2:11 PM

  • Coming out of loop

    DEAR TECHIS,,
    plz tell me the way to come out from the loop of item table
    i have devloped a bdc prog for Customer invoice fb70. for that i have used  two tables for header and item. here my problem is after posting the data. the loop is not breaking of item table to undersanding pupuse i m giving smalle
    as
    loop at header .
    performe...
            loop at item where acnt = header-acnt.
    perform........
           endloop.
    endloop.
    Here i didnt get the way to come out from the item tables loop.
    pls reply....
    Rewards for useful ans..
    thanks in advance...

    Hi Devalla,
    It's of sure that, your are looping the item table only when you have the acnt = header-acnt, in the Where condition of the loop.
    Stilll you find that your loop is not breaking up means its really a ?
    Try to debug and find out where is the probs?
    okay .. if you want to come out conditionally, place EXIT command at the begining or at the end of the Loop by placing a CHECK. with whatever you want either using the count of number of entries in the item table with respect to the header acnt field.
    if thing it's sure it's going to be some simple thing which block you...
    If still cant post the code.. with where it hooks...
    Reward points if useful

  • How to find out how many recourds in recourd set  with out while loop

    hi
    i want to findout how many recourds in recourd set
    with out useing any loops like
    while(rs.next())
    count+=1;
    like this
    any mathod like(RecoundCount like )
    pls help me
    regards
    kedar

    If you dont want to use a scrollable result set do
    sql="SELECT COUNT(*) AS COUNT FROM TABLE"
    rs=stmt.executeQuery(sql);
    rs.next()
    count=rs.getString("COUNT");

  • How to come out if loop other using break.

    can u plz give an example where i want come out of if loop other than break , return keyword.
    example If
    {  System.out.println("   ");
    break;
    or return;
    }

    Can you please give an example how to terminate a
    loop other than using break or return.What is the purpose of the question?
    Do you have a bug where it appears a loop is being terminated some other way?
    You need to clarify.

  • Pass continuous discrete averages out of loop

    Hi,
    I have a DAQ that's acquiring 1 sample at 1 Hz. I am trying to get the program to continuously acquire samples but to output the average of every 10 samples, which I use at a later point in the program for calculations. I have found a lot of topics on the NI forums that discuss running averages but this is not what I am looking for. I have also found this link that shows a labview program that can acquire a given number of samples, average them and write to a file (2nd diagram from the top). This is very similar to what I need except for the part where it displays the mean within the case structure.
    http://forums.ni.com/t5/LabVIEW/How-to-make-labview-program-to-get-average-value-of-200-reading/td-p...
    I am able to write the averages to a file or display them within the loop. However, I need to pass the average of every 10 samples out of the loop. In other words, the DAQ acquires continuously but at the end of every 10 seconds, the algorithm outputs the average of the data from those 10 seconds. Can anyone tell me if this is possible in Labview 2010 and what function will help me achieve this?
    Thanks for reading!
    av10

    You are very close.  Look at your Consumer loop -- you dequeue one element from the Queue, then pass it into a "Do Forever" loop that shows the single value.  Put the Dequeue also inside the loop, and you'll have what you want.
    The Producer loop will continue to put Means on the Queue.  The Queue "wire" is a bit unusual in that data can pass "backwards" through the wire (it doesn't really -- the wire just identifies a conduit in which the data travels).  Once the data is on the Queue, any Dequeue element (like the one you will move into the Consumer loop) will have access to the "conduit" and will be able to remove the data and do whatever you want with it (like display it on the Numeric indicator -- consider renaming that something more mnemonic, like "Mean Value").
    One question that comes up with multiple loops is How Do I Shut Them All Down?  Here, again, Queues are your Friends.  Inside the Consumer Loop, wire the output of the Error Line coming from the Dequeue to the Stop indicator (this Consumer loop is so simple you don't need to worry about an Error Case statement).  When you Release the Queue after exiting the Producer Loop (in response to pushing the Stop control), the Queue itself will disappear, and the Dequeue function in the Consumer Loop, which is waiting for a new value, will instead throw an error.  Well, this error you will interpret as "The Queue Is Dead, Time to Stop Consuming", and by wiring the Error Line to the Consumer's Stop terminal, this will stop the second loop, and your program will exit.
    Let us know if this answers your questions, and solves the problem you were raising.
    BS

  • Getting out of loop

              Hello,
                     I would like to get out of this ''LOOP '' I appear
                 to be in.Once plugged into a wall socket the i4 will
                 keep buzzing every now and then,it will light up with
                 iOS 6 and the arrow to unlock.When the arrow is drawn
                 across,I get EMERGENCY CALL.START OVER AND
                 CANCEL.When touched the emergency pad comes up
                 allowing a call.It then clears,buzzes,you press home button
                  and get the USB picture and note in circle,above which is
                 connect to i tunes.This then goes away,buzzes lights up,
                with the logo of usb and connect to iTunes,and arrow,and
                you are back in the loop.THERE MUST BE A SIMPLE WAY
                 OUT. My friends and I,if we cannot find a quick fix,are going
                 for the SAMSUNG GALAXY NOTE II. ( 50 PEOPLE ).And
                a lot more will follow,this is utterly ridiculous.
            Mr.S.A.R.Bell

    Hey,
              This sounds pretty frustrating! The device seems like it is in what is called recovery mode. OR it is trying to activate for the first time. Plug it into a computer with the new version of iTunes. If it pops up a message about recovery mode you will need to restore the Phone. If it activates the device you're good to go. You may also need to restart the device. Push and hold the button on top till is says slide to turn off, then slide to turn off.
    Hope this Helps!!!

  • Need help coming out recovery loop.

    Hi. I have an iPod that is stuck in a 'recovery loop'. Several attempts were made to fix this such as the use of TinyUmbrella,RecBoot,Redsn0w and iReb-r7. When the option to exit recovery mode, the device turns off and begins to reboot but once again returns to the loop. Is there any guaranteed way to come out of this loop without having to restore the device on iTunes? Thank you for the help in advanced.

    Not from the device itself
    - If they are in an iPod backup then restore from that backup. See the restore topic of:
    iOS: How to back up
    - If you used PhotoStream then try getting them from your PhotoStream. See that topic of:
    iOS: Importing personal photos and videos from iOS devices to your computer

  • Freeflow core Stuck in Processing Request and can't get out of looped state

    Javier, We have a problem on our free flow core server. I sent my second test file using one of the saved work flows. The first file sent worked fine using same work flow used on second file. The secong submitted file is stuck inn "processign Request" and I have no way of stopping it.  I logged out and logged back in to see if that would help but that was not helpful. I rebooted the server where free flow core resides,and logged in but the "Processsing request" is still running. I'm assuming since workflows are saved, requests are saved in queue until finalized. Since this instance has not finalized free flow keeps attempting to process any pending requests until complete. Since it is failing to complete this specific request, it  restarts even after a reboot. I need to find out how to clear/cancel this request.

    I have gotten in this loop.  When doing this kind of thing, a usb keyboard would be good to have around, and that is probably the problem, because when I would boot, the first time set the windows partition to the default drive.  Hold the key combo and boot into OSX, and go into Settings/Startup Disk/ and change it to The osx hd.

Maybe you are looking for