Announcement

Collapse
No announcement yet.

COMBOBOX SELECT: different bahaviour

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

  • COMBOBOX SELECT: different bahaviour

    Hi guys,

    Playing around with DDT's combo boxes stuff, I've discovered slightly different behaviour between the following calls for the same operation.

    Code:
    CONTROL SEND CBHNDL, 100, %CB_SETCURSEL, 0, 1
    COMBOBOX SELECT CBHNDL, 100, 1
    Both calls select the first element of a combobox-array. In other words: the first call is base zero based, the
    second is base one based. I think, this is very confusing.



    ------------------
    mailto:[email protected][email protected]</A>
    www.basicguru.com/zijlema/



    [This message has been edited by Egbert Zijlema (edited August 06, 2001).]

    Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
    http://zijlema.basicguru.eu
    *** Opinions expressed here are not necessarily untrue ***

  • #2
    DDT COMBOBOX and LISTBOX items are always 1 based. This is the documented behavior and not likely to change as it would break a lot of existing code.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      I certainly do agree, Lance.
      Base one is what Basic programmers are used to. And DDT is a part of a Basic compiler. So... it should be one. Nevertheless I expercienced the above mentioned difference.

      ------------------
      mailto:[email protected][email protected]</A>
      www.basicguru.com/zijlema/

      Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
      http://zijlema.basicguru.eu
      *** Opinions expressed here are not necessarily untrue ***

      Comment


      • #4
        Hi Egbert,
        Of course, you have to remember that COMBOBOX SELECT is specific to Comboboxes.
        CONTROL SEND is generic to all controls. In order for the compiler to decide what
        value to send, it would have to do extra work in determining control types, (which
        could be changed on the fly!) Better just to let the user know that it sends the
        exact message the user specified to the control!

        regards,

        ------------------
        [email protected]
        :) IRC :)

        Comment

        Working...
        X