How to stop this loop?

double tempI;
for(int i=0; i<=100; i++){
tempI=0;
while(tempI<1){
    if (Math.sqrt(A-B)>0.001)
          //OUT For
    else
       tempI+=0.01;
}I use break, it seems only out while, but not break for.
Anyone knows how to break for?
Thanks
David

You will need to use a label to break out of the for loop.
Label the for loop with a name (labelname: statement)
You then break/continue to that labelname
In this case I used the labelname outerloop
Check out http://java.sun.com/docs/books/tutorial/java/nutsandbolts/flowsummary.html for more
double tempI
outerloop: for(int i=0; i<=100; i++){
  tempI=0;
  while(tempI<1){
    if (Math.sqrt(A-B)>0.001)
      //OUT For
      break outerloop;
    else
      tempI+=0.01;
[/code/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • I have been sampling new imported drum loops. And if I adjust region to song or time strecth it updates the audio file in the library. How to stop this? I lost the original setting to one loop. automatically doing it ??

    I have been sampling new imported drum loops. And if I adjust region to song or time strecth it updates the audio file in the library. How to stop this? I lost the original setting to one loop. automatically doing it ??

    This "original file cannot be found" thing happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes .
    tt2

  • How to modify this loop?

    Please look at my simple code.
    Now I can input two data and click 'run', then 'stop' to stop the program.
    But what I want is:
    1. I can stop the program at anytime (now I can only stop the program after click 'run')
    2. Before I click 'stop', I can 'run' the program any times. (right now it can only be run once).
    How to change this loop? Thanks.
    - TBird
    Attachments:
    Loop_test.vi ‏30 KB

    Is that what you want ?
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Loop_test 2.vi ‏23 KB

  • In my macbook pro when composing email it coping into thrash as well so how to stop this ?

    in my macbook pro when composing email it coping into thrash as well so how to stop this ?

    You may have a Bad fan. Make an appointment and take it to the genius bar for an evaluation. It's free, in warranty or out.

  • My Mail app opens unprompted everytime i reboot or awake my macbook pro from sleep.  This was not an issue until i shut down my laptop for the first time in a while 2 days ago.  ANy ideas how to stop this?

    I recently shut down my MacBook Pro for the first time in a long time.  SInce then, everytime i reboot or awake my laptop from sleep, the Mail app opens unprompted causing my computer to slow down incredibly, and some apps to freeze.  I have no idea how to stop this or why it even started doing this.  Any ideas on how to get it to stop? Thanks!

    I have this problem too with my Macbook Air. Mail opens automatically every time my laptop sleeps. I actually just asked about this in my own thread. However, it is not causing my apps to freeze.

  • How to stop while loop when a specified function is terminated?

    I want to make a program which has 2 thread, one of which is to control some devices, and the other is to measure outputs of the devices.
    To do that, I should make a 2 independent loops, but there comes a problem here.
    I want to terminate 2 loops at the same time, but it's difficult for me to do that, because when I try to notify upper sequence's termination to lower loop by some value change, they have some dependency.
    That's why I need your help. I want to know how to stop lower loop when the upper sequence's termination keeping their independency.
    Please let me know. Thank you.
    Attachments:
    help.JPG ‏200 KB

    Is the upper loop commanding the lower loop at all?  I would think you would have some type of communication between the loops.  Just use that communication to send a stop command.  Or the next best way is to just simply use a notifier.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to stop this multiple entry against same condition type in pricing

    My client is using manual condition type for the basic price "ZBPR". Now system allowing multiple entry against this condition type in the pricing screen during order creation i.e in the first line if we put ZBPR 00 , in the second line system allowing to put another value against same ZBPR say for example 2000 & doing all subsequent calculations on the basis of 3000 .which is not at all acceptable by my client .Please suggest how to stop this multiple entry against same condition type

    You have to make the condition type as Mandatory and not manual.
    If you are entering many condition records of the ZPR0 then the latest entry will be taken for further processing for subtotal rebate and total price.
    For all the other entered condition records will have yellow traffic signal which is not active.
    you can assign a routine with the help pf your abaper...
    In the Transaction VOFM  define a requirement such that
    you condition type takes value only one at the time of order entry.
    regards,
    Amlan Sarkar

  • At the top of my homepage, I'm getting a message "Downloading the latest applications", but the circle to the left keeps spinning, and no applications are downloaded. I don't know how to stop this, tried right and left clicking on the bar. This occurs

    At the top of my homepage, I'm getting a message "Downloading the latest applications", but the circle to the left keeps spinning, and no applications are downloaded. I don't know how to stop this, tried right and left clicking on the bar. This occurs every time I open Firefox. How can I stop or disable this?
    == This happened ==
    Every time Firefox opened
    == Several weeks ago.

    See http://kb.mozillazine.org/Software_Update (Software Update not working properly)
    Remove the files in the ''updates'' and ''updates\0'' folder:
    Vista/Windows7:
    C:\Users\&lt;user&gt;\AppData\Local\Mozilla\Firefox\Mozilla Firefox\ (updates)
    C:\Users\&lt;user&gt;\AppData\Local\VirtualStore\Program Files\Mozilla Firefox\ (updates)
    %LOCALAPPDATA%\Mozilla\Firefox\Mozilla Firefox\updates\

  • My ip5 auto restarting itself lately, how to stop this problem?

    My ip5 auto restarting itself lately, how to stop this problem?

    It cannot just change itself.  If it has not been changed by someone using the phone, then the only other thing I can think of is that the phone is on a corporate Exchange account, and the passcode has been changed by the administrator.  If that is not the answer then the phone will have to be restored.

  • Hi! I've just purchased a new iPhone 5s but whenever I text people with iPhones it's always sent from my iCloud account. This means that my email show instead of my name/number which is really frustrating! Does anyone know how to stop this?

    Hi! I've just purchased an iPhone 5S but whenever I text people with iPhones it sends from my iCloud account. This means that my email comes up for other people not my name/number which is really frustrating! Does anyone know how to stop this?

    Go into Settings>Messages>Send and Receive> Is your phone number checked there? If you do not want your email used, then tap on them and remove the checkmark. If there is no checkmark by your phone number, then turn iMessage off, perform a reset on the phone, hold the sleep/wake and home buttons together until you see the Apple logo and then release. The phone will reboot. Turn iMessage on. When it activates, check your settings again under Send and Receive and make sure the number is checked and the emails are not.

  • Anytime i plug a charger into my iphone . It vibrates , How doI stop this. I've tried several ways

    Anytime i plug a charger into my iphone . It vibrates , How doI stop this. I've tried several ways

    No way to completely stop it.  When you plug in the power cord, it will chime, or it will vibrate (if the mute switch is on), but the device is designed to one of the other.  I suppose it is the designers way of making sure that you know your device is properly connected and has switched over to external power.  At this point in time, that feature cannot be disabled.

  • Pics present in my I phone are defaultly showing in facebook ...how to stop this ??

    Pics present in my I phone are defaultly showing in facebook ...how to stop this ??

    Settings > Messages - Send and Receive at..
    and turn off everything except your Phone #.
    Better yet, get your own AppleID.

  • One of my imported MOV files turns "black" after editing with it for a time and I can't retrieve the images. This has happened three times, only this file. The placeholder is still there. Files are fine on hard drive. What gives? how to stop this?

    One of my imported MOV files turns "black" after editing with it for a time and I can't retrieve the images. This has happened three times, only this file. The placeholder is still there. Files are fine on hard drive. What gives? how to stop this? is in final cut pro 10.1.4

  • My new nano keeps going into sleep mode every copy of minutes while music is playing.  I can't figure out how to stop this.  The user guide isn't too helpful.  Any ideas?

    My new nano keeps going into sleep mode every copy of minutes while music is playing.  I can't figure out how to stop this.  The user guide isn't too helpful.  Any ideas?

    This is usually a sign that your iPod's headphones are not plugged in all the way.  Make sure that you cannot see any of the silver still showing from the headphone's plug.  You should hear a sort of popping/clicking noise when inserting the headphones letting you know that they have been fully seated.
    B-rock

  • Hello I have just updated my iphone 5 and it keeps requesting 2 old email addresses from I quests my old laptop any idea how to stop this ? Thanks

    Hello I have just updated my iphone 5 and it keeps requesting 2 old email addresses from I quests my old laptop any idea how to stop this ? Thanks

    Log out of the old ID, then login using the new one with the correct pw.

Maybe you are looking for

  • K9N PLATINUM RAM Issue

    Hello there, I have the following:     * AMD Athlon 64 X2 4200+     * K9N Platinum     * Kingston 1GB DDR2-800 Ram Dimm (PC2 6400, KVR800D2N5/1G) X4     * EVGA 512P3N802DX GeForce 8800 GT 512MB 256-bit GDDR3 PCI Express 2.0 x16 HDCP Ready     * Weste

  • Install Acrobat 9 Pro Extended from Acrobat 9 Standard

    I attempted to do an upgrade from Acrobat 9 Standard to Pro Extended having purchased the software from a sales rep who said I could do this as did technical support. My system is XP Pro/SP2 32-bit. During the install I ran into this problem. http://

  • Need help with master detail from different datasets

    I have xml data from three different datasets that I want to use in a master detail region.  So initially, a list of model codes is displayed. When the user clicks on a specific model, the model inputs appear in the detail region.  One of these input

  • HT201317 Permission to edit photo stream?

    I use a photo stream to share photos of my children from my iPhone with family.  Can I give my wife the ability to add photos to the same stream?  She is also on iPhone with her own apple id.

  • VERY Complicated iTunes/Time Capsule/Library Transfer Question

    Hi all-- looking for some help before I move my beloved iTunes library (over 500GB) from an old PC to a brand spanking new MacBook Pro and a 1TB Time Capsule. I want to store the music files on the Time Capsule and access everything wirelessly. When