Making 2 for loops without nested

How to make two for loops without nested like the follwoing
for i in 1.10, j in 1..30 loop
end loop
Please help me

Following is the closest I could think of...
SQL> ed
Wrote file afiedt.buf
1 declare
2 type myrec is record (ctr1 number, ctr2 number);
3 type tabrec is table of myrec ;
4 v_tabrec tabrec := new tabrec();
5 begin
6 for i in 1..10 loop
7 v_tabrec.extend;
8 v_tabrec(i).ctr1 := i;
9 v_tabrec(i).ctr2 := i;
10 end loop;
11 for i in 11..30 loop
12 v_tabrec.extend;
13 v_tabrec(i).ctr2 := i;
14 end loop;
15 for i in v_tabrec.first..v_tabrec.last loop
16 dbms_output.put_line(v_tabrec(i).ctr1 || v_tabrec(i).ctr2);
17 end loop;
18* end;
SQL> /
11
22
33
44
55
66
77
88
99
1010
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

Similar Messages

  • Issue with FOR loop in Nested BEGIN and END terminals

    Hi All,
    I am trying to fetch row by row using FOR loop on CURSOR.An i am getting Error attached screen shot:
    Below is the logic:
    Create Procedure TEST1() LANGUAGE SQLSCRIPT AS
    BEGIN
    AN01 = Select * from AN.View;
    AN02 = SELECT DISTINCT F1,F2,F3 from :AN01 GROUP BY F1,F2,F3;
    BEGIN
    DECLARE CURSOR ITEM_RULE FOR select F1,F2,F3 from :AN02;
    FOR V_ITEM_RULE AS ITEM_RULE DO
    SELECT * from TABLE1 where F1 = V_ITEM_RULE.F1;
    END FOR;
    END;
    END;
    Here i an getting data from AN01..Then finding the Distinct in AN02.
    On AN02 i am applying CURSOR...and for each row i wanted to find an entry in TABLE1 and do a calculation further.
    -- But when i am using a FOR loop in the Nested BEGIN i am getting below Error.
    -- I tried to Activate successful without FOR Loop.
    Any Suggestion on the above issue.
    Thanks
    kalyan

    Hi Kalyan,
    Your procedure is incomplete.
    Why are you looping to make a select that you do not use? What is the target for ITEM_RULE_GDS selection?
    Also, like it is currently exposed a JOIN is highly recommended.
    Are you just playing around with procedure or you really have a scope to do ?
    Regards, Fernando Da Rós

  • For loop without N input

    Hi Guys,
    I have looked at the I/O example and found that the for loop in the example can exist without an input of N. I tried the same thing in the VI created by myself. I think the problem is the type of the tunnel. Can I change the input tunnel into a indexed tunnel? I right-click the tunnel and there is no option to change the tunnel into a auto-indexed one. 
    Attachments:
    loop_test.vi ‏6 KB

    Have you looked at the LabVIEW Help? This is explained in there.
    To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the _

  • Writing data to spreadsheet in FOR loop without shift register

    My program has a case window within a For loop.  The loop iteration index is wired to the case, so there’s a case for each iteration of the loop (about 30 cases).  In each case, data points are gathered, formatted to a spreadsheet and written to a file, along with some occasional header strings to describe the data.  This works fine, as I can simply write the data to file as soon as I get it. 
    At some point in the loop, I’m gathering from two sources (rpm data for two fans) over several iterations that is to be written to two separate but similar formatted tables in the same output file.  Since I’m writing two tables to one file simultaneously, I can no longer write on-the-fly in a linear fashion; I’d need to store all the information until I complete the iterations, then format the header & raw data to spreadsheet and write to file in two chunks – at least, this is what I believe is the way to go, but I’m all ears if there’s another way.
    In order to buffer the data, I could use a shift register, but this requires me to wire an array across my loop for all loops, whether I’ll be using it or not.  I’ve also considered initializing an array at the case I’ll need to start buffering, then writing to a local variable of that array, but in fiddling with this approach, I don’t see how to specify what index to which I’m storing the data point.
    So I’m looking for advice on whether (1) there’s another way to accomplish my goal and/or (2) how to execute the initialize array and local variable approach. 
    Below is a picture of what I want this portion of the spreadsheet to look like.  Also included is a much abbreviated mock-up of my program for a case where I’m writing on the fly for a single table or column of information and a case where I’m setting up the write to local variable approach.  
    Message Edited by TESTIE on 04-03-2008 12:48 PM
    Attachments:
    illustration22.JPG ‏52 KB
    output_file2.JPG ‏120 KB
    illustration3.JPG ‏50 KB

    An Action Engine can thought of as an encapsulated shift register.
    AE's out-perform locals while alos elliminating possible race conditions. You may want to review the Nugget I wrote on Action Engines.
    Just trying to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to put entries in a for loop without hard coding the values

    I have a below pl/sql block that needs to flag a claim based on claim number values given that I have in an excel sheet. Is there a way to capture those 500 claims efficiently in the select statement in the pl/sql without hardcoding these from value 1 ...to value 500 (as listed below)???
    DECLARE
       ln_ctr   NUMBER := 0;
    BEGIN
       FOR lrecclaimnumber
       IN ( SELECT   entityid claimnumber
             FROM   mpi_fnx.wfTokenEntity wte
            WHERE   wte.entityid IN
                          ('Value1','Value2',....'Value 500')
    LOOP
       mpi_fnx.pkgSaveClaimData.spMarkClaimInvalid (pivClaimNumber          => lrecclaimnumber.claimnumber,
                                                    pininvalidreasonid      => 304,
                                                    pinuserid               => 4999
       ln_ctr := ln_ctr + 1;
       END LOOP;
       DBMS_OUTPUT.put_line ('Total Entries Processed: ' || ln_ctr);
    END;
    /

    DECLARE
       ln_ctr   NUMBER := 0;
    BEGIN
       FOR lrecclaimnumber
       IN ( SELECT   entityid claimnumber
             FROM   mpi_fnx.wfTokenEntity wte
            WHERE   wte.entityid IN
                          (select 'Value '|| level as col_name from dual  connect by level <=500)
    LOOP
       mpi_fnx.pkgSaveClaimData.spMarkClaimInvalid (pivClaimNumber          => lrecclaimnumber.claimnumber,
                                                    pininvalidreasonid      => 304,
                                                    pinuserid               => 4999
       ln_ctr := ln_ctr + 1;
       END LOOP;
       DBMS_OUTPUT.put_line ('Total Entries Processed: ' || ln_ctr);
    END;
    / bye
    TPD

  • REF CURSOR FOR LOOP WITHOUT FETCHING

    I am trying to run the following PL/SQL with REF CURSOR.
    I am using FOR .. IN <REF CURSOR NAME> LOOP construct. The compiler fails at FOR v_Each IN v_Cursor line complaining that the v_Cursor is not delared. You can see the v_cursor is defined in the DECLARE section. If I change the FOR v_Each IN v_Cursor to
    FETCH v_Cursor INTO v_RecordHolder;
    EXIT WHEN v_Cursor%NOTFOUND;
    then the PL/SQL will run. Does anyone know why I can not use my prefer construct?
    If I use FETCH .. INTO, since my select statment returns a result of severla joins, I have to create a Record() structure for all the columns returns, is there a way to create a Record() type that only has one field%ROWTYE.
    /******* my code starts here ********/
    DECLARE
    v_StartDate DATE := TO_DATE('05-01-2003','MM/DD/YYYY');
    TYPE t_CursorRef IS REF CURSOR;
    v_Cursor t_CursorRef;
    BEGIN
    OPEN v_Cursor FOR
    SELECT DISTINCT E.*, P.P_CODE, C.PT_ID
    FROM TABLE1 E, TABLE2 P, TABLE3 I, TABLE4 C
    WHERE E.P_ID = P.P_ID AND E.E_ID = I.E_ID
    AND E.P_ID = C.PT_ID (+)
    AND TRUNC(E.E_DATETIME) >= TO_DATE(v_StartDate)
    AND E.DIS_ID = 1
    AND RTRIM(P.A_CODE) = 'A'
    AND ((MONTHS_BETWEEN(SYSDATE,P.P_BEGIN)/12 > 40) AND (MONTHS_BETWEEN(SYSDATE,P.P_END)/12 < 85))
    AND (RTRIM(I.E_D_CODE) IN ('V81.1','272.2','272.4','401.9','305.1','278.00','272.0') AND RTRIM(I.E_D_CODE) NOT IN ('414.9','414.00','250.00','436','414.01'));
    FOR v_Each IN v_Cursor LOOP
    DBMS_OUTPUT.PUT_LINE('Inside the loop P_ID is ' || TO_CHAR(v_Each.P_ID));
    CLOSE v_Cursor;
    END LOOP; /* FOR v_Each */

    Please post technical questions in the respective forums : PL/SQL
    Is it mandatory for you to use REF CURSOR, else you could use the following code which gives the same result.
    DECLARE
    v_StartDate DATE := TO_DATE('05-01-2003','MM/DD/YYYY');
    CURSOR v_Cursor(inputdate DATE) IS
    SELECT DISTINCT E.*, P.P_CODE, C.PT_ID
    FROM TABLE1 E, TABLE2 P, TABLE3 I, TABLE4 C
    WHERE E.P_ID = P.P_ID AND E.E_ID = I.E_ID
    AND E.P_ID = C.PT_ID (+)
    AND TRUNC(E.E_DATETIME) >= inputdate
    AND E.DIS_ID = 1
    AND RTRIM(P.A_CODE) = 'A'
    AND ((MONTHS_BETWEEN(SYSDATE,P.P_BEGIN)/12 > 40) AND (MONTHS_BETWEEN(SYSDATE,P.P_END)/12 < 85))
    AND (RTRIM(I.E_D_CODE) IN ('V81.1','272.2','272.4','401.9','305.1','278.00','272.0') AND RTRIM(I.E_D_CODE) NOT IN ('414.9','414.00','250.00','436','414.01'));
    BEGIN
    FOR v_Each IN v_Cursor(v_StartDate) LOOP
    DBMS_OUTPUT.PUT_LINE('Inside the loop P_ID is ' || TO_CHAR(v_Each.P_ID));
    END LOOP; /* FOR v_Each */
    END;

  • How to ignore error and continue with next value in PL/SQL FOR loop?

    hi,
    When the DROP INDEX statement fails it have to continue with the next value in FOR loop without exiting from the loop. Can anyone tell me how to do this?
    DECLARE
    CURSOR aud_cur IS
    SELECT key_col_idx FROM audience_work where aud_ref_id between 106 and 109;
    BEGIN
    FOR aud_row IN aud_cur LOOP
    EXECUTE IMMEDIATE
    'DROP INDEX ' || aud_row.key_col_idx;
    END LOOP;
    END;
    Thanks,
    Noble

    DECLARE
      CURSOR aud_cur
      IS
      SELECT key_col_idx FROM audience_work where aud_ref_id between 106 and 109;
    BEGIN
      FOR aud_row IN aud_cur LOOP
        begin
          EXECUTE IMMEDIATE 'DROP INDEX ' || aud_row.key_col_idx;
        exception
          when others then
            if sqlcode = -01418 then
              dbms_output.put_line(' index does not exist ');
            else
              dbms_output.put_line(sqlcode);
              raise;
            end if; 
        end;
      END LOOP;
    END;
    /

  • For loop prob - PLEASE HELP!

    I am having problems with a for loop. This for loop is nested within some other for loop. the problem I'm having is that the for loop executes once and then exits to execute the outer for loop. my initial reaction was that my condition (in the for loop ) was false the second time round thus resulting in the exit. I'm usually told to paste some code so i'll do that:
    for (int i=0; i<row.size(); ++i){
      for (int all = 1; all < row.size();all++){
       try{          
         for (int k=0; k< column.size();  k++){
         System.out.println(" column size " + column.size());
         Long longObject1 = (Long)((Vector)row.get(i)).get(k);
         System.out.println(" getting" + longObject1);
    }                              �
         for (int k=0; k< column.size(); k++){ is the loop causing me problems.  column.size() evaluates to 2 so what is the problem?

    No I don't think there is another thread effecting column -I have even placed a Println to show what the value of column is. At present the value of column is 2 so the for loop should execute twice.
    I have a catch block which catches ClassCastException. The second element in row is not null. Furthermore, the size of count is 2 so the for loop should execute twice.
    yes the first element in row is another vector. (Row is a vector of vectors). I've looked at the other suggestions too but even after considering these i am left with the same problem. Any other suggestions? I could do with all the help I can get. Thanks

  • Stopping a For Loop, part 2

    Hello. Thank you everyone for your help, getting to this point. I asked for help to create a stop condition, while a For Loop is running. I was given many ideas and selected the one that used local variables. It works well however, if I am in the "Test in progress" state, in the first For Loop, and the "Stop" button is selected from the front panel, when it stops the Vi, it sends the value "5" to the second For Loop before going to the "End" state, which puts it to "0", then stops the Vi. What this Vi is doing is feeding 0-200VDC signal to an eddy current sensor, then it feeds 200-0VDC going the other direction. I have tried sequencing, putting in timers and a few other goofy things but I can not get the Vi to stop in the first For Loop, without the Vi performing the initial "5" to the second For Loop. Someone had mentioned using an event handler, in my previous post. I practiced for quite some time, trying to understand how to use an event handler but am not much the wiser. Any and all input would be greatly appreciated.

    altenbach wrote:
    ceilingwalker wrote:
    You are autoindexing way too many thing between the two FOR loops I was doing this to create a data dependency, at least that was my thought process behind it. As far as the physical channels and VISA refnums, I did it this way so I didn't create more controls for the front panel. Being my first project, I am very certain my logic is flawed, this is why I like posting here and getting feedback from
     You have many visa sessions that (hopefully) never change during the execution of the loops, so why woold you turn them into an array of 11 identical elements just to autoidex them out again at the next loop. Change the tunnels to no autoindexing and things would look cleaner. Why are these session controls inside the loop? Are you expect them to be changeable during loop execution or would that screw up the results?
    Wounld't it be easier to simply create an up&down ramp once and use a single FOR loop, autoindexing on the ramp? You have way too much duplicate code!!!
     If you don't want the second loop to run when the first one is ended prematurely with the stop button, put it in a case structure I tried a Case structure for the second For Loop. I couldn't find a way to change conditions that didn't affect the Vi's overall performance.
    Then show us what you tried! That should be trivial to implement. Why would a case structure affect performance? Makes no sense!
    Why would a case structure affect performance? Makes no sense! I used a boolean operator to change the state. When I used a false, it worked for that problem but shut down my Vi before the second For Loop. 
    Wounld't it be easier to simply create an up&down ramp once and use a single FOR loop, autoindexing on the ramp? You have way too much duplicate code!!!  I tried using one For Loop to begin with but because I had to ramp up, then ramp down, I couldn't figure out how to use just one. I needed an Add function for the ramp up and a Subtract function for the ramp down.
    Why are these session controls inside the loop? Are you expect them to be changeable during loop execution or would that screw up the results? No Sir, the values are not changed during operation. I did this because I wanted it to display the data on the front panel, during operation of the Vi. For display only.
     

  • For Loop in Struts ?(without Collections)

    Hi all,
    Pls tell me how can v use FOR LOOP IN JSP STRUTS without using scriplets and collections .
    suppose i want to display 20 times "hello world "in jsp .How can i display it using STRUTS as conventionally scriplets are not allowed in it.
    and Iterator is only for Collections .
    thanx

    TestBean.java
    * $Id: TestBean.java 54929 2004-10-16 16:38:42Z germuska $
    * Copyright 1999-2004 The Apache Software Foundation.
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    * http://www.apache.org/licenses/LICENSE-2.0
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    package org.apache.struts.webapp.exercise;
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    import java.util.Vector;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.util.LabelValueBean;
    * General purpose test bean for Struts custom tag tests.
    * @version $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
    public class TestBean extends ActionForm {
    // ------------------------------------------------------------- Properties
    * A collection property where the elements of the collection are
    * of type <code>LabelValueBean</code>.
    private Collection beanCollection = null;
    public Collection getBeanCollection() {
    if (beanCollection == null) {
    Vector entries = new Vector(10);
    entries.add(new LabelValueBean("Label 0", "Value 0"));
    entries.add(new LabelValueBean("Label 1", "Value 1"));
    entries.add(new LabelValueBean("Label 2", "Value 2"));
    entries.add(new LabelValueBean("Label 3", "Value 3"));
    entries.add(new LabelValueBean("Label 4", "Value 4"));
    entries.add(new LabelValueBean("Label 5", "Value 5"));
    entries.add(new LabelValueBean("Label 6", "Value 6"));
    entries.add(new LabelValueBean("Label 7", "Value 7"));
    entries.add(new LabelValueBean("Label 8", "Value 8"));
    entries.add(new LabelValueBean("Label 9", "Value 9"));
    beanCollection = entries;
    return (beanCollection);
    public void setBeanCollection(Collection beanCollection) {
    this.beanCollection = beanCollection;
    * A multiple-String SELECT element using a bean collection.
    private String[] beanCollectionSelect = { "Value 1", "Value 3",
    "Value 5" };
    public String[] getBeanCollectionSelect() {
    return (this.beanCollectionSelect);
    public void setBeanCollectionSelect(String beanCollectionSelect[]) {
    this.beanCollectionSelect = beanCollectionSelect;
    * A boolean property whose initial value is true.
    private boolean booleanProperty = true;
    public boolean getBooleanProperty() {
    return (booleanProperty);
    public void setBooleanProperty(boolean booleanProperty) {
    this.booleanProperty = booleanProperty;
    * A multiple-String SELECT element using a collection.
    private String[] collectionSelect = { "Value 2", "Value 4",
    "Value 6" };
    public String[] getCollectionSelect() {
    return (this.collectionSelect);
    public void setCollectionSelect(String collectionSelect[]) {
    this.collectionSelect = collectionSelect;
    * A double property.
    private double doubleProperty = 321.0;
    public double getDoubleProperty() {
    return (this.doubleProperty);
    public void setDoubleProperty(double doubleProperty) {
    this.doubleProperty = doubleProperty;
    * A boolean property whose initial value is false
    private boolean falseProperty = false;
    public boolean getFalseProperty() {
    return (falseProperty);
    public void setFalseProperty(boolean falseProperty) {
    this.falseProperty = falseProperty;
    * A float property.
    private float floatProperty = (float) 123.0;
    public float getFloatProperty() {
    return (this.floatProperty);
    public void setFloatProperty(float floatProperty) {
    this.floatProperty = floatProperty;
    * Integer arrays that are accessed as an array as well as indexed.
    private int intArray[] = { 0, 10, 20, 30, 40 };
    public int[] getIntArray() {
    return (this.intArray);
    public void setIntArray(int intArray[]) {
    this.intArray = intArray;
    private int intIndexed[] = { 0, 10, 20, 30, 40 };
    public int getIntIndexed(int index) {
    return (intIndexed[index]);
    public void setIntIndexed(int index, int value) {
    intIndexed[index] = value;
    private int intMultibox[] = new int[0];
    public int[] getIntMultibox() {
    return (this.intMultibox);
    public void setIntMultibox(int intMultibox[]) {
    this.intMultibox = intMultibox;
    * An integer property.
    private int intProperty = 123;
    public int getIntProperty() {
    return (this.intProperty);
    public void setIntProperty(int intProperty) {
    this.intProperty = intProperty;
    * A long property.
    private long longProperty = 321;
    public long getLongProperty() {
    return (this.longProperty);
    public void setLongProperty(long longProperty) {
    this.longProperty = longProperty;
    * A multiple-String SELECT element.
    private String[] multipleSelect = { "Multiple 3", "Multiple 5",
    "Multiple 7" };
    public String[] getMultipleSelect() {
    return (this.multipleSelect);
    public void setMultipleSelect(String multipleSelect[]) {
    this.multipleSelect = multipleSelect;
    * A nested reference to another test bean (populated as needed).
    private TestBean nested = null;
    public TestBean getNested() {
    if (nested == null)
    nested = new TestBean();
    return (nested);
    * A String property with an initial value of null.
    private String nullProperty = null;
    public String getNullProperty() {
    return (this.nullProperty);
    public void setNullProperty(String nullProperty) {
    this.nullProperty = nullProperty;
    * A short property.
    private short shortProperty = (short) 987;
    public short getShortProperty() {
    return (this.shortProperty);
    public void setShortProperty(short shortProperty) {
    this.shortProperty = shortProperty;
    * A single-String value for a SELECT element.
    private String singleSelect = "Single 5";
    public String getSingleSelect() {
    return (this.singleSelect);
    public void setSingleSelect(String singleSelect) {
    this.singleSelect = singleSelect;
    * String arrays that are accessed as an array as well as indexed.
    private String stringArray[] =
    { "String 0", "String 1", "String 2", "String 3", "String 4" };
    public String[] getStringArray() {
    return (this.stringArray);
    public void setStringArray(String stringArray[]) {
    this.stringArray = stringArray;
    private String stringIndexed[] =
    { "String 0", "String 1", "String 2", "String 3", "String 4" };
    public String getStringIndexed(int index) {
    return (stringIndexed[index]);
    public void setStringIndexed(int index, String value) {
    stringIndexed[index] = value;
    private String stringMultibox[] = new String[0];
    public String[] getStringMultibox() {
    return (this.stringMultibox);
    public void setStringMultibox(String stringMultibox[]) {
    this.stringMultibox = stringMultibox;
    * A String property.
    private String stringProperty = "This is a string";
    public String getStringProperty() {
    return (this.stringProperty);
    public void setStringProperty(String stringProperty) {
    this.stringProperty = stringProperty;
    * An empty String property.
    private String emptyStringProperty = "";
    public String getEmptyStringProperty() {
    return (this.emptyStringProperty);
    public void setEmptyStringProperty(String emptyStringProperty) {
    this.emptyStringProperty = emptyStringProperty;
    * A single-String value for a SELECT element based on resource strings.
    private String resourcesSelect = "Resources 2";
    public String getResourcesSelect() {
    return (this.resourcesSelect);
    public void setResourcesSelect(String resourcesSelect) {
    this.resourcesSelect = resourcesSelect;
    * A property that allows a null value but is still used in a SELECT.
    private String withNulls = null;
    public String getWithNulls() {
    return (this.withNulls);
    public void setWithNulls(String withNulls) {
    this.withNulls = withNulls;
    * A List property.
    private List listProperty = null;
    public List getListProperty() {
    if (listProperty == null) {
    listProperty = new ArrayList();
    listProperty.add("dummy");
    return listProperty;
    public void setListProperty(List listProperty) {
    this.listProperty = listProperty;
    * An empty List property.
    private List emptyListProperty = null;
    public List getEmptyListProperty() {
    if (emptyListProperty == null) {
    emptyListProperty = new ArrayList();
    return emptyListProperty;
    public void setEmptyListProperty(List emptyListProperty) {
    this.emptyListProperty = emptyListProperty;
    * A Map property.
    private Map mapProperty = null;
    public Map getMapProperty() {
    if (mapProperty == null) {
    mapProperty = new HashMap();
    mapProperty.put("dummy", "dummy");
    return mapProperty;
    public void setMapProperty(Map mapProperty) {
    this.mapProperty = mapProperty;
    * An empty Map property.
    private Map emptyMapProperty = null;
    public Map getEmptyMapProperty() {
    if (emptyMapProperty == null) {
    emptyMapProperty = new HashMap();
    return emptyMapProperty;
    public void setEmptyMapProperty(Map emptyMapProperty) {
    this.emptyMapProperty = emptyMapProperty;
    // --------------------------------------------------------- Public Methods
    * Reset the properties that will be received as input.
    public void reset(ActionMapping mapping, HttpServletRequest request) {
    booleanProperty = false;
    collectionSelect = new String[0];
    intMultibox = new int[0];
    multipleSelect = new String[0];
    stringMultibox = new String[0];
    if (nested != null)
    nested.reset(mapping, request);
    }

  • Can a waveform graph be used without for loop

    i would like to know if a waveform graph can be used without a for loop and if so, how? I tried using a while loop only, but the reading becomes too fast.
    can someone advise

    Dear nebb,
    first of all, graph is usually an offline plot of the acquired data but to use it as an online display u need to use build arrays in for/while loop which keeps on adding new points & plots in waveform graph.
    I am including a vi which incorporates a while loop in which by using build array, points keep on increasing & simultaneously they are plotted in the waveform graph.
    Using for or while loop, it has no concern with speed. it depends on the code inside the loop which makes them faster or slower.
    For making slow readings, you can put some delay inside while looping.
    Hope this works. YOur feedbacks are welcome.
    Best Regards,
    Nirmal Sharma
    India
    Attachments:
    waveform_graph_without_for_loop.vi ‏17 KB

  • Incorporate: For, and while loop,a nested pair for both,and to add graphics

    // I have done the class but
    need help one adding one while loop, one for loop, and a nested pair loops using for and while, and if posbile to add on a dynamite graphics. // i am doing this for a brithday present for my brother who is a java programer
    and would be happy to see his little brother make a java programe for him
    //class file
    import java.awt.*;
    public class ZZZCalculator
            private double amount;
            public ZZZCalculator (double x)
                    amount= x;
            public void addAmt (double inputNumber)
                    amount= amount +inputNumber;
            public void divideAmt (double inputNumber)
                    amount=amount/inputNumber;
            public void subtractAmt (double inputNumber)
                    amount=amount-inputNumber;
            public void multiplyAmt (double inputNumber)
                    amount=amount*inputNumber;
            public void display (Graphics g)
                    g.drawString (""+ amount, 150,100);
            public void setAmt(double x)
                    amount= x;
      // Pgm file
    import java.awt.*;
    import java.applet.Applet;
    import java.awt.event.*;
    public class ZZZCalc extends Applet implements ActionListener {
            ZZZCalculator henrietta;
            TextField amtPlace;
            Button adder;
            Button divide;
            Button subtract;
            Button multiply;            
            public void init()
                    henrietta=new ZZZCalculator(0.0);
                    amtPlace=new TextField(10);
                    amtPlace.addActionListener(this);
                    add(amtPlace);
                    adder=new Button ("+");
                    adder.addActionListener(this);
                    add(adder);
                    divide=new Button ("/");
                    divide.addActionListener(this);
                    add(divide);
                    subtract=new Button ("-");
                    subtract.addActionListener(this);
                    add(subtract);
                    multiply=new Button ("*");
                    multiply.addActionListener(this);
                    add(multiply);
            public void paint (Graphics g)
                    g.drawString("amount:", 100,100);
                    henrietta.display(g);
            public void actionPerformed(ActionEvent e)
                    if (e. getSource()==amtPlace)
                    double amt= Double.parseDouble (amtPlace.getText());
                    henrietta.setAmt(amt);
                    repaint();
                    if(e.getSource()==adder)
                    double amt= Double.parseDouble (amtPlace.getText());
                    henrietta.addAmt(amt);
                    repaint();
                    if(e.getSource()==divide)
                    double amt= Double.parseDouble (amtPlace.getText());
                    henrietta.divideAmt(amt);
                    repaint();
                    if(e.getSource()==subtract)
                    double amt= Double.parseDouble (amtPlace.getText());
                    henrietta.subtractAmt(amt);
                    repaint();
                    if(e.getSource()==multiply)
                    double amt= Double.parseDouble (amtPlace.getText());
                    henrietta. multiplyAmt(amt);
                   repaint();
    //thank you for the help
    i have just started working on java and this is my frist program i am working on and any help i can get would inprove my understanding of java.
    Thank you very much for you help

    hey there... this is Rebecca
    try this somewhere in the prog.
    n = Math.pow(x,y)
    where n is an int you declare...
    and x and y are the numbers... as in
    n = 10^3
    where 10 = x and 3 = y

  • Issues with nested for loops - saving images from a camera

    Hi all,
    I've written a vi. to capture a specific number of images ('Image No') and save these images, outputted to a folder of my choice.  Each image is identified sequentially.  However, I wish to do a number of iterations ('Run') of this capture sequence, such that the filename of each image would be 'Filename (Run)_(Image No).png', e.g. run 5, image 10 would be 'Filename 5_10.png'.  I have tried a nested for loop for this but I receive an error 'Asynchronous I/O operation in progress' (I've attached a printscreen).
    Can anyone assist me in solving this problem? I preiously posted this in machine Vision but got no response (http://forums.ni.com/t5/Machine-Vision/Capturing-image-sequences-issues-with-nested-for-loops/m-p/19...).  Please find attached my vi.
    Kindest regards and thanks,
    Miika
    Solved!
    Go to Solution.
    Attachments:
    Labview problem.jpg ‏3841 KB
    Image sequence save to file.vi ‏48 KB

    Miika,
    the problem is not the filenam, but the name of the folder (AHHHHH!). You try to create the same folder in the outer for loop over and over again.... (it is the error message above the '======', not below )
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • For Loop in Struts ?(without  Container)

    Hi all,
    Pls tell me how can v use for loop in JSP struts without using scriplets and container .
    suppose i want to display 20 times "hello world "in jsp .How can i display it using STRUTS as conventionally scriplets are not allowed in it.
    and Iterator is only for Container .
    thanx

    Hi all,
    Pls tell me how can v use for loop in JSP struts without using scriplets and container .
    suppose i want to display 20 times "hello world "in jsp .How can i display it using STRUTS as conventionally scriplets are not allowed in it.
    and Iterator is only for Container .
    thanx

  • Nested for loop in Xquery

    hi all,
    I need to implement nested for loop in Xquery, but not able to do. Please help.
    Thanks in advance..
    Rajan

    Nested for loops are simple in Xquery. Here is a very basic example:
    Input:
    <root>
    <FirstLevel>
         <SecondLevel>
              <Value>1</Value>
         </SecondLevel>
         <SecondLevel>
              <Value>2</Value>
         </SecondLevel>
         <SecondLevel>
              <Value>3</Value>
         </SecondLevel>
    </FirstLevel>
    <FirstLevel>
         <SecondLevel>
              <Value>4</Value>
         </SecondLevel>
         <SecondLevel>
              <Value>5</Value>
         </SecondLevel>
         <SecondLevel>
              <Value>6</Value>
         </SecondLevel>
    </FirstLevel>
    </root>XQuery:
    declare namespace ns0 = "http://temp.uri/OTM";
    declare function ns0:NestedForLoop($input as element(*))    as element(*)
         <ns0:Output>
              for $firstLevel in $input/FirstLevel
              for $secondLevel in $firstLevel/SecondLevel
                    return
                  <element>{ $secondLevel/Value/text() }</element>
         </ns0:Output>
    declare variable $input aselement(*) external;
    ns0:NestedForLoop($input)Output:
    <otm:Output       xmlns:otm="http://temp.uri/OTM">
         <element>1</element>
         <element>2</element>
         <element>3</element>
         <element>4</element>
         <element>5</element>
         <element>6</element>
    </otm:Output>Of course, this case is very simple and usually you wont even loop for this you can use a simple XPath like $input/FirstLevel/SecondLevel/Value/text() to achieve the above result. So, If you are having problems in a specific case of nested for loops, please post the input and output here and we can help out.

Maybe you are looking for