About mest loop

hi forks,
   i have some doubts about the nest loop
when i write the code in this type
  loop at itab1 into lfc_itab1.
     loop at itab2 into lfc_itab2 where k1 = lfc_itab1-k1.
     endloop.
  endloop.
but my leader told me to write in this way
sort itab2 by k1 ascending.
loop at itab1 into lfc_itab1.
  read table itab2 with key k1 = lfc_itab1-k1 binary seach.
  li_tabix = sy-tabix.
  loop at itab2 form  li_tabix.
    if lfc_itab1-k1 = lfc_itab2-k1.
    endif.
  endloop.
endloop.
i also agree with what he said,but i write test code
it return the opposite result .i use record (100100,10001000,10000*10000)
dose anyone tell which will be better
thanks in advance

Hi,
In ur case second logic is better , first one is call as LINEAR SEARCH and asecond one is called as BINARY SEARCH.
in LINEAR search ALL entries of itab are processed where as in Binary search entries processaed are logrihtm in no.
Binary serach is like getting desired page in a book using index, say if u want to search 41st page in 100 page book so in binary seach, if u opeend first time at 50 then it will search first half only, in second pas if u opened 30 page then it iwll search second half and so on...
Jogdand M B

Similar Messages

  • Some question about "Dual loop feedback"

    http://zone.ni.com/devzone/conceptd.nsf/webmain/E7​ABA6F4D569010A86256F5A005B64F3/
    Switch Feedback on the Fly
    Consider a heat-sink assembly application where a position sensor is the feedback device for the initial positioning along the Z axis. However, when the heat sink is pressed on to the PCB, a force sensor must be the feedback device for precise motion control in the latter part of the process. With NI motion controllers, you can switch feedback devices on the fly without reinitializing the controller. The new feedback device might require the system to have a new set of PID gains loaded immediately after the axis is reconfigured. To minimize the delay, you can configure an additional set of PID gains with the motion controllers.
    anyone can give me some detailed materials about "switch Feedback on the Fly", for example, some programme,some words to explain it.
    another question is that if i don't use the torque sensor, can i directly use the DAC to control the voltage to come true the torque control?
    Thanks for your answer

    anyone can give me more suggestion about the Dual loop feedback?
    I really know little.
    Hope your suggestion.
    Thanks a lot

  • Question about Midi loops and Software Instruments

    In past versions of Garage Band, I could take a Midi loop ("the green ones") and drag it onto a track with a different instrument and it would play with that instrument. For example, I could drag a loop of a piano melody onto a guitar track, and the melody would play on the guitar. In '08 though, if I drag the piano melody onto the guitar track, it changes the instrument for that track to the loop's instrument, in this case the piano. Is there any way to switch this function off? I find nothing in the preferences.
    It's getting really annoying constantly dragging out loops and changing instruments to what I intend to have.

    not to dissuade you from trying, you could always find something that i missed, but i did test the modifier keys, none changed anything (and the shiftKey prevented a drag from occurring at all)
    as i recall, no matter what i did, dropping into a blank track changed it, dropping into a track that already had a region in it tossed up a warning dialogBox (i think it allowed you to proceed, automatically create a new track, or cancel the operation)
    this does seem like a behavior that should have a toggle in prefs

  • Question about For Loop in Procedure

    In my procedure, I'm trying to insert a value for estValue for the first 50 records, a value for entValue for the second 50 records and a value for both entValue and corValue for the last 50 records. At record 51 in the loop, estValue should no longer hold a value, but it still is being populated:
    PROCEDURE insert_data
    estValue OUT Number,
    entValue OUT Number,
    corValue OUT Number
    IS
    BEGIN
    -- Insert 150 Records
    For myCount IN 1 .. 150 LOOP
    -- num_var will be a factor of 10
    -- so first time through num_var = 1 x 10 = 10
    -- second time num_var = 2 x 10 = 20
    num_var := myCount * 10;
    IF myCount > 0 AND myCount < 51 THEN
    estValue := num_var;
    ELSIF myCount >= 51 and myCount < 101 Then
    entValue := num_var;
    ELSE
    entValue := num_var;
    corValue := num_var;
    END IF;
    DBMS_OUTPUT.put_line('estValue ' || estValue);
    DBMS_OUTPUT.put_line('entValue ' || entValue);
    DBMS_OUTPUT.put_line('corValue ' || corValue);
    End Loop;
    So for the first 50 records estValue starts at 10, then 20, up to 500 but when I reach record 51, I don't want estValue to be set to any value, but it still is showing up as 500 for each record after 50. What am I doing wrong?
    Thanks

    You are not resetting estValue, so estValue remains at the last set value of 500 ...
    ELSIF myCount >= 51 and myCount < 101 Then
    entValue := num_var;
    estValue := 0;
    ELSE
    entValue := num_var;
    corValue := num_var;
    estValue := 0;

  • Question about for-loop

    I have a for-loop problem:
    I want to write a two for-loops to produce this below output
    100
    200  205
    300  305  310
    400  405  410  415
    500  505  510  515  520
    600  605  610  615  620  625
    700  705  710  715  720  725  730 
    800  805  810  815  820  825  830  835Anyone has some idea, i seem to get stuck!

    vichet wrote:
    Yeah, you all are right! it's my homework.
    It looks kinda easy. but at the previous moment, I could not get it to solved.but you did. Good deal!
    By the way, do you have any idea on how I can learn to improve my skill to solve such problem quickly? It seems to take me long to solve this problem. and I am worried that it might take me long to write code later on as my brain does not seem to be robust :(Yep, practice, practice, practice. Try to stretch yourself. There are problems posted here every day, so why not try to figure them out?

  • Question about while loop using Timer?

    I am trying to use a while loop to read data from oscilloscope through
    GPIB card continously(lasting for a fixed time, for example,1 minute). I
    want a Timer, when it expires, the while loop will stop. But I do not
    know how to implement it.
    Any help would be greatly appriciated!
    Thanks in advance.
    zhljh
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    In article <87q5t2$7kh$[email protected]>, wrote:
    >I am trying to use a while loop to read data from oscilloscope through
    >GPIB card continously(lasting for a fixed time, for example,1 minute). I
    >want a Timer, when it expires, the while loop will stop. But I do not
    >know how to implement it.
    So, you need it to count down, then I assume? Okay, you need to put a
    true/false node within your for loop. Set the true case to i=1 (iteration
    of the for loop) so that it will initialize one time (and be true one
    time). Then, add whatever time you need for the vi to run to that
    indicator (where you send a numeric value on the first iteration). Put a
    greater than comparison to the timer and the additoin of the indicator and
    your value. Let that be the term
    inating thing on your for loop.
    Now, this might present a problem with a circular reference. If it does,
    you'll need to basically do the same thing, only you'll need to send the
    value through a shift register in the for loop.
    Harry

  • Curious about apple loops

    As I cruise around the apple forums and manuals, I'm curious to what makes a loop an "apple Loop" as compared to just a loop.
    As I read further I'm pretty sure that I noticed somewhere that all loops created can become "apple loops". Is this true?
    So, I can import a wav file in 16 bit, from any disc, ie: drums on demand, and convert that into an "apple loop".
    I'm converting to GB from a pc based product and I'm wondering what I can still use.
    I noticed that M audio has a bunch of cool sounding sample and loop libraries. Some are stated to be in "apple" format. Others were aiff and rex, can I use these and convert them?
    Sorry for all the ?
    One more........on a different subject
    Should I use my podxt as a direct usb to usb into GB.... Or ........record direct to the line in from the podxt analog out? Thanks very much nyhatco

    what makes a loop an "apple Loop"
    When it's properly tagged with metadata describing its Key, Tempo, etc it becomes an Apple Loop.
    loops [...] can become "apple loops"
    Get Apple's Loop Utility
    http://thehangtime.com/gb/gbfaq2.html#soundtracklooputility

  • About step loops

    how do you program page down page up in step loops

    Hi
    STEP LOOPS
    Step Loops are type of screen table . Step loops are repeated blocks of field in a screen. Each block contains one or more fields and these blocks are repeated. Step loops aren’t like actual table. You can scroll vertically but not horizontally. Three steps are associated with creation of step loops:
    • Creation of step loops on screen, which includes declaring fields on the screen and then defining the step, loops for these fields.
    • Passing data to the step loop is exactly similar to the passing of data to table controls.
    • In step loop, you don’t need to define the step loop as such in the module pool program but the cursor needs to be defined in the program.
    Types of Step Loops
    • Static – Static Step Loop (SSL) have fixed size that cannot be changed during the runtime. If user resizes the window, the size of the static step loop is not changed.
    • Dynamic – Dynamic Step Loop (DSL) is variable in size. When the user resizes the window, the system increases or decreases the number of the step loop blocks.
    You can have only one dynamic step loop and can have as many static loops in your transaction.
    Programming with the Static and dynamic step loop is exactly same. For the system or for the user it doesn’t make any difference whether it is static or dynamic step loop. Only attribute, which you fix during designing of the step loop, is type attribute for step loop F for fixed i.e static and V for variable i.e. dynamic.
    Writing code for Step Loop in the flow logic.
    PBO.
    Loop at itab cursor cl.
    Module set.
    Endloop.
    PAI.
    Loop at itab.
    Endloop.
    Empty loop is must for both table control and step loop
    LOOP AT statement for step loops and Table controls is similar. Loop At statement transfers the data to screen table. You need to have the Module to assign the values for the screen table.
    In module pool program you need to define the cursor.
    Date: CL TYPE i.
    Cursor parameter tells which line of step loop display should start.
    “Module Set” in module pool program assigns the values to step loop fields, which is similar to table controls.
    Refer to this program DEMO_DYNPRO_STEP_LOOP
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • About timing loop and GUI control

    Hi all,
      I have a code with two buttons placed on the panel, one is RUN, another is STOP. Initially, STOP is disabled and when I kick RUN, the STOP will be disable. But when STOP is  kicked, the RUN will be activated.
    #include "testimg.h"
    #include <windows.h>
    #include <utility.h>
    #include "asynctmr.h"
    #include <ansi_c.h>
    #include <cvirte.h>
    #include <userint.h>
    #include <NIDAQmx.h>
    #include "toolbox.h"
    static int panelHandle = 0;
    static int stoprun = 0;
    int main (int argc, char *argv[])
    int error = 0;
    nullChk (InitCVIRTE (0, argv, 0));
    errChk (panelHandle = LoadPanel (0, "testimg.uir", PANEL));
    SetCtrlAttribute(PANEL, PANEL_STOPBUTTON, ATTR_DIMMED, TRUE);
    errChk (DisplayPanel (panelHandle));
    errChk (RunUserInterface ());
    Error:
    if (panelHandle > 0) DiscardPanel (panelHandle);
    return 0;
    int CVICALLBACK MainPanelResponse(int panel, int event, void *callbackData, int eventData1, int eventData2)
    if (event == EVENT_CLOSE) QuitUserInterface (0);
    return 0;
    int CVICALLBACK RunButtonResponse (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
    if (event==EVENT_COMMIT)
    int N=20;
    stoprun = 0;
    SetCtrlAttribute(panel, PANEL_STOPBUTTON, ATTR_DIMMED, FALSE);
    SetCtrlAttribute(panel, PANEL_RUNBUTTON, ATTR_DIMMED, TRUE);
    for (int i=0; i<N; i++)
    // some heavy task
    // here I use Sleep instead
    Sleep(5000);
    ProcessSystemEvents();
    Sleep(2000);
    if (stoprun>0) break;
    SetCtrlAttribute(panel, PANEL_STOPBUTTON, ATTR_DIMMED, TRUE);
    SetCtrlAttribute(panel, PANEL_RUNBUTTON, ATTR_DIMMED, FALSE);
    return 0;
    int CVICALLBACK StopButtonResponse (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
    if (event==EVENT_COMMIT)
    stoprun = 1;
    return 0;
    My code is designed so to repeat a operation for N times after the START button is kicked. And if STOP button is kicked before the task is finished running. Stop the current application and return false; I wrote the code but it seems doesn't work. It seems that the application cannot be interrupted before the completete of the task. I don't know what's wrong with my code. If you have any experienence with that, could you please tell me what's wrong with my cdoe? Thanks.
    Solved!
    Go to Solution.

    What you are seeing is the expected behaviour: in your loop inside the run button, you have a 5 seconds wait in which the system is frozen, next another 2 sec with the system frozen again. For simulation puroposes you should modify the code this way:
    double tini;
    tini = Timer ();
    requestToStop = 0;
    while (Timer () - tini < 5.0 || requestToStop) {
    ProcessSystemEvents ();
    sleep (50);
    The Stop button then must raise a global variable that stops the loop (requestToStop in my example above).
    In actual code, such a long lasting process should not be handled inside a control callback: you should place it elsewhere depending on how you want to structure your code so to leave the UI responsive. Available alternatives are:
    - A UI timer callback
    - An Asynchronous timer callback (similar to the preceding one but executed in a separate thread)
    - A separate thread issued with CmtScheduleThreadPoolFunction
    Whichever is the solution, the stop button must be handled inside the code by raising a signal that let the processing stop in a secure manner.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • [win32] - about message loop

    i'm confused with message loop :(
    see these function:
    //Message Loop
    WPARAM MessageLoop()
    MSG msgEvents;
    while(GetMessage(&msgEvents, NULL, 0, 0) > 0)
    if(IsChild(GetForegroundWindow(),msgEvents.hwnd)==TRUE || GetForegroundWindow()==msgEvents.hwnd)
    if(IsDialogMessage(GetForegroundWindow(), &msgEvents) == TRUE)
    TranslateMessage(&msgEvents);
    DispatchMessage(&msgEvents);
    return msgEvents.wParam;
    i did several tests and seems:
    1 - if i press Alt key, the underline(on menu bar) is showed. if i unpress it, the underline isn't showed.
    2 - when i do Alt + H(i have on test) the message is called twice.
    what i miss with message loop?
    (if i take off that 2 if's, the problem of the alt key goes away)
    is possible the Alt key, with that message loop, been called twices?

    I think your logic is wrong for IsDialogMessage.  I say this based on these two things from the
    IsDialogMessage documentation.
    Because the IsDialogMessage function performs all necessary translating and dispatching of messages, a message processed by IsDialogMessage
    must not be passed to the TranslateMessage or DispatchMessage function.
    If the message has been processed, the return value is nonzero.
    Based on that, I think your logic should be:
    if (!IsDialogMessage(GetForegroundWindow(), &msgEvents))
    TranslateMessage(&msgEvents);
    DispatchMessage(&msgEvents);
    IsDialogMessage may handle the message, and when that has happens, you must not process the message.  Otherwise you risk processing the message twice.
    And in the reverse case, you are getting messages and not dispatching them -- essentially dropping them on the floor.  This also seems very wrong.
    Extra:  It also seems wrong to return a field of an uninitialized msgEvents structure when GetMessage returns 0.

  • About smartforms loop

    hi,
    i am using an internal table importing from the program.
    i have one main window and 2 windows.the windows are not nested into main window.all windows are seperated.this is my main page.
    i have to insert this main page in a loop.how can i do this?

    right click on the window ? here u will find options LOOP? pick this
    and window format should be like this
    ---> window
    >looop
    >text
    u have to call Loop within the WINDOW.
    regards
    Prabhu

  • Hypothesis testing about While Loop with Wait MS

    I'm posting VIs here for users to download as part of another conversation going on here.  Please ignore these VIs unless you've read my post that other thread and decided to test the theory yourself.
    The attached are for LabVIEW 2009.
    Save the .mnu file over your existing file at
              C:\Program Files\National Instruments\LabVIEW 2009\menus\default\plat\structs.mnu
    (make a backup copy first)
    (also, the .mnu file has been given a .txt extension so that I can post it to the forums... remove that .txt extension when saving it)
    and save the VI as
              C:\Program Files\National Instruments\LabVIEW 2009\vi.lib\Utility\WhileLoopWithWait.vi
    Attachments:
    WhileLoopWithWait.vi ‏5 KB
    structs.mnu.txt ‏3 KB

    File I/O is not very efficient. I recommend that you do you file logging in a parallel task. Have one task do your data acquision. This task would then pass the data to be logged to the logging task via a queue. That way your file operations do not impact your data acquision. Also, express VIs are not very efficient. You would be better off accessing that directly using the DAQ VIs. The express VIs contain lots of steps that do not need to be done every time you call it such as initializing the device.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How to disable 'Hello'tried about loop:enabled -not working

    I have the new version of Mozilla Firefox and it starts up with 'Hello' that allows video talking. I have tried to amend about:config, loop:enabled to disable it but this does not work, each time I start up my machine 'Hello' is back.
    Any suggestions? Could the fact that my History clears daily mean the change to Hello is not being saved?

    hello DivaDiva, are you referring to the current hello promotion on the firefox start page? this is different from the actual feature itself which you can disable through the loop.enabled preference & will be featured on the homepage for just a few days...

  • Loop Browser

    I just bought a new 2.8 24" iMac. When I turned it on, I transfered all my files from my old iMac G5, including GarageBand, Logic Studio, and all Jam packs (which I paid for) to the new iMac. Unfortunately most loops are not active in the browser. They show up, without the blue or green icon, and if you click on one a box appears telling you the file isn't installed and asks you to go to software update to download the loops (I am current with all software). However, I have found these loops in my library: audio: apple loops: apple: apple loops for garage band. Most are aiff files. I could drag and drop them into Garage Band, but then I'll show duplicates in the browser. For example, I have 3,315 drum loops (I checked my old computer), but only 624 work in GarageBand on my new computer. By the way, Logic is missing about 170 loops on my new computer. Can someone offer a suggestion as to how to get these loops to work in GarageBand? Thanks in advance for your help.

    I could drag and drop them into Garage Band, but then I'll show duplicates in the browser.
    reindex the loops:
    http://www.bulletsandbones.com/GB/GBFAQ.html#reindex

  • I need help organizing my Loop Library

    I've been researching this online but just cannot find the answer.
    I have GB11' (ver 6.0.4) operating on OS X Lion (ver 10.7.2).
    I've learned how to add custom loops by using drag-and-drop and Apple Loop Utility
    But I am still having troubles so I'd like to ask a few questions
    How do I add an entire folder of loops?
    I've tried drag-and-drop, GB seems to respond to it and would begin to load data, but I cannot seem to find it anywhere in the library.
    I could, however, add them individually and it works without a problem.
    I've tried Loop Utility too, but after saving the files it still would not appear in my GB library.
    (the files are in correct format .WAV and .AIFF)
    Where are the physical files of the custom loops located?
    So GB won't let me add an entire folder of loops, fine. I've managed to add a few individually, BUT! Where are the physical files?
    One discussion I found from here said that different versions of GB save the files in different locations.
    According to the article, I should be able to find them in /Library/Audio/Apple Loops/User Loops
    But on my Mac there is no "User Loops" folder. (They are not in "/Apple Loops for GB" either.)
    The bizzare thing is, these loops still work in GB!!!
    The reason I'm asking this is because I'd like to get rid of some undesired loops I added while testing.
    Also, I want to rename them so I can easily locate them.
    But this seem impossible because I cannot find the actual files..
    So the last question is
    How do I delete or rename the loops?
    If I can't rename it, at least let me delete it so I can reupload!!!
    The "Loop Index" does not contain any information about the loops I added either.
    Any help will be appreciated!!
    Thank you for your time!!

    allstreetball625 wrote: How do I add an entire folder of loops?
    I've tried drag-and-drop, GB seems to respond to it and would begin to load data, but I cannot seem to find it anywhere in the library.
    dropping the folder onto the browser pane _is_ indeed how you add loops. perhaps it's a setting in your project:
    http://www.bulletsandbones.com/GB/GBFAQ.html#missingloops
    (Let the page FULLY load. The link to your answer is at the top of your screen)
    allstreetball625 wrote:
    (the files are in correct format .WAV and .AIFF)
    and they have been formatted as "Apple Loops"?
    allstreetball625 wrote:
    Where are the physical files of the custom loops located?
    http://www.bulletsandbones.com/GB/GBFAQ.html#myloopsstored
    (Let the page FULLY load. The link to your answer is at the top of your screen)
    allstreetball625 wrote:
    How do I delete [...] the loops?
    see the end of the above FAQ entry
    allstreetball625 wrote:
    How do I [...] rename the loops?
    i don't believe you can from within GB, you'd have to drop the renamed file onto the loop browser to index it
    allstreetball625 wrote:
    The "Loop Index" does not contain any information about the loops I added either.
    there is usually more than 1 index file (not sll stored in the same place). see the reindexing entry for help in finding them:
    http://www.bulletsandbones.com/GB/GBFAQ.html#reindex
    (Let the page FULLY load. The link to your answer is at the top of your screen)

Maybe you are looking for