How can I implement a "goto" in exiting loops?

Hi, I've encountered a problem when trying implement an early exit from a loop. Can anyone advice me on this, really wish to how to tackle this issue.
Thanks in advance...

I'm going to assume you're using a For loop...  If this is the case you can do two things.  One, you could switch to a while loop, and just have the conditions 'if i = [former input to For loop N], stop', as well as the early exit condition wired to the stop (ORed).
The other is that you could have all of your code inside error cases (case structure with error wired to the case selector), and once your early exit condition occurs, set the error to true, and the For loop will finish itself without executing any more code (essentially instant).
I would recommend the while loop method, as there's less wasted CPU cycles.  I could however be way off with this answer.  If so, please be a bit more specific. 
Hope this helps

Similar Messages

  • How can I implement a comfirmation window when closing javafx application?

    hi,guys
    I'd like to add a confirmation window when user is closing my javafx application,if user click yes, I will close the application,if no ,I wouldn't close it ,how can I implement this function?
    primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>(){
                   @Override
                   public void handle(WindowEvent arg0) {
                        try
                             //todo
                        catch(Exception ex)
                             System.out.print(ex.getMessage()+"\r\n");
            });

    Hi. Here is an example:
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.geometry.Pos;
    import javafx.stage.*;
    import javafx.scene.*;
    import javafx.scene.paint.Color;
    import javafx.scene.layout.*;
    import javafx.scene.control.*;
    public class ModalDialog {
        public ModalDialog(final Stage stg) {
         final Stage stage = new Stage();          
            //Initialize the Stage with type of modal
            stage.initModality(Modality.APPLICATION_MODAL);
            //Set the owner of the Stage
            stage.initOwner(stg);
            Group group =  new Group();
            HBox hb = new HBox();
             hb.setSpacing(20);
            hb.setAlignment(Pos.CENTER);
            Label label = new Label("You are about to close \n your application: ");
            Button no  = new Button("No");
            no.setOnAction(new EventHandler<ActionEvent>() {
                public void handle(ActionEvent event) {
                       stage.hide();
            Button yes  = new Button("Yes");
            yes.setOnAction(new EventHandler<ActionEvent>() {
                public void handle(ActionEvent event) {
                       stg.close();
             hb.getChildren().addAll(yes, no);
             VBox vb =  new VBox();
             vb.setSpacing(20);
             vb.setAlignment(Pos.CENTER);
             vb.getChildren().addAll(label,hb);
            stage.setTitle("Closing ...");
            stage.setScene(new Scene( vb, 260, 110, Color.LIGHTCYAN));       
            stage.show();
    }Test:
       import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.paint.Color;
    import javafx.stage.Stage;
    import javafx.stage.*;
    * @author Shakir
    public class ModalTest extends Application {
         * @param args the command line arguments
        public static void main(String[] args) {
            Application.launch(ModalTest.class, args);
        @Override
        public void start(final Stage primaryStage) {
            primaryStage.setTitle("Hello World");
            Group root = new Group();
            Scene scene = new Scene(root, 300, 250, Color.LIGHTGREEN);
           primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>(){
                   @Override
                   public void handle(WindowEvent arg0) {
                                    arg0.consume();
                        try
                         ModalDialog md = new ModalDialog(primaryStage);
                        catch(Exception ex)
                             System.out.print(ex.getMessage()+"\r\n");
            primaryStage.setScene(scene);
            primaryStage.show();
    }

  • How can I implement a real time datawarehouse

    Hi, I'm a little lost here but I want to know how can I implement a real time datawarehouse in sql server, I don't know if it is only to make the extraction process the shortest time possible.
    Thank you

    Hi Mega15, 
    I agree with everything Seif and Louw said, but I'd like to add that if you are using SQL Server 2012 or 2014 and you want to use DirectQuery or ROLAP mode (depending on what SSAS mode are you using, tabular or multidimensional) you may be interested on
    using columnar indexes on your base tables. 
    Analytical and aggregated queries will take GREAT advantage from these indexes, they will perform much better than with traditional B-Tree indexes in most of your scenarios. 
    Regards. 
    Pau.

  • How can I implement a Digital I/O counter with a maximum source frequency of 80 MHz (like 6602 board) using CompactRIO?

    How can I implement a Digital I/O counter with a maximum source frequency of 80 MHz (like 6602 board) using CompactRIO? It appears as if the Digital I/O modules for CompactRIO are much slower than this.
    Thank you,
    --Ray

    Hi Ray,
    The highest frequency input we offer for C Series modules is 20 MHz if you are doing LVTTL and 10 MHz for 5 V TTL.  These modules are the 9402 and 9401, respectively.  Unfortunately, there is no 80 MHz input on this form-factor.
    Regards,
    Chris E.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • How can i do a variable User exit that present the values before execute

    Hi Gurus,
    How can i do a variable User exit that present the values before execute, i need this:
    a variable that calculate SYS-DATUM until 30 days before (I got the code) but this  variable run automatic because is user exit, i want this variable but first present the values, not execute automatic, this is because the users want the report that automatic present the values , help

    Hi,
    Refer the below links,
    http://documentation.softwareag.com/natural/nat424mf/pdf/ops_mf/conf_usrex.pdf
    http://www.erpgenie.com/component/content/article/1097
    http://www.apentia-online.at/UP/Apentia/files/Article/SAP_BW_User_Exits_and_BAdIs.pdf
    Hope it helps you,
    Regards,
    Ravindra.

  • How can I implement an user function in a derived column of a report ?

    Hello,
    I've a report and added a derived column.
    In this column should be displayed the result of a function.
    GETANZGJMONATE ( to_date(#START_AFA#,'DD.MM.YYYY'), #ND#, :P302_GJ );
    How can I implement this?
    Thanks in advance
    Regards Ulrike

    Ulrike - I would do this in the SQL statement (there may be other ways).
    Presumably START_AFA and ND are table columns?
    Presumably you've also created the GETANZGJMONATE function?
    So, something like this should work (this also assumes that START_AFA is of a DATE type - you'll need the TO_DATE call if not):
    SELECT COL1
    , COL2
    , START_AFA
    , ND
    , GETANZGJMONATE (START_AFA, ND, :P302_GJ)
    from TABLE
    where ...
    Can't remember if you have to grant any particular execute permissions on the function ('grant execute on GETANZGJMONATE to public', for example) when you call it from SQL on a page, but you could try that if the function call fails.
    Depending on what's in :P302_GJ and what the function parameter data type is, you might need to use the '&P302_GJ.' syntax or TO_NUMBER etc.
    Hope this helps.
    Regards,
    John.

  • How can i implement 'Distribute Qty' function in BAPI_GOODSMVT_CREATE

    Hi all,
    Using MIGO For GR. if more than one Batch or Production Date or Vendor Batch for same Purchase Order Line Item and Deliv date, need to hit ‘Distribute Qty’ button to split the entry line into multiple lines before enter Production Date and Vendor Batch.
    So I want use bapi BAPI_GOODSMVT_CREATE  implement MIGO function for a interface. Anyone have some suggestion how can i implement the 'Distribute Qty' function in the bapi.
    My email address: [email protected]

    Hello,
    1. Use structure BAPIPAREX for passing custom fields. (There are several blogs/posts on how to make use of this).
    2. In the BAPI i noticed there is a BAdI to populate these fields into your business tables.
    Call BAdI MB_BAPI_GOODSMVT_CREATE to fill own fields
        TRY.
            get badi lo_mb_bapi_GOODSMVT_CREATE.
          CATCH cx_badi_not_implemented.                    "#EC NO_HANDLER
        ENDTRY.
        TRY.
            call badi lo_mb_bapi_goodsmvt_create->extensionin_to_matdoc
              EXPORTING
                EXTENSION_IN = EXTENSIONIN[]
              CHANGING
                CS_IMKPF     = S_IMKPF
                CT_IMSEG     = T_IMSEG[]
                CT_RETURN    = return.
          CATCH cx_badi_initial_reference.                  "#EC NO_HANDLER
        ENDTRY.

  • How can we implement the currency translation in a query definition

    How can we implement the currency translation in a query definition and should it modified for each and every type of currencies

    hi rama krishna
    i think u can not get any translation in Query. this is only for het the report as it is there in tables. if u want to write a report take a help of the Abaper
    hope u goit,assign points if u ok for this
    thanks
    subbu

  • We have a requirement to print the w2 forms for employees using java application, how can i implement this. Please give some suggestion.

    We have a requirement to print the w2 forms for employees using java application, how can i implement this. Please give some suggestion.

    Anyone any ideas to help please?

  • How can I implement the connection pool in my java stored procedure

    my java stored procedures (in database 'B') have to connect to another oracle database ,let's say 'A'. And how can I implement the behavior like the so-called connection pool in my java stored procedure in 'B', as below.
    1. database B, has 2 java stored procedures sp1 and sp2
    2. both sp1 and sp2 connects to databse 'A'
    whatever I call the sp1 and sp2 and the database 'A' always only one connected session from sp1 and sp2 in database 'B'.
    THANKS A LOTS...

    my problem is I have a lots of java stored procedures need to cnnect to the remote oracle db, and I hope the remote db can only have a connected session from my java stored procedures in my local db. I try as below
    class sp{
    static Connection conn=null; //the remote db connection,
    public static void sp1(){...}//procedure 1, using conn
    public static void sp2(){...}//procedure 2, using conn,too
    I can 'see' the 'conn' variable if I invoke the sp1() and sp2() from the same client application(maybe sqlplus). But if I invoke the sp1() from client 'A' and invoke sp2() from client 'B' then the sp1() and sp2() can not see the 'conn' variable for each other. I think it's because the two clients cause oracle to create two instances of the class 'sp' and the sp1() and sp2() located in different instance seperately. Thus the sp1() and sp2() can not see 'conn' for each other. They can only see its own 'conn'.
    To connect to the remote db from the java stored procedure is easy but is it possible to connect to the remote db via database link from the java stored procedure at my local db ? If so, then I also archive my goal .
    BTW , thanks a lots...
    andrew :-)

  • How can we implement product key feature while installing AIR application?

    How can we implement product key feature while installing AIR application?

    Hello,
    Could you try using /Q or /QS parameter?
    http://msdn.microsoft.com/en-us/library/ms144259(v=sql.110).aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • How can I implement IMAQ correlation for 16bit image?

    Hi
    When using IMAQ correlate. vi in Machine vision Filter catergory, the vi only works for 8 bit source and template image case.
    16 bit source image case makes error.
    But I need 16 bit source image without losing image information, I want to use full 16 bit image correlation with 8 bit template.
    How can I implement the code in labview?
    Need help.
    Many thanks.

    Unfortunately you can't do so.
    There are some functions in the Vision Lib that only accept 8bit images. In order to use them you have to convert your image to an 8bit Image.
    Keep in mind that converting an Image to 8bit will not necessary result in a loss of data. Check your Images, it might be that you are not using the full range of a 16bit value. you might be able to use a mixture of dynamic shifting and bit shifting in order to convert an image to an 8 bit, then embedding these criterias in the image and use them to convert back to a 16bit at a later time without losing any data, or in most cases minimal precision loss. 
    If you would like to attach one of the images you are using, I can take a look at it to see if this is possible in your case.
    Good luck,
    Dan,
    www.movimed.com - Custom Imaging Solutions

  • How can I implement Authentication in LDAP

    How can I implement Authentication in LDAP.

    Hi,
    If ur using JAAS, then use NTLoginModule in ur conf file and your own defined CallbackHandler for validating and obtaining the Subject (user connected to your domain).
    Remember the user is the one which the code obtains when u login to your Domain based machine.
    Apart from this, Apache Http Server also provides you with a popup window asking for the user's credentials when u set the SSPIDomain in the httpd.conf file.
    httpd.conf
    ========
    <Location /Seet/servlet/ >
    SSPIAuth On
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "seet190 auth"
    AuthType SSPI
    SSPIAuth On
    SSPIAuthoritative On
    require valid-user
    SSPIDomain seet190
    </Location>
    seet190 is the domain name
    Actually so far in the Security Forum, u might refer to some of the replies posted for more help but actual LDAP authentication can be done by passing the user's info too.
    HTH,
    Seetesh

  • How can I implement this database?

    Okay, so if you are working with a company who owns more than 10 apartment complexes and they have asked you to build a database.
    So if I want to implement this database.
    What database software package should I use (SQL Enterprise or SQL Data Center) (do not know the difference between the two) or is there any other SQL version that can be used/considered
    Also what else would I have to build or buy? What combination of things do I need?
    What hardware is needed at each apartment complex?
    I was told that something off the shelf will not give me everything I need.

    Please do not duplicate posts. You already posted it here
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/5dfc3897-3ffb-490b-8e60-e775b43d3303/how-can-i-implement-this-database?forum=sqlgetstarted
    Andy Tauber
    Data Architect
    The Vancouver Clinic
    Website | LinkedIn
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
    "Mark as Answer" and
    "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

  • How can I implement recipe control concept in SAPME?

    Dears,
    How can I implement recipe control concept in SAPME?
    For example,
    We can config the standard temperature setting needs to be between 100~120 degree C for Operation OP1 and Material MA1
    So, before user start the SFC of MA1 at OP1, system can display the config values(100~120) for user reference, then, user need to input the real temperature when process the SFC, if it's out of spec, system can warning. System will collect the input data for analysis in future.
    Thank you.

    Thank you for your information.
    Since customer prefer to use a custom UI which can communicate with SAPME by web service.
    So I can not use SAPME default data collection or work instruction user interface.
    I'm considering by using data collection and work instruction config data to develop a web service in MII and poblish to custom UI in which it can display the spec data and reject user's input if out of spec.
    Please feel free to inform me if any other good idea, thanks!

Maybe you are looking for

  • Calling a WebService from Java Applet

    Hi all, In my application I have 3 projects: 1. server - for all the business logic. 2. view - for web app. 3. swing - for applet. In the view project I wrote a WS, and I want to call it from my applet. So I created a WS using the Jdev (10.1.3.2) wiz

  • Portlet backing file vs content backing file

    Hi, could someone explain the differences between a "portlet backing file" and a "content backing file". Both are properties available on a portlet. Thx Emmanuel

  • Is there a way to check if a VI is executable?

    Hi - I have a problem. Can anyone help? I have a top-level VI that calls a whole bunch of different VIs via a "Call by reference node" - a sort of plug-in structure. Anyway, occasionally one of those VIs gets into a state where it cannot be run and t

  • Help! Unreconciled Stopped Payment affecting Control Totals

    All, I have an issue in Oracle Cash Management (Bank Recon) where a stopped payment was reconciled which created a Receipt Line and updated the Amount in the Line Totals. This created an imbalance between the Control Totals and the Line Totals, so th

  • Fios external 2TB drive filled up, now no access to it

    I've been running my fios with external 2TB for 2 years now.  After letting it get to 100% full ( in the DVR section of the menus where it shows space used ) by accident, I can now no longer see anything that is stored there.  I see that the set is r