InsertListItem() works slower if the number of lines increase

Hello,
i am using a listbox to trace can/lin messages. I think that it is better to work with a textbox, but first i want to look, if there is a possibility to make the ui update faster. The item label is used to show the important data, the item value contains detailed information in a string.
Is it possible to grab the raw data of a listbox or to insert more than one item (label+value) without an ui update?
Is it possible to mark a row in a textbox like in a listbox? I need this option, to show detailed informations of a marked listbox entry a in second textbox.
Best regards,
Vitali

Let's start from the second question. A row in a textbox cannot be "marked": you can detect which row the cursor is on by using ATTR_TEXT_SELECTION_START control attribute (but you will have to handle the case when the user selects more lines) and you can replace it prepending for example an asterisk (remember to delete it when you don't need it anymore).
On the listbox size, I suppose some improvement can be obtained by hiding the control while updating (be sure the listbox is not the active control and no screen refresh happens so that you don't see flickering).
Regarding the performance, while the text (item label) is always on screen you may consider that additional informations are not so crucial to maintain them inside the control all the time. That is, you could use the item value as the index into an in-memory object or a disk file where additional informations are stored: you can retrieve and display one single element when the user asks for it, leaving the control with a reduced amount of informations stored in it. It seems to me that this could make the control lighter and possibly reduce the slowering effect you are seeing now.
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?

Similar Messages

  • How to get the number of lines of a FileReader

    I need to calculate the number of lines of a FileReader object. How can I do that ?

    I wrote the following some while ago. It assumes that a line is terminated by '\n' but it should be easy to adapt.
    import java.io.*;
    public class LineCounter
        public static int countLines(File file, String encoding) throws IOException
            int lineCount = 0;
            Reader reader = new InputStreamReader(new FileInputStream(file), encoding);
            char[] buffer = new char[4096];
            for (int charsRead = 0; (charsRead = reader.read(buffer)) >= 0;)
                for (int charIndex = 0; charIndex < charsRead ; charIndex++)
                    if (buffer[charIndex] == '\n')
                        lineCount++;
            reader.close();
            return lineCount;
        public static void main(String[] args)
            try
                File file = new File("/home/sabre/work/dev/maps/EUROPE.RIV");
                long startTime = System.currentTimeMillis();
                int lineCount = countLines(file, "UTF-8");
                double time =  (System.currentTimeMillis() - startTime) / 1000.0;
                System.out.println("File size = " + file.length() + " contains " + lineCount + " lines taking " + time);
            catch (Exception e)
                e.printStackTrace();
    }

  • Increasing the number of line items in PO

    hello fellow abapers,
    i have a query. i dont know if its the headache of the function ppl or the technicial person - which happens to be me - but i have to get this solved at the earliest.
    now ive made a PO for materials from the scratch and everythin is workin fine. except that out of the blue comes a PO with over 10000 line items. yes, thats right - 10,000 line items.
    so obviously an error was thrown by SAP. unfortunately the end-user did not think it necessary to take a printout or record the error message.
    anyways the error said something to the effect that it did not allow so many line items or somthing like that.
    now can anybody pls help me out with this. firstly is dhere any restrictions on the number of line items, and secondly, if thats the case how do i find a work-around.
    thanx a bunch
    pk

    Hi,
    The basis sets the maximum number of pages that can be printed by the user in authorization object S_SPO_PAGE.
    Please discuss with your basis guy.
    Tyken

  • Determine the number of lines of textfield or floating field

    Hi,
    Is there a way to determine the number of lines of text in a textfield or in a floatingfield.
    My problem is that I'm creating a form with three tables(made of subforms) underneed each other that needs to be set to hidden when the total of rows is greater than 25.
    Now it would be easy to just count the rows but these rows can exist of multiple lines of text.
    The fields of my row are floating fields so when the text is bigger than the displayable width the text continous on a new line in the same row. So I need to know when this happens because now I can show only 24 rows.
    I tried counting the characters but this doesn't work, when there are a lot of 'i,j,l' or other small characters I can place 40 characters in my textfield, but when there are a lot of 'm,w' characters I can place only 22 characters in my field.
    I also tried to use xfa.layout.h(TextField1,"cm") to determine the height of the field, but it always retuns the value -1. I get the same -1 with the y or x - position.
    Does anybody have an idea how to solve this problem?
    Thanks in advance,
    RonnyR

    oops ... i got it thanks.
    code below -----
    for(var i=0; i <= s.length-1; i++)
    sCurrentLetter = s.substring(i,i+1);
    if (s.charCodeAt(i) == 13)
    // this is a line break

  • Set the number of lines allowed in multi-line text field

    Hi,
    I am designing a form where I have some multi-line text fields where I only want the user to be able to enter a maximum of say 5 lines. I know I could do this by enabling the "Limit Length to Visible Area" option, however, this option is ignored by Reader 7 and the field scrolls, hiding any text that spills beyond the visible area from printouts. It works great in 8 though. To avoid this bug/feature in Reader 7, is there some script that I can use to limit the number of lines allowed in a text field?
    Thanks

    I ran into similar issues switching between Acrobat/Reader. Here is the prominent code that works for me when I use this in "Enter" event of the textField.
    var aSOM=this.somExpression.substr(15,this.somExpression.length - 1);
    var acroField = event.target.getField(aSOM);
    acroField.doNotScroll = true;
    I chose Allow Multiple Lines alone and noting else.
    Good Luck,
    SekharN

  • How can I find out the number of lines in a text file?

    How can I find out the number of lines in a text file?

    java.io.BufferedReader in = new java.io.BufferedReader( new java.io.FileReader( "YourFile.txt" ) );
    int lineCount = 0;
    while( in.readLine() != null )
    lineCount ++;
    System.out.println( "Line Count = " + lineCount );

  • How do you find the number of lines in a file?

    I need to count how many lines there are in a file, I am using a BufferedReader to read in the data, but how can I find the number of lines?
    Thanks

    That depends. How do you define a line? Is it a specific number of
    characters, a String that's terminated by a newline character or some
    combination thereof?

  • How do I increase the number of lines presented in a drop down list?

    When I am entering a single character/number for each of a random selection of three letters in a password verification, I get a drop down list from A to S only, the first 20. Accessing letter T to number 9 means scrolling down. How can I increase the number of lines in a drop down box to 36?

    Hi canddski,
    If you are taking about an interface on a website, this is up to the ui designer. But there is a reflow that depends on screensize for the Firefox UI.
    You can use asp to control the list:
    [http://forums.asp.net/t/1970301.aspx?How+can+i+display+selected+no+of+records+from+datatable+using+dropdown+list+without+database+]
    but also try asking on stackoverflow.com

  • How to get the number of lines of a file?

    Folks:
    Is there a way to get the number of lines of a text file? I don't know if there is an existing method to do that.
    Thanks a lot.

    HI
    I found some solution
    other than increment loop and all
    here is the code it might helpful to u
    //returns the number of lines in a file
    //author : Ravindra S
    //Symphony software Hyderabad
    try
    RandomAccessFile randFile = new RandomAccessFile(csvFile,"r");
    long lastRec=randFile.length();
    randFile.close();
    FileReader fileRead = new FileReader(csvFile);
    LineNumberReader lineRead = new LineNumberReader(fileRead);
    lineRead.skip(lastRec);
    countRec=lineRead.getLineNumber()-1;
    fileRead.close();
    lineRead.close();
    catch(IOException e)

  • How can i read the number of lines written - in spreadshee​t array?

    hello NI,
                           I am writing file as spreadsheet format continuously, contains date, time, chanel1, channel 2, channel 3..... etc.
    i just want to know how many lines has been written after file write....
    Regards,
    Balaji DP

    You count the number of line termination char. Se example 
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    sample.PNG ‏25 KB

  • How can i know the number of lines in field-symbol internal table

    how can i know the number of lines in field-symbol internal table

    Hi,
    If your field symbol has been defined as an internal table :
    Use std describe as
    Data: l type i.
    describe <fs> lines l.
    'l' will contain the number of lines as needed.
    FYI
    The size of this storage area in a field symbols depends on the number of table lines which is not fixed, but determined dynamically at runtime.
    Regards,
    Amit

  • How to count the number of lines dynamically,

    In the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
    after displaying one category contents am displaying a line
    which also counts to a line in the internal table.
    My question is how to count the number of lines(ULINE) displayed dynamically.
    FORM GET_LINES .
      DATA: LV_LINES TYPE I,
            LV_TIMES TYPE I,
            LV_TABIX TYPE SY-TABIX.
      DESCRIBE TABLE IT_REC LINES LV_LINES.
      DO LV_LINES TIMES.
        LV_TIMES = SY-INDEX .
        READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
        IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
          LV_TABIX =  LV_TIMES.
          READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
          IF SY-SUBRC EQ 0.
            APPEND GWA_UPDATE TO GT_UPDATE.
          ENDIF.
        ENDIF.
      ENDDO.
    ENDFORM.                    " GET_LINES

    In the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
    after displaying one category contents am displaying a line
    which also counts to a line in the internal table.
    My question is how to count the number of lines(ULINE) displayed dynamically.
    FORM GET_LINES .
      DATA: LV_LINES TYPE I,
            LV_TIMES TYPE I,
            LV_TABIX TYPE SY-TABIX.
      DESCRIBE TABLE IT_REC LINES LV_LINES.
      DO LV_LINES TIMES.
        LV_TIMES = SY-INDEX .
        READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
        IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
          LV_TABIX =  LV_TIMES.
          READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
          IF SY-SUBRC EQ 0.
            APPEND GWA_UPDATE TO GT_UPDATE.
          ENDIF.
        ENDIF.
      ENDDO.
    ENDFORM.                    " GET_LINES
    The display function is:
    FORM DISPLAY_DATA .
      ULINE.
      WRITE :  /1 SY-VLINE, 'check',
                10 SY-VLINE, 'Plant',
               20 SY-VLINE, 'Material number',
               50 SY-VLINE, 'Follow up material',
               70 SY-VLINE, 'Safety stock',
              100 SY-VLINE, 'Partc'.
      ULINE.
      LOOP AT IT_MARC.
        MOVE: IT_MARC-WERKS TO IT_REC-WERKS,
              IT_MARC-MATNR TO IT_REC-MATNR,
              IT_MARC-NFMAT TO IT_REC-NFMAT,
              IT_MARC-EISBE TO IT_REC-EISBE,
              IT_MARC-PARTC TO IT_REC-PARTC .
        APPEND IT_REC.
        CLEAR IT_MARC.
      ENDLOOP.
      DATA: GV_TABIX TYPE SY-TABIX.
      LOOP AT IT_REC.
        GV_TABIX = SY-TABIX.
        READ TABLE GT_TOTAL WITH KEY WERKS = IT_REC-WERKS
                                     NFMAT = IT_REC-NFMAT.
        IF SY-SUBRC EQ 0.
          IT_REC-PARTC = GT_TOTAL-PARTC.
          MODIFY IT_REC INDEX GV_TABIX TRANSPORTING PARTC.
        ENDIF.
      ENDLOOP.
      LOOP AT IT_REC.
        WRITE : /1 SY-VLINE, IT_REC-CHECK AS CHECKBOX,
                10 SY-VLINE, IT_REC-WERKS,
                20 SY-VLINE, IT_REC-MATNR,
                50 SY-VLINE, IT_REC-NFMAT,
                70 SY-VLINE, IT_REC-EISBE,
               100 SY-VLINE, IT_REC-PARTC.
        AT END OF NFMAT.
          ULINE.
        ENDAT.
      ENDLOOP.
      ULINE.
    ENDFORM.                    " DISPLAY_DATA
    Solved

  • Count the number of lines in a txt file

    I need to count the number of lines in a txt file, but I can't do it using readLine(). This is because the txt file is double spaced. readLine() returns null even if it is not the end of the file. thanks for the help

    I need to count the number of lines in a txt file,
    but I can't do it using readLine(). Then just compare each single byte or char to the newline (code 10).
    This is because the txt file is double spaced. readLine() returns
    null even if it is not the end of the file.Errm what? What do you mean by "double spaced"? Method readLine() should only return null if there's nothing more to read.

  • Count the number of lines in  each file in a directory

    Hello,
    I would like to count the number of lines for each file in my directory and subdirectories.
    I wonder how can I count the lines of the specified files?
    Here is the program which is listed the files in the specified directory:
                        String path = "C:/User/Studies/Pracices/src/Pract1";
           String files;
           File folder = new File(path);
           File[] listOfFiles = folder.listFiles();
           for (int i = 0; i < listOfFiles.length; i++)
            if (listOfFiles.isFile())
         files = listOfFiles[i].getName();
         System.out.println(files);

    Ok so one more question.
    Actually my path is pointing to one Directory and like here I can just read from one file that the name of the file should be specified in the path is it possible to help me in that part?
    File f = new File("C:/User/Studies/Practices/src/Pract1/");
    FileReader fr = new FileReader(f);
          BufferedReader br = new BufferedReader(fr);
          String str = br.readLine();
              LineNumberReader ln = new LineNumberReader(br);
              int count = 0;
              while (ln.readLine()!=null)
                  count++;
              System.out.println("no. of lines in the file = " + count);

  • Counting the number of lines for each procedure in a package

    Hi,
    I would like to write a query on USER_SOURCE that can display the number of code lines for each procedure/function in a package.
    Is it possible to write such a query? Maybe by using analytical functions?
    for example in the following example i would like to count the lines between "PROCEDURE proc1 IS" and "END proc1;" and between "PROCEDURE proc2 IS" and "END proc2;"
    SQL> select text  from user_source where name='PKG_TEST' and type='PACKAGE BODY';
    TEXT
    PACKAGE BODY PKG_TEST IS
      PROCEDURE proc1 IS
      BEGIN
        update t1 set EDITION_NAME = 'AAAAAAA';
        commit;
      END proc1;
    PROCEDURE proc2 IS
      BEGIN
       update t1 set EDITION_NAME = 'AAAAAAA';
        commit;
      END proc2;
    END PKG_TEST;thanks for helping

    onedbguru wrote:
    Hopefully some idiot manager isn't trying to use this sort of thing to base their decisions on developer productivity. If so, they ARE idiots. Number of code lines NEVER, EVER, EVER!!! translates into an efficient application. If I were paid by the line, my code would look like:
    select
    1
    from
    dual
    Based on the idiocy of this method of determining "performance" I would get paid $5.00 at $1.00/line. And trust me, I saw this back in the 80's and 90's and saw similar idiotic code and had to clean up the mess. Most of it wasn't efficient code to start with let alone the number of lines generated.Or the other extreme, when the PHB firmly believed that execution efficiency was gained by reducing the number of lines of code. So instead of nicely formatted, easy to read code:
          *GET NEXT ORDER NUMBER                                                               
                EXEC SQL                                                                        
                     SELECT (MAX(ORDER_NUM) + 1)                                                
                     INTO   :NEXT-NUM:IND-NULL                                                  
                     FROM   PART_ORDER                                                          
                END-EXEC.                                                                       
                IF IND-NULL < 0                                                                 
                  MOVE 1 TO NEXT-NUM.                                                           
                EXEC SQL                                                                        
                     INSERT                                                                     
                     INTO    PART_ORDER                                                         
                            (ORDER_NUM,                                                         
                             ORIGIN_LOC,                                                        
                             ORDER_TYPE,                                                        
                             ORDER_STAT,                                                        
                             CREAT_TIME)                                                        
                     VALUES (:NEXT-NUM,                                                         
                             :LOC, 'R', 'O',                                                    
                             CURRENT TIMESTAMP)                                                 
                   END-EXEC.                                                                    
                MOVE NEXT-NUM TO MASK0.                                                         
                PERFORM HEADER-PROC THRU HEADER-EXIT.                                           
            CREATE-ORDER-EXIT. EXIT.                                                     You got this:
           *GET NEXT ORDER NUMBER
            EXEC SQL SELECT (MAX(ORDER_NUM) + 1) INTO :NEXT-NUM:IND-NULL FROM
            PART_ORDER END-EXEC. IF IND-NULL < 0 MOVE 1 TO NEXT-NUM. EXEC SQL INSERT
            INTO PART_ORDER (ORDER_NUM, ORIGIN_LOC, ORDER_TYPE, ORDER_STAT,
            CREAT_TIME) VALUES (:NEXT-NUM, :LOC, 'R', 'O', CURRENT TIMESTAMP)
            END-EXEC. MOVE NEXT-NUM TO MASK0. PERFORM HEADER-PROC THRU HEADER-EXIT.
            CREATE-ORDER-EXIT. EXIT.                 Oh, wait! See the same thing all the time in this forum ... not because someone thinks fewer lines = faster code, but simply because people are sloppy.
    INSERT INTO PART_ORDER(ORDER_NUM,ORIGIN_LOC,ORDER_TYPE,ORDER_STAT,CREAT_TIME) VALUES (:NEXT-NUM,:LOC, 'R', 'O',CURRENT TIMESTAMP) ;

Maybe you are looking for

  • Buffer Add-on works only 50% of the time?

    Hello, I've recently installed the Buffer add-on, but it seems to be quite temperamental. A temporary fix is to simply restart Firefox, but this only works one or two times before the add-on freezes up again. I have the most recent version of Firefox

  • Email Report List as an attachment

    Hello Experts, I need to write a new program which will run in background and should be able to send its list as an attachement in an email. (I really appreciate if that can send the report's spool (if PDF format) as an attachment). I know that there

  • Counter in Maintenance Plan

    Dear All, i´m not sure. Is it advisable to use a own counter for each maintenance plan and is it better to create a own performance-based maint. plan for each equipment? Thanks for your help! Andreas

  • My N900 issues

    Those are my issues: 1) In some applications (such as photos,web...) suddenly quit app. with message internal error application "web or xxx" closed (I flashed my device with eMMS. 2)Sometimes does not open conversation text --->> youtube link: Video

  • Change order of pictures

    Hi, I have a Smart Album for a trip. Friend on the same trip gave me their pictures too which I want to include in the same smart album. Unfortunately, when I download their pictures, the date is the day of when I downloaded the file i.e. after the t