Announcement

Collapse
No announcement yet.

Problem : inserting back but one place higher

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem : inserting back but one place higher

    Hi all,

    I want to try this but it's not correct from the vb60 syntax

    vb60
    Code:
    DIM content AS STRING
    DIM index    AS SINGLE
    
    ProgList.AddItem content, index - 1
    PBWin
    Code:
    DIM content AS STRING
    DIM index    AS SINGLE
    DIM hDlg     AS DWORD
    
    LISTBOX ADD hDlg, %LST_PROG_LIST, content
    LISTBOX SELECT hDlg, %LST_PROG_LIST, index - 1
    But it's not the same result of the vb60 syntax, Why is that wrong here?

    #2
    Not enough code for any result.

    Failure to ... again.

    Hint on one thing. What numeric type should index be?
    Dale

    Comment


      #3
      Just a guess, but VB may use the Windows' standard "zero-based" index whereas DDT uses a "one-based" index to identify individual items in a list-type control. That would surely have to mess up whatever you are doing (as noted, insufficient code shown).

      Also a guess: if listbox is using the sorted style, "add" may actually be doing an "insert sorted"

      Also.. with the DDT, doesn't LISTBOX ADD offer the "TO ivar" option, returning the (DDT one based) index where item was actually inserted, as is available using SDK-style coding?
      Last edited by Michael Mattias; 25 Mar 2015, 08:47 AM.
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


        #4
        Originally posted by Michael Mattias View Post
        ...

        Also.. with the DDT, doesn't LISTBOX ADD offer the "TO ivar" option, returning the (DDT one based) index where item was actually inserted, as is available using SDK-style coding?
        Yes.
        Do not go quiet into that good night,
        ... Rage, rage against the dark.

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