Step in for loop

Hi all,
Is it possible in a for loop to iterate with steps ? For example :
for i in 1..500 loop , but I want the index i to grow five by five ! Is it possible ? Is there a keyword to use to accomplish this ? My database is Oracle10g !
Thank you !

Directly you can't control the iterator of FOR LOOP (no change possible, no INCREMENT clause).
You can use another index to control iterations::
SQL> declare
  2   j integer := 1;
  3  begin
  4   for i in 1..5 loop
  5     j := i*5;
  6     dbms_output.put_line('i=' || i || ', j=' ||j);
  7   end loop;
  8  end;
  9  /
i=1, j=5
i=2, j=10
i=3, j=15
i=4, j=20
i=5, j=25
PL/SQL procedure successfully completed.
SQL> declare
  2   i integer := 1;
  3  begin
  4   while ( i < 25 ) loop
  5     dbms_output.put_line('i=' || i );
  6     i := i + 5;
  7   end loop;
  8  end;
  9  /
i=1
i=6
i=11
i=16
i=21
PL/SQL procedure successfully completed.
SQL>/* Just for fun */
SQL> begin
  2   for v in (select rownum*5 as i from (select 1 from dual connect by level<6)) loop
  3      dbms_output.put_line('i=' || v.i );
  4   end loop;
  5  end;
  6  /
i=5
i=10
i=15
i=20
i=25
PL/SQL procedure successfully completed.Rgds.

