How to do conditional looping?

let say, i have qty. how to loop, as long as qty not equal to 0
       <c:set var="i" value="5" />
       <c:if test="${i!=0}">
              <c:set var="i" value="${i-1}" />
              <c:out value="${i}" />
        </c:if>the code above only cout 4,
not 4,3,2,1
Please correct my mistake..
Edited by: cavern on Aug 6, 2008 9:29 AM

this is my coding. no output is displayed. what is the problem?
         <c:forEach var="i" begin="5" end="0">
              <c:set var="i" value="${i-1}" />
              <c:out value="${i}" />
          </c:forEach>

Similar Messages

  • How to update Ztable from Excel file and how to check conditions ,

    HI this uday,
    pls help me how can i update Ztable from Excel file and how to check conditions .
    regards
    uday
    Moderator message: please (re)search yourself before asking.
    Edited by: Thomas Zloch on Jul 13, 2010 12:00 PM

    Hi
    Use Fm : ALSM_EXCEL_TO_INTERNAL_TABLE.
    L_INTERN : internal table with your fields .
    make sure that the fields in the Excel should be formatted (as numeric , characher ) depending upon the data types .
    LOOP AT L_INTERN INTO WA_LINTERN .
            MOVE WA_LINTERN-COL TO L_INDEX.
            ASSIGN COMPONENT  L_INDEX OF STRUCTURE WA_INREC TO <FS> .
            IF SY-SUBRC = 0.
              MOVE WA_LINTERN-VALUE TO <FS>.
            ENDIF.
            AT END OF  ROW .                                    "#EC *
              APPEND WA_INREC TO IT_DATA.  "
              CLEAR WA_INREC.
            ENDAT.
         ENDLOOP.
    Regards
    Swapnil

  • Delay/Timer only in a conditional loop.

    Hello,
    I want to use a delay(or some kind of timer) within my
    program. I intend to use to it within a conditional loop. Specifically,
    if a particular condition is true, then I want to wait for 50ms and
    then check another condition, which if true, I want to stop my program.
    I have used wait vi in the timing section. But this vi pauses my
    whole program. Specifically, when the above mentioned condition is met,
    I want the delay vi to execute along with my data acquistion vi. At
    present, when the delay vi executes, everything (data acquisition, peak
    detetction, plotting etc) in the program pauses. I guess its correct
    functionality of wait vi but it does not suit my need.
    Does someone have any alternate for pausing (delay/timer) a
    particular condition loop without affecting the other parts of my
    program? Specifically, only the conditional loop delays for a certain time while other features like data acquisition, peak
    detetction, plotting etc excute normally.
    Message Edited by Neuropotential on 02-22-2010 12:47 PM
    Message Edited by Neuropotential on 02-22-2010 12:48 PM
    Solved!
    Go to Solution.

    Yes. This is exactly what I was looking for. But, there is a issue. In practise, i will not be looking at 10 sec delay but a very small number like 50 ms. With this approach, when I set a value of 50ms, my program stops after close to 90-93ms (After 50ms, there is a AND gate, when true stops the program; Refer to the attachement).
    There are multiple reasons which I see. First is obvious I am using a windows xp with lot of other stuff going on simutaneously. Also. elapsed time vi is an "express vi". Do you think this can be one of the primary reason for such a delay? Finally, I intend to use this program on RT based machine.
    Do  you see it working exactly as expected on those machines or do I have to modify my code? Please guide me. 
    Also, how to I mark your post as answer and other good things. 
    Thanks 
    Attachments:
    Image.JPG ‏60 KB

  • Phase calculation in conditional loop

    I collect data from 2 channels on an Agilest oscilloscope (DSO-X-2004A) using the IVI Scope Acquire block. After acquiring those signals, I want to know the phase difference, which I calculate in the following manner: Tone Extraction CH1, Tone Extraction CH2, Formula (detect phase1 - detect phase 2). 
    I want to run this in a loop, and store the phase difference each loop. For that I have a conditional loop (set to 10 iterations for now), and after each phase difference calculation I save the new data point to a txt file. Is there another way of storing/saving the phase difference calculation from each loop, besides saving it to file?
    The next problem I have is that after all the loops are finished, I want to look at the phase difference data and plot it vs iteration number. This is a problem because I get the error: "The selected file does not contains any Signals that could be imported" when trying to load the data at the end. I have the load ascii block outside the conditional loop that generates the data file, so I don't know why the load ascii is trying to excecute before the loop is done. I tried splitting everything into Sequence conditions with execution delays, but that hasn't worked either.
    Is there a better way to save the calculation from each loop, or how do I appropriately load by text file after creating it in the same signal express project?
    Thanks,
    John Oxaal

    Thanks for sending the the project.  For now if you would like to easily integrate the setup that you have in SignalExpress into LabVIEW you can actually convert the project into LabVIEW code.  As long as the LabVIEW version is as late or later than your SignalExpress version, you can do this.  Please refer to document below on how to convert signal express project into a LabVIEW VI.
    How Can I Generate a LabVIEW VI From My SignalExpress Project?:
    http://digital.ni.com/public.nsf/allkb/96C01D2680084AAA86256F33007D98FA
     Once you figure out how to take in your data in LabVIEW, you can start placing your data in the array that I mentioned from which you can process the data.
    Cameron T
    Applications Engineer
    National Instruments

  • How to read open loop status on cFP-AO-200

    How to read open loop status on cFP-AO-200, i need to know which channels are open loop.
    Brad Whaley
    LabVIEW Certified Engineer

    If you are reading a multiple channel tag and one or more channels is(are) in an Open Loop condition, then you will receive a warning from the FP Read or FP Write. However, this warning simply tells you that one or more channels has reported an Open Loop condition. If you need to figure out which channel is specifically reporting the Open Loop condition, you have to read/write each channel individually to get the channel status for a particular channel.
    Regards,
    Aaron

  • How to enter condition wise tax amount manually in MIR7 & MIRO?

    We have a PO with a tax code entered in it.
    but while parking invoice in MIR7, we want to enter condition wise tax amount manully which is different than calculated tax amount through tax code and subsequently we want the same manual tax amount to be displayed in MIRO also
    I tried to enter amount for each condition in 'Detail' screen of 'Tax' tab in MIR7,
    but at the time of simulating, amount calculated as per tax code is only shown and not the amount entered by me
    'Calculate Tax' checkbox is not selectd in this case.
    Can anybody tell me how to enter condition wise tax amount manully in MIR7 & MIRO and post an accounting entry with this manually entered tax amount?

    Hi,
    i checked their is no unplanned delivery cost and in FV13 tax is 12.5%. In FTXP No Tax Percent rates.
    Regards
    Mahesh

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

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

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

  • How to set a loop on an .flv so that an exported .swf loops?

    hi there. i am using Flash CS4 and I would like to know how to set a loop in an flv file so that when it is exported to swf, the movie will loop. Basically i have taken an existing interactive flash movie and have decompiled it into its individual flv counterparts. what i intend to do is take out all the nonsense from each flv file and then reconstruct the flash movie, export each file to swf and then convert each swf to avi or some other video format. to do this i will be using sothink swf to avi converter which allows you to convert swf files to avi files. this program allows you to convert swf files that loop by looping the swf file for as long as you want until you stop it, in which a video file is created from "the recording"
    after i decompiled the original file, many of the existing flv files were already set to loop. i know this because when exported to swf the swf file would loop. now when i went ahead and went into each flv file to edit a couple things, when i went to export them to swf, the swf files wouldn't loop. mind you, some of them did loop, and some of them did not loop. the ones i have edited are all supposed to loop and i cannot figure out what it is thats preventing some of the flv or exported swf files to loop. all i did was take out a few unnecessary frames from the beginning of each flv and nothing more. i am pretty new to Flash and do not know anything about coding and know very little about flash settings.
    i figured that selecting the "loop playback" option in the control drop down menu might help seeing as the flv file does loop when played in the editor, but again when exported to swf the swf file does not loop. what confuses me the most is that some of the exported swf files do loop. ALL of the exported swf files need to loop and my guess is that in order to make that happen, something in the flv file needs to be set correctly.
    can someone please assist me with this issue? if there is a way to simply loop an existing swf file that does not loop, can someone tell me how to do that? any help with this problem is greatly appreciated and i appologize if something like this has been asked before.... i just couldnt stand looking through 22 pages of search results to find the exact solution to my problem
    thank you!!!

    Hi,
    You can use shortDesc property. Something like
    <af:commandToolbarButton text="Some Button"
          id="ctb1" shortDesc="This button does something.."/>-Arun

  • How to use conditional success Screen in SMP2.3 HWC?

    Hi All,
      Do anybody have reference for conditional success screen,
    I gone through this link SUP 2.2 Conditional Navigation Issue
    but i didnt able to do how to use conditional success Screen.
    If anybody have reference please provide me.
    Regards,
    Sravanya

    That works. Follow the below steps.
    1. Create a key on the selection screen: click on the selection screen>properties>keys>Add a key,ex. "value".
    2. MenuItem>In the properties of menu item>Parameter mappings>map the key with the key created in last step.ie. "value" instead of the key of the choice box.
    3. Get the value selected from choicebox:
    function customValidateScreen(screenKey, values) {
      if(screenKey === "Selection")
      var form = document.forms[screenKey + "Form"];
      if(form){
      SelectionValue = form.ChoiceboxKey.value;
    //ChoiceboxKey is the key of choicebox.
    //Declare a global value "SelectionValue "
    3. Map PK from program:
    customBeforeSubmit = function(screenKey, actionName, dataMessageToSend) {
      if(screenKey =="Selection" && actionName=="GoToChart" ){
      var myNewValue2 = new MessageValue();
      myNewValue2.setKey("Value");// Key created in the screen "Selection"
      myNewValue2.setValue(""+SelectionValue );
      myNewValue2.setType("TEXT");
      var mvc = dataMessageToSend.getValues();
      if( mvc ) {
      mvc.add( myNewValue1.getKey(), myNewValue1 );
    // So in the above way the data from choice box is send to online request.
    To do the conditional navigation you have to use the global value created,ex.
    hwc.customConditionalNavigation = function(currentScreenKey, actionKeyName, defaultNextScreen, conditionName, incomingDataMessage) {
      if( conditionName === 'Data'&& SelectionValue == "PieChart") {
             return false;
         }else{
        return true;
    Hope you understand how I did this.
    Midhun VP

  • How to resolve the loop in universe level

    how to resolve the loop in universe level

    Hi, Kashim
              In univese level loops resolved by Chasm Trap and Fan Trap methods.
    Chasm Trap:  A chasm trap is a type of join path between three tables when two many-to-one joins converge on single table, and there is no context in place that separate the converging join paths.
    There is "many-to-one-to-many"relationship beween the three tables in the universe structure.you can define a context for each table at the many end of the joins.
    A chasm trap is not dependent on the object types, the query could be made up of only dimensions,only details,or only measures,or any combination of the three types with the "many " tables for chasm to occure.
    you can also detect the chasm trap Automatically, tool---->Detect context
    To resolve the chasm trap, you need to make two separate Queries and than combine the results Depending on type of objects defined for the fact tables and the type of end user environment,
    Fan trap: it is occured when there is a "one-to-many" join to the table that "fans out " into another "one-to-many" join to another table.
    Avoid fan trap: The first place by relating all measure objects in the universe to the same table in the universe structure,Avoid placing a measure on anything other than the last table in a in a table path, which is the table with the "many" cardinality attached to it.
    This methods is not recomended as it only works for measure objects and may result in inefficienies in processing the query. This resolution works the same for chasm and fan traps.
    you can create more alias tables based on your requirement in single universe. and it is true conext, when two or more paths.
    Theese methods also apply for resolving loops:
    Short cut join also one method for resolving loops
    Aggregate aware function used another waty for resolving loops
    if you are not resolving the loop result is  redusing the number of records.

  • How to create conditional update trigger in sql server

    How to create conditional update trigger in sql server

    You cant create a conditional update trigger. Once you create an update trigger it will get called for every update action. However you could write logic inside it to make it do your activity based on your condition using IF condition statement
    Say for example if you've table with 6 columns and you want some logic to be implemented on update trigger only if col3 and col5 are participating in update operation you can write trigger like this
    CREATE TRIGGER Trg_TableName_Upd
    ON TableName
    FOR UPDATE
    AS
    BEGIN
    IF UPDATE(Col3) OR UPDATE (Col5)
    BEGIN
    ....your actual logic here
    END
    END
    UPDATE() function will check if column was involved in update operation and returns a boolean result
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to execute a loop for every 15 minutes

    how to execute a loop for every 15 minutes or 30 minutes constantly...

    I need to insert a number into an array for every 15mins continuously..and the array need to hold all datas for example in 0th position i insert a value 10 by 10.00am, after that at 1st position i need to insert 11 by 10.15am, next at 2nd position i need to insert 12 by 10.30am and so on...how this can be done

  • How to find condition  type for a particular material document no.

    hiiiiii
    How to find condition type for a particular material document no.

    Hi
    Condition types are maintained at PO level
    Take the EKKO-KNUMV and pass to
    KONV-KNUMV field and take the different condition types values from KONV
    Take the Material Document No (MBLNR) and pass to MSEG table and take the EBELN field and from EKKO table take EKKO-KNUMV field and pass to KONV
    see the table T685 for different condition types.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • How to find condition type for a material???

    How to find condition type for a material??

    Hi Suman.
    Refer the following
    tcodes:http://www.tcodesearch.com/sap-tables/search?q=condition+types
    and http://wiki.scn.sap.com/wiki/display/Snippets/Get?original_fqdn=wiki.sdn.sap.com
    Please search for condition type with pricing condition/pricing procedure.
    Regards,
    Kannan

  • How to make a loop run for specific period of time ?

    hello !
    i'm new to labview and could'nt found how to make a loop run for 2 sec for example, and then to exit.
    Solved!
    Go to Solution.

    Hi Hookso,
    You can do it using the different loops like While loop and For Loop. Roderic has already stated how to do it using a for loop. I have illustrated in the attached vi how to do it using a while loop and Elapsed Time function. Take a look.
    Regards,
    Nitzz
    (Give kudos to good Answers and Mark it as a Solution if your problem is Solved) 
    Attachments:
    Untitled 2.vi ‏36 KB

Maybe you are looking for

  • My iPhone suddenly turned off by itself and it won't turn back on, what to do?

    So I was just texting with my iPhone (with 35% battery life) earlier and when I check my phone again 5 mins later, it completely turned off. So, I tried holding the sleep/lock botton on top + the Home button (for more than 10 sec) and it won't turn o

  • Threads with servlets

    Best groupmember, I have a jsp and a servlet. The jsp includes the servlet. The servlet looks like this: class TheServlet extends HttpServlet { private String myFirstname = ""; private String myLastname = ""; public void doPost(......) { //Loads of t

  • Customizing the work protect mode

    Hi, I have a problem in customizing the sap providing work protect mode. When I activate the work protect mode, a pop up is coming up and the default radio button selected is to open the unsaved data in a new window. Can you please let me know can we

  • Visual (WYSIWYG) Spark Skinning

    Hi, I've been having a very tough time with the transition to the Spark components. I've already authored another post about trying to skin spark components with Flash, but I'm going to give this another shot. First, let me say that I am not exclusiv

  • EA2 - strange column order in "Columns" tab

    Hi, when I click on a table in the left panel, I'd expect the columns in the "Columns" tab appear in the same order as the table has been defined (i.e. ordered by column id). But instead the columns are ordered by primary key. Of course I can doublec