How to continue the loop loop T/F until it is wrong

Need help!

I want to compare 2 numbers (low and high).

If salvation > Lo - false cases: go to the next step

If Lo > Hi - real deal: display the error and ask the user enter again until it is correct (case false)

Can you post your code? It would make it much easier to see what is the problem. In the meantime, I have attached an example of code that basically does the same thing you want to do.

Tags: NI Software

Similar Questions

  • Continue the loop after the exception thrown in SQL

    How would continue the while loop in the code below after an exception was thrown?

    DECLARE    
    v_blob_data       BLOB;    
    v_blob_len        NUMBER;    
    v_position        NUMBER;    
    v_raw_chunk       RAW(10000);    
    v_char      CHAR(1);    
    c_chunk_len   number       := 1;    
    v_line        VARCHAR2 (32767)        := NULL;    
    v_data_array      wwv_flow_global.vc_arr2;    
    v_rows number;    
    v_sr_no number := 1;  
    v_first_line_done boolean := false;  
    v_error_cd number :=0;  
    v_quote_pos1 NUMBER;  
    v_quote_pos2 NUMBER;  
    v_enclosed_str VARCHAR(200);
    v_errmsg VARCHAR2(4000);
    
    BEGIN
    
     delete from TEMP_MM_UPDATE where username = :P1_USER_ID;
    
    -- Read data from wwv_flow_files</span>    
     select    
      blob_content    
     into v_blob_data    
     from wwv_flow_files    
     where name = :P2_FILE_UPLOAD; 
    
     v_blob_len := dbms_lob.getlength(v_blob_data);    
     v_position := 1;
    
    
    
     -- Read and convert binary to char</span>  
     WHILE ( v_position <= v_blob_len )    
     LOOP
    
    begin 
     
      v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);    
      v_char :=  chr(hex_to_decimal(rawtohex(v_raw_chunk)));    
      v_line := v_line || v_char;    
      v_position := v_position + c_chunk_len;
      
     -- When a whole line is retrieved </span>   
     IF v_char = CHR(10) THEN
     
     LOOP  
      --Make sure there's something to replace  
      IF INSTR(v_line, '"', 1, 1) = 0 THEN  
      EXIT; -- If nothing to replace, exit loop and don't try  
      END IF;  
      --Find the position of the first and second quotes in the line of text  
      v_quote_pos1 := INSTR(v_line, '"', 1, 1);  
      v_quote_pos2 := INSTR(v_line, '"', 1, 2);  
      --Extract the inner string  
      v_enclosed_str := SUBSTR(v_line, v_quote_pos1 + 1, v_quote_pos2 - v_quote_pos1 - 1);  
      --perform the replacement  
      v_line := SUBSTR(v_line, 0, v_quote_pos1 - 1) || REPLACE(v_enclosed_str, ',', '<') || SUBSTR(v_line, v_quote_pos2 + 1);  
     END LOOP; 
      
     -- Convert comma to : to use wwv_flow_utilities </span>  
     v_line := REPLACE (v_line, ',', ':');  
     v_line := REPLACE (v_line, '<', ',');  
     v_line := REPLACE (trim(v_line), '-', NULL);  
     --v_line := REPLACE (trim(v_line), '"', NULL);  
     -- Convert each column separated by : into array of data </span>    
     v_data_array := wwv_flow_utilities.string_to_table (v_line);  
     --Check to see if the row of column headers has already been parsed through  
     IF(v_first_line_done != true)THEN   
      v_first_line_done := true;  
      --Check column order in spreadsheet  
      IF(v_data_array(1)   LIKE '%Username%' AND
        v_data_array(2)  LIKE '%NDN%' AND
        v_data_array(3)  LIKE '%PCFN%' ) THEN   
       v_error_cd := 0;  
       v_line := NULL;  
      ELSE  
       v_error_cd := 1;  
      END IF;  
     --If first line is done and the column order is correct then  
     ELSIF(v_first_line_done = true AND v_error_cd = 0) THEN   
     -- Insert data into target table </span>    
     EXECUTE IMMEDIATE 'insert into TEMP_MM_UPDATE   
     (USERNAME,
       RPT_FLAG,
      PCFN)
     values (:1,:2,:3)'   
       USING   
      v_data_array(1),   
      v_data_array(2),   
      v_data_array(3);
       -- Clear out    
      v_line := NULL; v_sr_no := v_sr_no + 1; 
     
     END IF;  
     END IF;
    
    exception
    WHEN OTHERS then
      v_errmsg := SQLERRM;
      insert into temp_mm_update (username,error_desc)
      values (:P1_USER_ID, v_errmsg);
    end;
      
     END LOOP;
    
    
     
    DELETE FROM WWV_FLOW_FILES where name = :P2_FILE_UPLOAD;
    DELETE FROM TEMP_MM_UPDATE WHERE USERNAME IS NULL AND PCFN IS NULL;  
     IF(v_error_cd = 1) THEN  
    INSERT INTO temp_mm_update (USERNAME, ERROR_DESC)  
    VALUES (:P1_USER_ID, 'Error. Please check column order in spreadsheet.');  
    END IF;
    EXCEPTION
        WHEN NO_DATA_FOUND THEN
            insert into temp_mm_update (username,error_desc)
      values (:P1_USER_ID, 'No Data Found.');
     WHEN OTHERS then
      v_errmsg := SQLERRM;
      insert into temp_mm_update (username,error_desc)
      values (:P1_USER_ID, v_errmsg);  
    
    END;
    
    

    When I set the exception inside the loop, as above, the procedure seems never to end, and I end up getting a 'NOWAIT' error when I try to remove the table or something like that.

    The code works fine if I remove the 'START' just after the loop and also out of the exception within the loop, but I want to be able to specify what's wrong with each record rather than deal with the correct records and then stop after that it is a record that has, for example, 9 values in a column that accepts only 6.

    Can anyone help with this?

    Thank you

    Steven

    Play with my code I found what was wrong.
    I needed to add in the following line in my code block of exception:
    v_line := NULL; v_sr_no := v_sr_no + 1;
    
    Final code:
    DECLARE
      v_blob_data       BLOB;
      v_blob_len        NUMBER;
      v_position        NUMBER;
      v_raw_chunk       RAW(10000);
      v_char      CHAR(1);
      c_chunk_len   number       := 1;
      v_line        VARCHAR2 (32767)        := NULL;
      v_data_array      wwv_flow_global.vc_arr2;
      v_rows number;
      v_sr_no number := 1;
      v_first_line_done boolean := false;
      v_error_cd number :=0;
      v_quote_pos1 NUMBER;
      v_quote_pos2 NUMBER;
      v_enclosed_str VARCHAR(200);
      v_errmsg VARCHAR2(4000);
    BEGIN
      delete from TEMP_MM_UPDATE where username = :P1_USER_ID;
    
      -- Read data from wwv_flow_files
      select
        blob_content
        into v_blob_data
        from wwv_flow_files
        where name = :P2_FILE_UPLOAD; 
    
      v_blob_len := dbms_lob.getlength(v_blob_data);
      v_position := 1; 
    
      -- Read and convert binary to char
      WHILE ( v_position <= v_blob_len )
      LOOP
        begin
            v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
            v_char :=  chr(hex_to_decimal(rawtohex(v_raw_chunk)));
            v_line := v_line || v_char;
            v_position := v_position + c_chunk_len;
    
          -- When a whole line is retrieved 
          IF v_char = CHR(10) THEN
            LOOP
              --Make sure there's something to replace
              IF INSTR(v_line, '"', 1, 1) = 0 THEN
                EXIT; -- If nothing to replace, exit loop and don't try
              END IF;
              --Find the position of the first and second quotes in the line of text
              v_quote_pos1 := INSTR(v_line, '"', 1, 1);
              v_quote_pos2 := INSTR(v_line, '"', 1, 2);
              --Extract the inner string
              v_enclosed_str := SUBSTR(v_line, v_quote_pos1 + 1, v_quote_pos2 - v_quote_pos1 - 1);
              --perform the replacement
              v_line := SUBSTR(v_line, 0, v_quote_pos1 - 1) || REPLACE(v_enclosed_str, ',', '<') || SUBSTR(v_line, v_quote_pos2 + 1);
            END LOOP; 
    
            -- Convert comma to : to use wwv_flow_utilities 
            v_line := REPLACE (v_line, ',', ':');
            v_line := REPLACE (v_line, '<', ',');
            v_line := REPLACE (trim(v_line), '-', NULL);
            --v_line := REPLACE (trim(v_line), '"', NULL);
            -- Convert each column separated by : into array of data 
            v_data_array := wwv_flow_utilities.string_to_table (v_line);
            --Check to see if the row of column headers has already been parsed through
            IF(v_first_line_done != true)THEN
              v_first_line_done := true;
              --Check column order in spreadsheet
              IF(v_data_array(1)    LIKE '%Username%' AND
                  v_data_array(2)  LIKE '%NDN%' AND
                  v_data_array(3)  LIKE '%PCFN%') THEN
                v_error_cd := 0;
                v_line := NULL;
              ELSE
                v_error_cd := 1;
              END IF;
            --If first line is done and the column order is correct then
            ELSIF(v_first_line_done = true AND v_error_cd = 0) THEN
              -- Insert data into target table 
              EXECUTE IMMEDIATE 'insert into TEMP_MM_UPDATE
              (USERNAME,
               RPT_FLAG,
               PCFN)
              values (:1,:2,:3)'
               USING
                v_data_array(1),
                v_data_array(2),
                v_data_array(3);
               -- Clear out
                v_line := NULL; v_sr_no := v_sr_no + 1;
            END IF;
          END IF;
        exception
          WHEN OTHERS then
            v_errmsg := SQLERRM;
            insert into temp_mm_update (username,error_desc)
            values (:P1_USER_ID, v_errmsg);
    v_line := NULL; v_sr_no := v_sr_no + 1;
      END;
      END LOOP;
    
      DELETE FROM WWV_FLOW_FILES where name = :P2_FILE_UPLOAD;
      DELETE FROM TEMP_MM_UPDATE WHERE USERNAME IS NULL AND PCFN IS NULL;
      IF(v_error_cd = 1) THEN
        INSERT INTO temp_mm_update (USERNAME, ERROR_DESC)
        VALUES (:P1_USER_ID, 'Error. Please check column order in spreadsheet.');
      END IF;
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        insert into temp_mm_update (username,error_desc)
        values (:P1_USER_ID, 'No Data Found.');
      WHEN OTHERS then
        v_errmsg := SQLERRM;
        insert into temp_mm_update (username,error_desc)
        values (:P1_USER_ID, v_errmsg);
    END;
    
  • How to continue a loop after rear roller called a Transaction in SOA

    Hi all

    I have major bpel processes that call an external web service that returns the Recordset.

    iiterate through the game, I need to remember the each file in topic QA.

    and ack each record after their storage in AQTopic. If the ACK does not I should roll back the previously inserted record of QA.

    I have divided into two parts of the XA transaction using "checkpoint();".

    Based on the status of the receipt, I called throw with Rollback transaction activity, I handled that by using catch everything in scope.but even after this process ends is not an iteration in the loop.

    I used XA Datasource.

    Please suggest me.

    Thanks René.

    Hi PuneetRekhade,

    Thanks for your suggestion.

    After receving the ack = success, before storing the recording in the AQ if the system breaks down data would no longer exist in AQ's or database for the external web service.

    the recording should not be lost at any cost.

    in my case, if the system crashes before sending the data to QA, nothing happens because I wouldn't send the acknowledgement to the external web service.

    Thank you

    Raj.

  • How to know the size of a node until it is displayed?

    Hello

    I am trying to anchor two nodes (say A & B) near the top of a component to anchor such as B set out below A. To do this, I provide an offset to anchor for the order of B, who must be the height of node A. However, as the scene containing has not yet been demonstrated, the method for the node getWidth() returns 0 (zero). Since the size node A is calculated based on the content, I can't hard-code size. So I am at a loss how to provide the height of node A in a dynamic way.

    Please do not hesitate to ask me to clarify the matter, if I myself not clear enough.

    Thank you.

    You have more than two answers, but if you continue in this way, the links can help you:

    VBox A = new VBox();
    A.widthProperty().addListener(new ChangeListener() {
    
                public void changed(ObservableValue ov, Number t, Number t1) {
                    AnchorPane.setTopAnchor(B,  t1);
                }
            });
    

    I like the answer which recommends another provision.

    Published by: ciruman on July 13, 2012 05:10

  • How to make the loop audio clips in the first or elsewhere

    HOW CAN I DO AUDIO LOOPING CLIPS IN THE FIRST OR ELSEWHERE?

    None of these answers are correct.

    My brother found this thread, looking for help and left in frustration, asking for the answer instead.

    Kevin Monahan response is only semi-finished.

    Here's the full answer:

    Looping a video or audio clip on the timeline, right-click and select 'nest...".

    Name the nest, what you please.

    Now, double-click on nested clip you just created. This allows to enter the nested sequence.

    NOW you can select the clip, copy and Paste several times. (Just keep hitting CTRL V, and the read head automatically moves forward to place the next clip.)

    Return to the main sequence.

    Now you can use the selection tool to extend this nest as much or as little as you like.

    It is a far superior method, because a nested sequence is a SINGLE ELEMENT that can be resized, given effects, moved, lengthened and shortened very easily.

  • How to use the loop in BPEL process

    Hi friends

    I did a bpel process that picks up the XMl file using the File adapter and imports the data from the XMl file into db oracle table using the DB adapter...

    But here the XML in the file that have only one line... If I want to insert the XML code in the file that have two or more lines I want to use a loop in my process BPEL how to use loop in my bpel process?

    In my BPEL process, that I have que j' ai utilise used receive, process and call activity where I can use in my BPEL process

    Thanks in advance

    AT

    Here is a basic example of while activity in BPEL

    http://blogs.Oracle.com/ajaysharma/

    Thank you
    AJ

  • How to add the loop to the video?

    How to write after I finished the play button on the video active?

    When I click on play button movie playing the first.

    and how the video loop?

    While you are using the term 'video' incorrectly.

    do you mean you want your swf to play again?   If so, the easiest way is to use in your main timeline:

    {replay_btn.onRelease = Function ()}

    loadMovieNum(this._url,0);

    }

  • How to use the loop to commit every 1 M folders?

    Oracle 9i
    40 M records must be insert the table. You will need to validate every 1 M. But I don't want to loop every recording and validation. I like select commit and records of 1 m and then select another 1 M, then validation; How to do? use the save point?

    Appreciate any ideas.
    Thank you
    S.

    You can perform this anonymous help block by using a loop and listen but it not a good idea to commit after 1 million or 100 k you put more load on your system and the performance will be declining.

    Concerning

  • Video continue the loop

    I have images of 30 seconds, and I want to keep it to loop. Where it is.

    Thank you

    Simon

    If you want to display in a loop there a loop button in the Source and the program monitor.

    Otherwise, you need to put a dozen or more times on the timeline to make it loop.

  • BlackBerry Smartphones how out of the loop of ID

    My old BB Bold died on me - and I mean dead. No discount to zero and even the Desk top manager doesn't recognize it. I bought a Torch 9800 has changed the SIM card and it worked fine, until it came to the e-mail set up. I could remember my user name but not the password. I duly clicked 'forgot password' and back came the answer password sent to your B'berry. Probably at my "BOLD" dead. Because I can not access my mail to set the address on the new torch, because I need the password, I'm stuck here. I went to the site of B'berry ID, punch in the username and they too want to sent me a password to my address B'berry. I tried my service provider to get the password. Once more sent to my address mobileemail. They do not provide access to my address mobileemail, web-based as well as possibility of password recovery was released. I tried to go back and recreate a new user ID. No problem until I come to the e-mail address, how I threw because the address is already in use - no surprise, except that I can't use it.

    Is there someone who can suggest a way out of this? Short of renouncing the B'berrys and the purchase of an another smart phone providers.

    PVW

    Thank you very much for your promt reply. I tried your advice/suggestions, but without success. I can only conclude that your point about the dangers of use BIS for the was/is the real pitfall BBID enamel only. My provider has been particularly useless and made disparaging remarks about the problems caused by the so-called B'berry accounts 'package '. The megastore where I bought my BB Bold faithful a few years before, is more about B'berrys and were unable, rather reluctant to help. Europe becomes a wilderness of B'berry. So, I think after 10 years of happiness of Blackberry and three days of effort wasted his defeat in face of time and switch to another system.

    Thanks again for your help. You can't win them all; as the proverb says.

    PVW

  • How to make the loop of the FLVPlayback component

    Hello

    use of the FLVPlayback component to complete an animation and I don't see anywhere in the settings, select this option, I'm sure it's an easy fix, I don't know where to look.

    Thank you

    published too soon...

    Mx.video import. *;
    var listenerObject:Object = new Object();
    listenerObject.complete = {function(eventObject:Object):Void}
    my_FLVPlybk.play ();

    };
    my_FLVPlybk.addEventListener ("complete", listenerObject);
    my_FLVPlybk.contentPath = "PS Animation QT.flv";

  • How to continue the drawing with the pen tool

    Hello

    Let's say that I start to draw an image with the pen tool. Something happens 1/2 through the work of track and I need to stop the trace. How I later come back and start the trace of my last point and continue to the end. Now, all I get is new anchor points and lines that do not join the original track. Thank you

    To resume adding segments to a pre-existing open path with the pen tool:

    1. Hover over the endpoint of the path. A slash mark appears next to the cursor.
    2. Click on the endpoint.
    3. Continue to add the anchorPoints.

    It is not necessary first to select the path (but it should be).

    JET.

  • How to hide the part of my page until my survey is submitted?

    I have a web page that has a poll on this subject.  When users send the survey, I want content on the page to show them the correct answers for the poll.  (They will vote on what they think a dog breeds).  It can be found at http://animalhospitalofkennewick.com/dna.php.  The survey is on the left.  The content to the right of the voting that begins with "Good Job!" needs to be hidden until they voted in the poll.  All this content is located in the "hidden" div  How can I do this?  I tried "display: none;" in CSS but then it never occurs later.  Help!

    Jeannette

    I had another look at the site and now get a database error.

    To answer your question, I used the buttons as an example of how to trigger hide and show fuction. This trigger can be place d on a div or a link. In your case, you will place the trigger on everything that makes the answers to questions. This part, I still don't see because of the error messages. This is the piece of code that triggers the fuction

    onClick = "show () '"

    and can be placed anywhere. Instead of a click, the trigger can be a passage of the mouse, a mouseOur, an onChange (when a value has been changed) etc.

    GRAMPS

  • How to end a loop using hits/keypress in applescript?

    the value dFolder to '~/Desktop/screencapture/ '.

    the shell script ("mkdir - p" & dFolder)

    the value I 0

    the value x for the shell script 'date + %m %d - hour %M %S %Y' as string

    repeat 10 times

    define a shell script ("screencapture gif t - x" & dFolder & i & x & ".gif") as string

    Try

    say application "Image events".

    the value this_image to Open one

    this_image scale size 10

    Save this_image

    end say

    end try

    delay 3

    the value i to i + 1

    end Repeat


    Sample applescript with a screencapturing loop.

    Problem: How to end the loop using the key combination or keycode?

    Problem: How to end the loop using the key combination or keycode?

  • AFTER ERROR CONTINUE to LOOP (or any other way)

    Hi all
    I have to keep my loop for next after the error.

    ---
    BEGIN
    FOR rs
    (SELECT 'my select stmt' FROM DUAL)
    )
    LOOP
    NULL;-if there is error update error information in the ERR_LOG table and continue the loop
    END LOOP;
    EXCEPTION
    WHILE OTHERS THEN
    INSERT INTO ERR_LOG VALUES ('error details')
    NULL;
    END;
    ---

    or apart from Above method we have another way to implement above solution?

    Thank you
    Isabelle Dhaneenja

    You can declare an another begin... end with its own exception handler to catch the error.

    BEGIN
    FOR rs
    (SELECT 'my select stmt' FROM DUAL
    )
    LOOP
    NULL;--if there has error update error info to ERR_LOG table and continue loop
       begin
       null;
       EXCEPTION
       WHEN OTHERS THEN
       INSERT INTO ERR_LOG VALUES('error details' )
       end:
    END LOOP;
    
    END;
    

Maybe you are looking for