Similar Messages

  • For loop pause till event occurs

    I'd like to know if it's possible pausing for loop in a fixed step till en event occurs.
    I need to use for loop index to indexing some vector's data, but the steps in for loop must be exectuted only if  precise condition occurs.
    thank you very much for possible solutions
    Francesco

    Without seeing any code, it is hard to recommend what to do.
    You probably want a State Machine architecture so that you can stay in a certain state of a while loop, then move on to the next step (state) when your condition is met.
    You could also use event structures.  You could also use notifiers or occurrences to hold the execution of your loop until the notifier is written to or occurrence executed in a parallel loop of your code.

  • PNA Guided Calibration: GPIB write error in for loop

    Hi,
    I have a LabVIEW program that creates a Guided Power Calibration on a PNA.
    After initializing everything properly, I have a for loop that loops through all the manual steps that the user must go through (ex: Connect Channel A of Power meter to Port 1" "Connect male Short to port 1" etc).
    The problem is, the program displays an error at the first command: sens:corr:coll:guid:acq STAN1
    I says there is an error with the GPIB Write function.
    Here are the commands I send:
    SYSTRES
    DISPlay:WINDow2TATE ON
    CALCulate2ARameterEFine:EXT 'MyMeas',S21
    DISPlay:WINDow2:TRACe1:FEED 'MyMeas'
    CALC1AREL 'CH1_S11_1'
    SENS:FREQTAR 2e9
    SENS:FREQTOP 4e9
    SENSWEOINTS 3
    SENS:CORR:COLL:GUID:CONNORT1 'APC 2.4 male'
    SENS:CORR:COLL:GUID:CONNORT2 'APC 2.4 male'
    SENS:CORR:COLL:GUID:CKITORT1 '85056D'
    SENS:CORR:COLL:GUID:CKITORT2 '85056D' 
    SENSe:CORRection:COLLect:GUIDedSENsor1 ON
    SYSTem:COMMunicateSENsor gpib, "13"   
    SENSe:CORRection:COLLect:GUIDedSENsor1OWer:LEVel -20
    sens:corr:coll:guid:init
    sens:corr:coll:guid:steps?
    //for loop from 1 to total_number_of_steps
    sens:corr:coll:guid:desc? <step#>
    sens:corr:coll:guid:acq STAN<step#>
    The program quits right at the first step, when I send "sens:corr:coll:guid:acq STAN1", although the command is executed.
    Also, the VBScript with the same commands works fine.
    Can anybody help me? I've been stuck for a while now.
    I attached the block diagram of the for loop.
    Thanks in advance,
    Nicolas
    Attachments:
    Guided cal for loop.vi ‏27 KB

    Sending SENS:corr:coll:guid:acq STAN1 \n gives me a different error: -101 "Invalid Character".
    From my different attempts at figuring this out, I thought the problem would come from LabVIEW, since the vbscript with the same commands works on the PNA.
    I also modified the for loop because I thought each iteration should be linked to the previous one with the error wire (see attached).
    I still have the same issue, only the first iteration is executed, then the program quits.
    Attachments:
    Guided cal for loop.vi ‏28 KB

  • How do i configure a FOR loop to have the behavior of the step Loop Type: Pass/Fail count?

    Hello,
    I'm using the Pass/Fail count set to one Pass to capture an event generated by my DUT.  I originally used a numerical compare step with the Looping type of Pass/Fail count to accomplish this.  Unfortunately the implementation changed and now I need to execute a few steps that can not be combined within one code module as before. Nor can these steps be put into a subroutine.  One of the steps executes a .NET asembly and I haven't figured out how to pass the reference to the subroutine.  When the subroutine is intered the reference is lost and the methode does not execute correctly.
    I have an evaluation function the exits the loop when the expected conditions are met. Everything works except for the Overall Pass/Fail result of the For loop.  If the loop exits due to the first numerical compare test passing, I want the loop overall execution to report as "Passed".  If the loop reaches it's predetermined number of iterations, the overall result needs to report as "Failed".  It would also be nice to have the radio button functionality of "Record Result of Each iteration".  Some conditions require a wait over a minute for the event to occur and I don't want to generate needless data for the report.
    Currently I get the pass/fail status for each For loop iteration, but only "Done" for each loop iteration.  I don't want the initial few failures to cause the test to fail.
    Does anyone know how to do this? Suggestions?
    Thanks,

    I have 2 steps in the loop that can not be combined into one step. This forces me to implement the behavior in some form of loop.  A While Loop could be an option.  I would need to pass the Step.Result.Status from the Multiple Numerical compaire step to the condition of the While Loop.  I tried to use the Step.TS.ID without success.  Some form of reference to the numerical compare step would be needed. I'm using a For Loop as I do want to limit the number of iterations of the loop.  In the case where the loop iterations are reached, the event I am trying to detect did not occur at the correct time and a failure needs to be reported.
    I came up with something based on my comments in the second post:
    1) To start with I configured a Locals.ForLoop_5 variable.  This is used to set the limit on the loop iterations and for comparison after the loop has finished executing. More on that later.
    2) The first step inside the loop invokes a method within a .NET assembly that has been packed in a DLL This method gets the required data from the DUT and stores it to a text file.
    3) The next step is the Multiple Numeric Limit step.  This step invokes a VI that extracts the data from the text file.  This step has been customized in several ways.
      i)  In Run Options, the Results Recording Option was disabled.  This prevents recording of "Failed" while the loop executes when waiting for the event to happen.
      ii) In Run Options, the Step Failure Causes Sequence Failure is unchecked.  Same reasoning as i)  These steps are not true failures.
      iii) A Post Action is configured to go to the nexxt step after the For Loop End step On Condition True with the logic of Step.Result.Status == "Passed".  This causes the loop to exit when the first "Passed" is encountered which corrolates with the event I'm trying to detect. On Conditon Fail remains set to default.
    4)  The step after the For Loop End is an expression step with everythin set to default except for the Status Expression logic set to: Locals.Loopindex < Locals.ForLoop_5 ? (Step.Result.Status = "Passed") : (Step.Result.Status = "Failed"). This step performs the overall Pass/Fail reporting for the For Loop.  If the number of loop iterations is less than the maximum it could have only gotten there by the previous logic triggered by the numerical compare passing, therefore "Passed".  If the loop index has reached the limit, then the event was not detected, therefore Failed.
    I have tested this work around with success, it just a pain to now have to implement this on my 40 some odd For Loops.
    If there is a better way, I'd still like to hear it.

  • Teststand XML Translator For LOOP Step

    HI, I'm trying to write an XML translator usinc the C++ example. So far I made work "if" , "while" , "end" and i'm trying to make the "for" loop working as well but i have a issue when i insert the dataProperty.
    The XML code i wrote id the following :
    <Data dataProperty="InitializationExpr" type = "string"> <Value>"Locals = 0"</Value> </Data><Data dataProperty="ConditionExpr" type = "string"> <Value>"Locals &lt; 10"</Value> </Data><Data dataProperty="IncrementExpr" type = "string"> <Value>"Locals += 1"</Value> </Data> 
    so the issie is that is i use the " " it works in the PropertyBrowser window but not in the For Loop window and if i dont use the " " is the opposite.
    I even tried to change the property CustomLoop followinf the same syntax but it doesnt work:
    <Data dataProperty="CustomLoop" type = "bool"> <Value>true</Value> </Data> 
    can anybosy help me with this?
    thank you
    Luca

    If I use Locals.X == 10 it gives me an error in the Number of Loop field in the For Loop window. What i really would like to know is how to set the properties for every step because beside few of them that i can set with dataProperty="ConditionExpr" or dataProperty="TitleExpr" i dont know how to set the other ones.
    For istance if i want to have a Sequence Call (I already wrote code so to have more then one Sequence) in a Sequence that calls another one i can have code like this:
    <Sequence name="MainSequence">
    <Step name="CallSeq2" type="SeqCall">
    </Step>
    </Sequence>
    <Sequence name="MainSequence2">
    </Sequence>
    now I dont know how to pass values to the step so to fill the File Pathname and Sequence fields in the Module window can I use dataProperty? and in cas I can what is the Sintax?
    thank you
    Luca

  • Executing each step of a for loop only on a VISA read output

    Hi,
    I would like to give multiple steps to a motor/controller to exectue, but I keep getting a "command overflow" error.  Therefore, I am trying to tell the for loop only to execute when the VISA Read receives an output. I have included the .vi I have written so far. For example, the code /1P1000p66R tells the controller to move motor "1" forward 1000 steps and then to output the number "66" when the motor has moved 1000 steps. My input to the "table control" is, e.g., 3 commands:
    /1P1000p66R
    /1D1000p66R
    /1D5000p66R
    How do I get the code to send each of those commands only when the number "66" is sent back to the program so that I don't get the command overflow error? Also, if anyone has a better way to control the motor to do multiple steps, let me know. I'm pretty new to all of this. 
    Thanks.
    Attachments:
    Motor Controller (Sub VI 2).vi ‏26 KB

    Rather than using a table control, I would just use a string array.
    Set your serial port parameters before the loop.  Close the serial port after the loop.
    Your controls don't have any real data in them saved as default, so I'm confused a bit as to what your are trying to do.  Why do you have a numeric control with the number 0 establishing the loop iterations?
    Instead of a For Loop, use a while loop.  Set the 1-D array of strings to be autoindexing at the input tunnel.  Write the command (why you have everything wrapped in a case statement with a true constant makes no sense.  Do a VISA read.  If the response has the 66 (you'll have to figure out how to parse it out), all is good.  If it does not have the 66, or the number of loop iterations equals the number of commands in the array -1 , then end the loop.
    Message Edited by Ravens Fan on 05-20-2009 09:31 PM
    Attachments:
    MotorController(SubVI).vi ‏18 KB
    Motor%20Controller%20(Sub%20VI%202)[1]_BD.png ‏8 KB

  • For loop stop in sub vi from main vi?

    Hi! I want to control from my main vi a sub vi consisting of a stepped sine function generator. This sub vi has a for loop. The problem is that I want to have the option of terminating the loop in the sub vi from the main vi. I tryed using global variables or an event stucture. The problem is that, in both cases, the "stop" variable in my main vi is only updated after the loop terminates in the sub vi. Can anyone please help me? Thank you very much.
    Best regards,
    Diogo Montalvão (Lisbon, Portugal)

    hong2011 wrote:
    I found this thread very helpful. May I ask one thing - what is the purpose of the Occurrence?? If I try it without implementing the Occurrence (neither in main VI or subVI), labview crashes when the subVI completes its task or is stopped from the mainVI.
    A lot of things changed in the last 6 years, so this thread is a bit stale and there are a few other ways to do it. (For example we can have a FOR loop with a conditional terminal).
    You don't provide enough information to answer your question why it crashes. It would be more interesting to know what you are "using" and not what you are "not using". This is not something we can guess by elimination.
    LabVIEW should never crash, so please show us the code that crashes so NI can fix it. What LabVIEW version are you using?
    LabVIEW Champion . Do more with less code and in less time .

  • For loop- seems to be just going to last value

    Hi guys, carrying on from the thread I created yesterday I have managed to get the socket working between my server and my client, but I am having an issue when re-constructing a string that is being sent from the client to the server. I am talking about the for loop in line 151, which seems to just going straight to the last value of the for loop and thus the board isn't being reconstructed properly.
    I'm including both the server and client code which just needs to compiled (host is set to localhost on port 4500) and you will see what I mean after inputting a move from the client. Can anyone spot the problem?
    Server code
    import java.io.*;
    import java.net.*;
    import javax.swing.JOptionPane;
    class Server
         public static void main (String []args) throws IOException
              try
                   Server();     
              catch (IOException ex)
         public static void Server () throws IOException
              ServerSocket serverSocket=null;
              int portNo=4500;
              System.out.println("Starting");
              try
                   serverSocket=new ServerSocket(portNo);     
              catch (IOException ex)
                   System.err.println("Could not create socket on port" +portNo);
                   System.exit(1);
              System.out.println("Socket listening");
              Socket clientSocket=null;
              try
                   clientSocket=serverSocket.accept();
              catch (IOException ex)
                   System.out.println("Accept failed");
                   System.exit(1);
              PrintWriter out= new PrintWriter(clientSocket.getOutputStream(), true);
              BufferedReader in=new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
              //coordinates
              String coordinates[] [] = new String [8] [8];
              for (int i=0;i<8;i++)
                   for (int j=0;j<8;j++)
                        if ((i%2!=0)&&(j%2!=0))
                             coordinates[i] [j]="#";
                        else if ((i%2!=0)&&(j%2==0))
                             coordinates[i] [j]=" ";
                        else if ((i%2==0)&&(j%2!=0))
                             coordinates[i] [j]=" ";
                        else
                             coordinates[i] [j]="#";
              coordinates[0][0]="R";
              coordinates[0][1]="N";
              coordinates[0][2]="B";
              coordinates[0][3]="Q";
              coordinates[0][4]="K";
              coordinates[0][5]="B";
              coordinates[0][6]="N";
              coordinates[0][7]="R";
              for (int i=0;i<8;i++)
                   coordinates[1]="P";
              coordinates[7][0]="r";
              coordinates[7][1]="n";
              coordinates[7][2]="b";
              coordinates[7][3]="q";
              coordinates[7][4]="k";
              coordinates[7][5]="b";
              coordinates[7][6]="n";
              coordinates[7][7]="r";
              for (int i=0;i<8;i++)
                   coordinates[6][i]="p";
              Board board1=new Board(coordinates);
              boolean gameStart=true;
              String coord="";
              String originX="";
              String originY="";
              String destinationX="";
              String destinationY;
              while (gameStart)
                   System.out.println("trying to read from client");
                   String input="";
                   try
                        input=in.readLine();     
                        System.out.println(input);
                   catch (IOException ex)
                        System.out.println("Read failed");
                        System.exit(1);
                   originX=input.substring(65);
                   originY=input.substring(66);     
                   destinationX=input.substring(67);
                   destinationY=input.substring(68);
                   coord=input.substring(0,64);
                   System.out.println(coord);
                   for (int p=0;p<64;p++)
                        System.out.println(p);
                        for (int i=0;i<8;i++)
                             for (int j=0;j<8;j++)
                                  coordinates [i] [j]=coord.substring(p);
                                  if (i==(Integer.parseInt(originX))&&(j==(Integer.parseInt(originY))))
                                       String piece="";
                                       piece=coordinates [i] [j];
                                       if ((i%2!=0)&&(j%2!=0))
                                            coordinates[i] [j]="#";
                                       else if ((i%2!=0)&&(j%2==0))
                                            coordinates[i] [j]=" ";
                                       else if ((i%2==0)&&(j%2!=0))
                                            coordinates[i] [j]=" ";
                                       else
                                            coordinates[i] [j]="#";
                                       for (int s=0;s<8;s++)
                                            for (int t=0;t<8;t++)
                                                 if (s==(Integer.parseInt(destinationX))&&(t==(Integer.parseInt(destinationY))))
                                                      coordinates [s] [t]=piece;
                   board1.printBoard(coordinates);
              out.close();
              in.close();     
              clientSocket.close();
              serverSocket.close();          
    class Board
         boolean gameStart=true;
         public Board()
         public Board(String [] [] coordinates)
              printBoard(coordinates);
         String [] [] getCoOrdinates(String [] [] coordinates)
              return coordinates;
         public static void update (String coordinates [] [])
              printBoard(coordinates);
         public static void printBoard(String coordinates[] [])
              for (int i=0;i<8;i++)
                   for (int j=0;j<8;j++)
                        System.out.print(coordinates[i][j]);
                   System.out.println();
    }Client code:import java.io.*;
    import java.net.*;
    import javax.swing.JOptionPane;
    class Client
         public static void main (String [] args) throws IOException
              Socket socket=null;
              PrintWriter out=null;
              BufferedReader in=null;
              String serverLocation="localhost";
              int portNo=4500;
              System.out.println("Starting");
              try
                   socket= new Socket (serverLocation,portNo);
                   out= new PrintWriter(socket.getOutputStream(),true);
                   in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
              catch (UnknownHostException ex)
                   System.out.println("Cannot find" + serverLocation);
                   System.exit(1);     
              catch (IOException ex1)
                   System.out.println("IO problem");
                   System.exit(1);
              System.out.println("Connected");
              //coordinates
              String coordinates[] [] = new String [8] [8];
              for (int i=0;i<8;i++)
                   for (int j=0;j<8;j++)
                        if ((i%2!=0)&&(j%2!=0))
                             coordinates[i] [j]="#";
                        else if ((i%2!=0)&&(j%2==0))
                             coordinates[i] [j]=" ";
                        else if ((i%2==0)&&(j%2!=0))
                             coordinates[i] [j]=" ";
                        else
                             coordinates[i] [j]="#";
              coordinates[0][0]="R";
              coordinates[0][1]="N";
              coordinates[0][2]="B";
              coordinates[0][3]="Q";
              coordinates[0][4]="K";
              coordinates[0][5]="B";
              coordinates[0][6]="N";
              coordinates[0][7]="R";
              for (int i=0;i<8;i++)
                   coordinates[1][i]="P";
              coordinates[7][0]="r";
              coordinates[7][1]="n";
              coordinates[7][2]="b";
              coordinates[7][3]="q";
              coordinates[7][4]="k";
              coordinates[7][5]="b";
              coordinates[7][6]="n";
              coordinates[7][7]="r";
              for (int i=0;i<8;i++)
                   coordinates[6][i]="p";
              Board board1=new Board(coordinates);
              boolean gameStart=true;
              String coord="";
              while (gameStart)
                   String originMove=JOptionPane.showInputDialog(null,"Client Origin Move","Enter in origin of piece",JOptionPane.QUESTION_MESSAGE);
                   String destinationMove=JOptionPane.showInputDialog(null,"Client Destination Move","Enter in destination of piece",JOptionPane.QUESTION_MESSAGE);
                   for (int i=0;i<8;i++)
                        for (int j=0;j<8;j++)
                             coord=coord+coordinates[i][j];
                   System.out.println(coord);
                   out.println(coord+originMove+destinationMove);
                   System.out.println("passed");
              out.close();
              in.close();
              socket.close();
    class Board
         boolean gameStart=true;
         public Board()
         public Board(String [] [] coordinates)
              printBoard(coordinates);
         String [] [] getCoOrdinates(String [] [] coordinates)
              return coordinates;
         public static void update (String coordinates [] [])
              printBoard(coordinates);
         public static void printBoard(String coordinates[] [])
              for (int i=0;i<8;i++)
                   for (int j=0;j<8;j++)
                        System.out.print(coordinates[i][j]);
                   System.out.println();
    }Cheers,
    Ben                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    jverd wrote:
    p595659 wrote:
    1) I don't think that even compiles. Since you're catching IOException, your throws clause is bogus--that method can never throw IOE.I have removed the try and catch statements in the main method. I cannot, however get rid of the throws IOException in the main method other my program won't compile.Right. Don't catch it, since you're not handling it. Just declare that it throws it.
    Indeed, this is what I have done :)
    >
    3) Don't name methods the same as your class name.See answer to 4.
    4) Start method names with lowercase letters.
    try
    serverSocket=new ServerSocket(portNo);     
    catch (IOException ex)
    System.err.println("Could not create socket on port" +portNo);
    System.exit(1);
    ServerSocket is a part of the java.net package. I am just creating an instance of it. http://java.sun.com/j2se/1.4.2/docs/api/java/net/ServerSocket.html
    I don't know what you're talking about. You had a class named Server and a method named Server. That's confusing.Changed- I didn't spot it, so I have named it startServer now.
    >
    5) There's almost no point to ever calling System.exit. Here, again, since you're not
    actually handling the exception, don't bother catcing it.Sorry, but this was how I was taught when I started java. My understanding is that System.exit properly terminated applications so this freed up memory so it's abit of a habit of mine, is this wrong to do in this instance?Calling it in response to an exception is wrong. It's not that method's job to decide to shut down the VM. Just let the exception bubble up (or else handle it properly). You do not need to call System.exit to free up memory. It's freed up automatically when the VM exits. The OS takes care of that, without any help from you.Removed- thanks for clearing that up for me :)
    JacobsB wrote:
    line 151 of the server code or client code?Line 151 of my server code. My client is working fine up to this step of the programming I have done- it's just the server part I'm having issues with. You can compile and run the client fine- you can compile the server but as explained in the original post, I'm having a logical error when redrawing the board when it gets the 68 charecter string from the client (first 64 charecters are for the board, then the original position (x and y respectively), followed up the new position (x and y respectively again).
    I'm including an updated version of the code, after all the comments above so we have an updated version for trying to solve the problem I'm having. The client code does not need to be updated as it has not changed yet, so you can use the code in the original post.
    import java.io.*;
    import java.net.*;
    import javax.swing.JOptionPane;
    class Server
         public static void main (String []args) throws IOException
              startServer();     
         public static void startServer () throws IOException
              ServerSocket serverSocket=null;
              int portNo=4500;
              System.out.println("Starting");
              try
                   serverSocket=new ServerSocket(portNo);     
              catch (IOException ex)
                   System.err.println("Could not create socket on port" +portNo);
                   ex.printStackTrace();
              System.out.println("Socket listening");
              Socket clientSocket=null;
              try
                   clientSocket=serverSocket.accept();
              catch (IOException ex)
                   System.out.println("Accept failed");
                   ex.printStackTrace();
              PrintWriter out= new PrintWriter(clientSocket.getOutputStream(), true);
              BufferedReader in=new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
              //coordinates
              String coordinates[] [] = new String [8] [8];
              for (int i=0;i<8;i++)
                   for (int j=0;j<8;j++)
                        if ((i%2!=0)&&(j%2!=0))
                             coordinates[i] [j]="#";
                        else if ((i%2!=0)&&(j%2==0))
                             coordinates[i] [j]=" ";
                        else if ((i%2==0)&&(j%2!=0))
                             coordinates[i] [j]=" ";
                        else
                             coordinates[i] [j]="#";
              coordinates[0][0]="R";
              coordinates[0][1]="N";
              coordinates[0][2]="B";
              coordinates[0][3]="Q";
              coordinates[0][4]="K";
              coordinates[0][5]="B";
              coordinates[0][6]="N";
              coordinates[0][7]="R";
              for (int i=0;i<8;i++)
                   coordinates[1]="P";
              coordinates[7][0]="r";
              coordinates[7][1]="n";
              coordinates[7][2]="b";
              coordinates[7][3]="q";
              coordinates[7][4]="k";
              coordinates[7][5]="b";
              coordinates[7][6]="n";
              coordinates[7][7]="r";
              for (int i=0;i<8;i++)
                   coordinates[6][i]="p";
              Board board1=new Board(coordinates);
              boolean gameStart=true;
              String coord="";
              String originX="";
              String originY="";
              String destinationX="";
              String destinationY;
              while (gameStart)
                   System.out.println("trying to read from client");
                   String input="";
                   try
                        input=in.readLine();     
                        System.out.println(input);
                   catch (IOException ex)
                        System.out.println("Read failed");
                        ex.printStackTrace();
                   coord=input.substring(0,64);                    
                   originX=input.substring(64,65);
                   originY=input.substring(65,66);     
                   destinationX=input.substring(66,67);
                   destinationY=input.substring(67,68);
                   System.out.println(coord);
                   for (int p=0;p<64;p++)
                        System.out.println(p);
                        for (int i=0;i<8;i++)
                             for (int j=0;j<8;j++)
                                  coordinates [i] [j]=coord.substring(p);
                                  if (i==Integer.parseInt(originX)&&(j==(Integer.parseInt(originY))))
                                       String piece="";
                                       piece=coordinates [i] [j];
                                       if ((i%2!=0)&&(j%2!=0))
                                            coordinates[i] [j]="#";
                                       else if ((i%2!=0)&&(j%2==0))
                                            coordinates[i] [j]=" ";
                                       else if ((i%2==0)&&(j%2!=0))
                                            coordinates[i] [j]=" ";
                                       else
                                            coordinates[i] [j]="#";
                                       for (int s=0;s<8;s++)
                                            for (int t=0;t<8;t++)
                                                 if (s==(Integer.parseInt(destinationX))&&(t==(Integer.parseInt(destinationY))))
                                                      coordinates [s] [t]=piece;
                   board1.printBoard(coordinates);
              out.close();
              in.close();     
              clientSocket.close();
              serverSocket.close();          
    class Board
         boolean gameStart=true;
         public Board()
         public Board(String [] [] coordinates)
              printBoard(coordinates);
         String [] [] getCoOrdinates(String [] [] coordinates)
              return coordinates;
         public static void update (String coordinates [] [])
              printBoard(coordinates);
         public static void printBoard(String coordinates[] [])
              for (int i=0;i<8;i++)
                   for (int j=0;j<8;j++)
                        System.out.print(coordinates[i][j]);          
                   System.out.println();
    }Ben                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to change chords & keys for loops?

    Hey, guys! I'm a total newbie, so I was hoping someone could give me "step-by-step" instructions for how to do this.... I am creating a song using one of the blue acoustic guitar loops in Logic Pro 9 & I have the option to "Play in" any chord/key imaginable when I am listening to the various loops... However, when I drag the loop over to the work area, it reverts back to the original key & I have no idea how to change it to the preferred key. I want to use this same loop throughout the song, but I need to be able to change the key several times in order to create my own chord progressions.... Any idea how I can make this happen? Thanks!!!!

    May I dare to tell you the magic four letters?
    But to give you a hint: learn how to configure global tracks, activate the chord track and look if you find the epic answer there
    Fox

  • How do i sweep two voltage at the same time by using for loop ?

    Hello, Can anyone help me on this topic ?
    My problem is to sweep Vds and Vgs as same time vs Id in MOSFET by using for loop. I also use the Agilent power supply source. Let me tell a litle bit about what i'm doing. For different value of Vds, i will get Vgs vs Id curve. (The x axis is Vgs, the y-axis is Id).
    I started to create two for-loop, the inner to sweep Vgs, and the outer one to sweep Vds. My problem is don't know how to connect all the wire in  the for loop.
    In the for loop i saw N, i icon. Suppose I have the two variable for Vgs such as Vgs start and Vgs_stop. Should the Vgs_start( or Vgs_stop) be connected to N or leave it in the for_loop ?
     for example: I want to sweep Vgs from 0(for Vgs_start)  to  5(Vgs_strop) V, and the step increment is .5V how do i connect these variables in the for loop ?
    Thank you for your time
    Ti Nguyen

    It is easier to use a while loop.  Dennis beat me to the punch.  Here is my solution:
    You can remove the flat sequence structure if you use Error In and Error Out to ensure the execution flow will occur in the proper order.  Be sure to include the delay time in the loop so that your vi doesn't hog all the CPU time.
    Message Edited by tbob on 10-17-2005 01:00 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    RampVoltage.PNG ‏8 KB

  • Can I exit a FOR loop before it has completed its iterations?

    Or is there a way to easily slave a while loop to an array input? I essentially need to search an array for a specific entry. Non of the built in VI's will search the array the way I need to do it. I tried wiring the array to a while loop and searching each element, but if the match is never found, the while loop never returns. Is there a setting on a while loop to force it to return if an input array completes?
    The For loop will work, but it forces me to step through the entire array each time and I have to play games to ignore values after I have found and set the one I need.
    Thanks for any help
    Chris

    Hello –
    I am attaching a very simple example program to show what Alberto and Dennis explained (or at least what I understood their approach would be, please apologize if I misunderstood).
    Another option is to use the Search 1D Array function, located in the Functions >> All Functions >> Array subpalette.
    Hope this helps.
    SVences
    Applications Engineer
    National Instruments
    Attachments:
    Example.vi ‏29 KB

  • For loop issue and error exception

    I am finishing up a program and having a few issues....I can send my instructions so it may seem easier to what I want...the first issue deals with the for loop for the 2nd for loop in the actionperformed when i click on go it does not change any of the boxes to yellow
    Also when I check for errors it does not check with the code I have...I know it says on the instructions to use try\catch but I am just going to use if statements because I am not very familar with the try\catch and will accept some points takin off...any help with this by tonight id really appreciate it as long as noone is too busy...Thanks
    instructions:
    This will incorporate arrays, for loops, and Frames all in one.
    Create a panel containing an array of 16 TextArea components that change color to correspond with the start, stop, and step values entered by the user. Perform the following tasks to create the Checkerboard Array application shown below. When the user enters the start, stop, and step fields and then clicks the Go button, the results are also shown below.
    1.     Call your application Checkerboard.java
    2.     You will need the following variables� declare them as private:
    a.     16 component TextArea array
    b.     a Panel to hold the array
    c.     3 TextField components with length of 10
    d.     3 int variables to receive the start, stop, and step values
    e.     3 Labels to display the words Start, Stop, and Step
    f.     a Go button
    g.     a Clear button
    h.     a Panel to hold the 3 TextFields, 3 Labels, and the 2 Buttons
    3.     Create a constructor method to:
    a.     construct each of the components declared above and initializes the start, stop, and step variables to zero (when constructing the TextArea components, use the following parameters: null, 3, 5, 3)
    b.     set the Frame layout to BorderLayout
    c.     write a for loop to loop the array and set each of the 16 TextArea components in that array so they cannot be edited. In the same loop, set each of the TextArea components text to be 1 more than the index number. Also in this same loop, set the background of each of the TextArea components to white.
    d.     set the Panel for the TextArea components to GridLayout with 4 rows, 4 columns, and both gaps set to 10
    e.     set the Panel for the TextFields, Labels, and button to GridLayout with 3 rows, 3 columns, and both gaps set to 5
    f.     add the components to their respective Panels
    g.     make the buttons clickable
    h.     place the Panels in the Frame� put one in the NORTH and one in the CENTER
    i.     Enter the addWindowListener() method described in the chapter� this is the method that overrides the click of the X so it terminates the application
    4.     In your actionPerformed() method:
    a.     convert the data in your TextFields to int and store them in the variables declared above
    b.     write a loop that goes through the array setting every background color to blue
    c.     write another loop that�s based on the user inputs. Each time the loop is executed, change the background color to yellow (so� start your loop at the user�s specified starting condition. You�ll stop at the user�s specified stopping value. You�ll change the fields to yellow every time you increment your loop based on the step value. REMEMBER: Your displayed values are 1 off from your index numbers!!)
    5.     Write a main() method that creates an instance of the Checkerboard Frame.
    a.     set the bounds for the frame to 50, 100, 300, 400
    b.     set the title bar caption to Checkerboard Array
    c.     use the setVisible() method to display the application Frame during execution
    6.     After you get all of this complete, include error handling to make sure:
    a.     the values entered in the TextFields are valid integers
    b.     the start value is greater than or equal to 1 and less than or equal to 16
    c.     the stop value is greater than or equal to 1 and less than or equal to 16
    d.     the step value is greater than or equal to 1 and less than or equal to 16
    e.     the start condition is less than the stop condition
    f.     when an error occurs, give an error message in a dialog box that is specific to their error, remove the text from the invalid field, and put the cursor in that field so the user has a chance to re-enter� this can be accomplished by using multiple try/catch statements
    g.     only change the colors if the numbers are valid
    7.     Create a clear button as seen in the example below. This button should:
    a.     clear out all 3 TextFields
    b.     change the background color of all TextArea array elements to white
    c.     put the cursor in the start field
    8.     Document!!
    my code is:
    //packages to import
    import javax.swing.JOptionPane;
    import java.awt.*;
    import java.awt.event.*;
    public class Checkerboard extends Frame implements ActionListener
         private Panel topPanel;
         private TextArea topDisplay[];
         private Panel bottomPanel;
         private TextField startField = new TextField(10);
         private TextField stopField = new TextField(10);
         private TextField stepField = new TextField(10);
         private Label startLabel = new Label ("Start");
         private Label stopLabel = new Label ("Stop");
         private Label stepLabel = new Label ("Step");
         private Button goButton;
         private Button clearButton;
         private boolean clearText;
         private boolean first;
         private int start;
         private int stop;
         private int step;
         //constructor methods
         public Checkerboard()
              //construct components and initialize beginning values
              topPanel = new Panel();
              topDisplay = new TextArea[16];
              goButton = new Button("Go");
              clearButton = new Button("Clear");
              first = true;
              bottomPanel = new Panel();
              int start = 0;
              int stop = 0;
              int step = 0;
              bottomPanel.add(startField);
              bottomPanel.add(stopField);
              bottomPanel.add(stepField);
              bottomPanel.add(startLabel);
              bottomPanel.add(stopLabel);
              bottomPanel.add(stepLabel);
              bottomPanel.add(goButton);
              goButton.addActionListener(this);
              bottomPanel.add(clearButton);
              clearButton.addActionListener(this);
              clearText = true;
              //set layouts for the Frame and Panels
              setLayout(new BorderLayout());
              topPanel.setLayout(new GridLayout(4, 4, 10, 10));
              bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));
              //construct the Display
              for(int i = 0; i <= 15; i++)
                        topDisplay[i] = new TextArea(null, 3, 5, 3);
                        topDisplay.setText(String.valueOf(i+1));
                        topDisplay[i].setEditable(false);
                        topPanel.add(topDisplay[i]);
              //add components to frame
              add(topPanel, BorderLayout.NORTH);
              add(bottomPanel, BorderLayout.CENTER);
              //allow the x to close the application
              addWindowListener(new WindowAdapter()
                        public void windowClosing(WindowEvent e)
                                  System.exit(0);
                   } //end window adapter
         public static void main(String args[])
              Checkerboard f = new Checkerboard();
              f.setTitle("Checkerboard Array");
              f.setBounds(50, 100, 300, 400);
              f.setLocationRelativeTo(null);
              f.setVisible(true);
         } //end main
         public void actionPerformed(ActionEvent e)
              //test go
              String arg = e.getActionCommand();
              //go button was clicked
              if(arg.equals("Go"))
                   //convert data in TextField to int
                   int start = Integer.parseInt(startField.getText());
                   int stop = Integer.parseInt(stopField.getText());
                   int step = Integer.parseInt(stepField.getText());
                   if((start <= 1) && (start > 16))
                        JOptionPane.showMessageDialog(null, "You must enter start between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                        startField.setText(" ");
                        startField.requestFocus();
                   if ((stop < 1) && (stop > 16))
                        JOptionPane.showMessageDialog(null, "You must enter stop between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                        stopField.setText(" ");
                        stopField.requestFocus();
                   if ((step < 1) && (step > 16))
                        JOptionPane.showMessageDialog(null, "You must enter step between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                        stepField.setText(" ");
                        stepField.requestFocus();
                   if (start < stop)
                        JOptionPane.showMessageDialog(null, "Stop cannot be larger than start", "Error", JOptionPane.ERROR_MESSAGE);
                        startField.setText(" ");
                        stopField.setText(" ");
                        stepField.setText(" ");
                        startField.requestFocus();
                   for(int i = 0; i <=16; i++)
                   topDisplay[i].setBackground(Color.blue);
                   for(int i = start; i <= stop; step++)
                   topDisplay[i].setBackground(Color.yellow);
              } //end the if go
              //clear button was clicked
              if(arg.equals("Clear"))
                   clearText = true;
                   startField.setText("");
                   stopField.setText("");
                   stepField.setText("");
                   first = true;
                   setBackground(Color.white);
                   startField.requestFocus();
              } //end the if clear
         }//end action listener
    }//end class

    got the yellow boxes to come up but just one box.....so is there something wrong with my yellow set background because I am not seeing any more errors
    //packages to import
    import javax.swing.JOptionPane;
    import java.awt.*;
    import java.awt.event.*;
    public class Checkerboard extends Frame implements ActionListener
         private Panel topPanel;
         private TextArea topDisplay[];
         private Panel bottomPanel;
         private TextField startField = new TextField(10);
         private TextField stopField = new TextField(10);
         private TextField stepField = new TextField(10);
         private Label startLabel = new Label ("Start");
         private Label stopLabel = new Label ("Stop");
         private Label stepLabel = new Label ("Step");
         private Button goButton;
         private Button clearButton;
         private boolean clearText;
         private boolean first;
         private int start;
         private int stop;
         private int step;
         //constructor methods
         public Checkerboard()
              //construct components and initialize beginning values
              topPanel = new Panel();
              topDisplay = new TextArea[16];
              goButton = new Button("Go");
              clearButton = new Button("Clear");
              first = true;
              bottomPanel = new Panel();
              int start = 0;
              int stop = 0;
              int step = 0;
              bottomPanel.add(startField);
              bottomPanel.add(stopField);
              bottomPanel.add(stepField);
              bottomPanel.add(startLabel);
              bottomPanel.add(stopLabel);
              bottomPanel.add(stepLabel);
              bottomPanel.add(goButton);
              goButton.addActionListener(this);
              bottomPanel.add(clearButton);
              clearButton.addActionListener(this);
              clearText = true;
              //set layouts for the Frame and Panels
              setLayout(new BorderLayout());
              topPanel.setLayout(new GridLayout(4, 4, 10, 10));
              bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));
              //construct the Display
              for(int i = 0; i <= 15; i++)
                        topDisplay[i] = new TextArea(null, 3, 5, 3);
                        topDisplay.setText(String.valueOf(i+1));
                        topDisplay[i].setEditable(false);
                        topPanel.add(topDisplay[i]);
              //add components to frame
              add(topPanel, BorderLayout.NORTH);
              add(bottomPanel, BorderLayout.CENTER);
              //allow the x to close the application
              addWindowListener(new WindowAdapter()
                        public void windowClosing(WindowEvent e)
                                  System.exit(0);
                   } //end window adapter
              public static void main(String args[])
                        Checkerboard f = new Checkerboard();
                        f.setTitle("Checkerboard Array");
                        f.setBounds(50, 100, 300, 400);
                        f.setLocationRelativeTo(null);
                        f.setVisible(true);
                   } //end main
                   public void actionPerformed(ActionEvent e)
                        boolean done = false;
                        //test go
                        String arg = e.getActionCommand();
                        //go button was clicked
                        if(arg.equals("Go"))
                   //convert data in TextField to int
                   int start = Integer.parseInt(startField.getText());
                   int stop = Integer.parseInt(stopField.getText());
                   int step = Integer.parseInt(stepField.getText());
                   while(!done)
                        try
                             if((start <= 1) && (start > 16)) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "You must enter start between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                             startField.setText(" ");
                             startField.requestFocus();
                        } //end catch
                        try
                             if ((stop < 1) && (stop > 16)) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "You must enter stop between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                             stopField.setText(" ");
                             stopField.requestFocus();
                        } //end catch
                        try
                             if ((step < 1) && (step > 16)) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "You must enter step between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                             stepField.setText(" ");
                             stepField.requestFocus();
                        } //end catch
                        try
                             if (start > stop) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "Stop cannot be larger than start", "Error", JOptionPane.ERROR_MESSAGE);
                             startField.setText(" ");
                             stopField.setText(" ");
                             stepField.setText(" ");
                             startField.requestFocus();
                        } //end catch
              } //end while
                        for(int i = 0; i <=15; i++)
                        topDisplay[i].setBackground(Color.blue);
                        for(int i = start; i <= stop; step++)
                        topDisplay[i].setBackground(Color.yellow);
                   } //end the if go
                   //clear button was clicked
                   if(arg.equals("Clear"))
                        clearText = true;
                        startField.setText("");
                        stopField.setText("");
                        stepField.setText("");
                        first = true;
                        setBackground(Color.white);
                        startField.requestFocus();
                   } //end the if clear
         }//end action listener
    }//end class

  • Sync send step in a loop step

    Hi Gurus,
    I want to query a database and based on the return value I will proceed to the next step. For this I have a 'sync send' step where I am finding if the count(*) is 0 or greater than 0. If it is only '0' then only I will proceed to the next step.
    For this functionality I am using a loop step with in which I have this sync send step (querying the database). The control will come out of the loop only when the count is 0.
    But, I found that the response message container is not loading. That is the reason why the loop condition is always coming out as 'true'.
    I want to know if I can use the send step with in a loop in BPM.
    Please let me know your solutions.
    Thanks
    Kalyan

    Hi,
    see the counter variable , initial value is 0 ,then the loop always true.
    second thing is when you send the request for synchronously and the response message to receive step, is it correct,
    if so why do you want to maintain the loop, are more messages sending the messages in seqencially /syncrounously .
    I think you want to check the response interface value is it , check this correctly..
    See the below links for Sync Send .
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    Regards
    Chilla

  • For loop in whlie loop

    How can I change this programm, that i will always replace the variable C instead of adding it to the value from the last while loop.
    It is supposed to calculate a new C because the temperature T0 and the pressure P0 are changing. Right now it will always add the value to the previous value of C.
    Attachments:
    Labview.JPG ‏112 KB

    Hi joschilly,
    remove the add function (and the feedback node next to it).
    Edit: after digging deeper into that BD you should replace the feedback node by a shift register and initialize that register with a zero…
    In the next step you should replace that formula node by "real" LabVIEW functions (multiplication, power function), followed up by removing the FOR loop. Use polymorphism instead!
    When you need help for that task you really should take the free online courses to learn LabVIEW!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • I have a for loop inside of while loop.when i press stop for while loop, i also would like to stop for loop.how can i solve this problem?thanks

    i have a for loop inside of while loop.when i press stop for while loop, i also would like to stop for loop.how can i solve this problem?thanks

    Hi fais,
    Following through with what JB suggested. The steps involved in replacing the inner for loop with a while loop are outlined below.
    You can replace the inner for loop with a while by doing the following.
    1) Right-click of the for loop and select "Repalce" then navigate to the "while loop".
    2) Make sure the tunnels you where indexing on with the for loop are still indexing.
    3) Drop an "array size" node on your diagram. Wire the array that determines the number of iterations your for loop executes into this "array size".
    4) Wire the output of the array size into the new while loop.
    5) Set the condition terminal to "stop if true".
    6)Drop an "OR" gate inside the while loop and wire its output to the while loops condition terminal.
    7) C
    reate a local of the boolean "stop" button, and wire it into one of the inputs of your OR gate. This will allow you to stop the inner loop.
    8) Drop a "less than" node inside the inner while loop.
    9) Wire your iteration count into the bottom input of the "less than".
    10) Wire the count (see step 4 above) into the top input of the less than. This will stop the inner loop when ever the inner loop has processed the last element of your array.
    Provided I have not mixed up my tops and bottoms this should accomplish the replacement.
    I will let others explain how to takle this task using the "case solution".
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • My finger print access to my phone is not working how do I repair it

    My finger print access on my iPhone was working now it is not.  How do I fix it?

  • 1:N mapping Scenario, BPM errors

    Hi, I am following this scenario  1: N multi mapping Various multi-mappings and Optimizing their Implementation in Integration Processes (BPM) in XI. I need your help to fix my errors for Container1, container 2, and Send step in BPM In BPM, 1. I hav

  • Customer Exit  for Calendar year/Quarter

    Hi Experts, I had a scenario as I had a Time char 0Calquarter.  Based on this I need to derive the current quarter headcount and Pervious year same quarter headcount.  To get the headcount I defined a counter constant '1' for each employee at cube le

  • I cannot get anything to play the who thing. What can i do?

    When i load anything on you tube, the video stops after a second. I cannot I cannot get anything to play the who thing. What can i do?

  • FADED & FLICKERING UNTIL IT 'S WARMED-UP

    UPON TURNING MY PB TITANIUM G4 ON THE MONITORS' SCREEN FADES TO WHITE ON THE RIGHT SIDE ON THE SCREEN AND IT FLASHES LINES LEFT TO RIGHT ON THE UPPER PORTION ON THE SCREEN. AFTER AN EST. 1-2 HRS OF USE THE SCREEN STOPS FLICKERING AND THE FULL COLOR A