Announcement

Collapse
No announcement yet.

How do I extract this variable ? Combobox related.

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

  • How do I extract this variable ? Combobox related.

    Hi everyone,

    I'm a little confused about extracting a data value/variable from
    an action that seems to offer the data value to other certain actions.
    (Im working on a combobox project)

    For example.

    Dialog.Message (ComboBox.GetItemData(this, ComboBox.GetSelected(this)), "", SW_SHOWNORMAL);

    This will display, in a dialog the value I selected in the combobox. In this case an exe.

    I tried to assign this total action as a variable ie:

    result = (ComboBox.GetItemData(this, ComboBox.GetSelected(this)), "", SW_SHOWNORMAL);

    and I just get syntax errors.

    Ideally I would like to run the exe without extracting the value, for example

    File.Run (ComboBox.GetItemData(this, ComboBox.GetSelected(this)), "", SW_SHOWNORMAL);

    However this also does not work.. I feel Im missing a simple syntax format ?
    Why does the Dialog.Message work, and not the File.Run ?

    Any pointers much appreciated.

  • #2
    You may want to use the Action Wizard or the Action Properties dialog, if you are against reading the docs. SW_SHOWNORMAL is not a valid argument for a Dialog.Message() - you have several of errors in these actions.

    Ulrich

    Comment


    • #3
      Im only using the Dialog.Message as an example that the value can be extracted.

      I've spent the last 2 hours reading Combobox doco's...

      The example above is the closest example I can manage that appears
      to know which data field is associated with the selection you made,
      without having to specify the index number of every line in the combobox.

      I can reach my solution that way, doing 7 different queries on each line,
      but my example above seems to grab the data info I want, no matter what
      item is selected, in one line of code.

      Comment


      • #4
        I can reach my solution that way, doing 7 different queries on each line,
        but my example above seems to grab the data info I want, no matter what
        item is selected, in one line of code.
        Your examples are incorrect. Just view them in using the Action Properties dialogs and it should be clear that you are making mistakes:

        Click image for larger version

Name:	SNAG-2014-01-21-01.png
Views:	1
Size:	29.8 KB
ID:	284144

        Ulrich

        Comment


        • #5
          Thanks Ulrich,

          Simple syntax error, (otherwise on the right track)

          all working now.

          Comment

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