Thanks very much, Mike, I've got this working now as I want it to. Now to
incorporate it into my main form as a secondary pop-up form...

Your offer of a few more detailed examples/explanations would be very
welcome, though, because I think that I understand what is being done but
it's not really blindingly obvious yet!!

Nevertheless, in the hope somebody else might be able to make use of it,
this is the amended EEP on the "Check" button from Mike's example:

SET VAR vSel    TEXT = NULL
SET VAR vCnt    TEXT = NULL
SET VAR vInd    TEXT = NULL
SET VAR vChk INTEGER = NULL
SET VAR vRet    TEXT = NULL
SET VAR vItm    TEXT = NULL
GETPROPERTY IDLB_Menu LISTCOUNT 'vCnt'
IF (INT(.vCnt)) > 0 THEN
  SET VAR vInd = '0'
  WHILE (INT(.vInd)) <> (INT(.vCnt)) THEN
    SET VAR vChk = (INT(.vInd))
    PROPERTY IDLB_Menu CHECKINDEX .vChk
    GETPROPERTY IDLB_Menu SELECTEDSTATE 'vSel'
    IF vSel = 'TRUE' THEN
      PROPERTY IDLB_Menu ITEMINDEX .vInd
      GETPROPERTY IDLB_Menu SELECTION 'vItm'
      IF vRet IS NULL THEN
        SET VAR vRet = .vItm
          ELSE
        SET VAR vRet = (.vRet + ',' + .vItm)
      ENDIF
    ENDIF
    SET VAR vInd = (CTXT((INT(.vInd)) + 1))
  ENDWHILE
ENDIF
CLOSEWINDOW
RETURN

On exit, the variable vRet holds a comma-separated list of the checked
items.
(NB: the variable names have been amended slightly but I think they're
obvious still!)


Regards,
Alastair.

----- Original Message ----- 
From: "MikeB" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, November 29, 2004 7:29 PM
Subject: [RBG7-L] - Re: CHKBOX funtionality in Forms


> Answers In Line...
>
> ----- Original Message ----- 
> From: "Alastair Burr" <[EMAIL PROTECTED]>
> To: "RBG7-L Mailing List" <[EMAIL PROTECTED]>
> Sent: Monday, November 29, 2004 2:09 PM
> Subject: [RBG7-L] - Re: CHKBOX funtionality in Forms
>
>
> > Hi Mike, thanks for this but please could you confirm a couple of things
for
> > me?
> >
> > Firstly, it seems that clicking on the "Check Selected State..." button
> > gives the selected numbers in the pause ok but does not put them into a
> > variable. Is that intended or am I missing something. Typing those
numbers
> > into the vListSet field and then clicking on the "Toggle" button does
> > produce a variable with the numbers.
>
> Once you know the Index number of an item, you can retrieve the
"Displayed"
> value of the item Like:
>
> 1.  if the index number of the item in a "selected state" is in a variable
> "vIndex"
>
> 2.  Then you locate the item in the list to act upon via
> Property <compID> itemindex .vIndex
>
> 3.  To get the value of that item into a variable "vItem"
> GetProperty <compID> Selection 'vItem'
>
>
> > Secondly, am I right in thinking that the number returned (whatever way)
is
> > the sequence number in the list? If so, is there no way at all that it
could
> > return either the text (comma separated) or something a little more
friendly
> > to work with?
>
> The number returned is the index number of the Item in the List, beginning
with
> the "First" item at Index "0".  Most Controls that have lists are Zero
based,
> so the "Sixth" item displayed in the List is at Index "5"
(DisplayLocation - 1
> = Index#)
>
>
> > I've got it working with my table and data quite happily but it's going
to
> > be interesting <g> to work out how to select the corresponding id for
each
> > selected item of text from the position in the list.
>
> Use the method above...
>
> > Thirdly, and I realise you might not know but maybe Razzak can confirm
or
> > otherwise, is RBTI working on some sort of
"MultiSelectUserDefinedListBox"
> > or "MultiSelectDBLookUpComboBox"? If not, it sounds like one needs to be
> > added to the wish list on the website.
>
> Bound controls wouldn't accept Multiple selections very well, unless you
wanted
> to save a comma separated string to a column, so I don't think this
> functionality will migrate to any control that is not a variable type
control.
> Also, when multi select is made, it is up to the programmer to assemble
the
> selected items into a string.
>
> And Comboboxes by their very nature, don't lend themselves to a very
friendly
> multiSelect.  You can manipulate the size of a ListBox and a command
button to
> mimic a Combobox DropDown and Rollup somewhat if you just had to have it,
but
> again, ComboBoxes don't do MultiSelect very well.....
>
> > Again, thanks for this, I'm sure I can make use of it,
> > Regards,
> > Alastair.
>
>
>
> >
> > ----- Original Message ----- 
> > From: "Alastair Burr" <[EMAIL PROTECTED]>
> > To: "RBG7-L Mailing List" <[EMAIL PROTECTED]>
> > Sent: Thursday, November 25, 2004 8:48 PM
> > Subject: [RBG7-L] - Re: CHKBOX funtionality in Forms
> >
> >
> > > Many thanks - I'll take a look at it over the weekend.
> > >
> > > Regards,
> > > Alastair.
> > >
> > >
> > > ----- Original Message ----- 
> > > From: "MikeB" <[EMAIL PROTECTED]>
> > > To: "RBG7-L Mailing List" <[EMAIL PROTECTED]>
> > > Sent: Thursday, November 25, 2004 8:12 PM
> > > Subject: [RBG7-L] - Re: CHKBOX funtionality in Forms
> > >
> > >
> > > >
> > > >
> > > > > Thanks, Mike, but please could you do me a favour and either
re-post
> > or
> > > send
> > > > > me privately that example?
> > > > >
> > > > > Also, I have been experimenting today with a "Variable LookUp
Listbox"
> > > but
> > > > > you talk of a "User Defined Listbox" - will your solution work on
> > both?
> > > >
> > > > http://www.byerley.net/multiSelectForm.zip This is the Example I was
> > > referring.
> > > >
> > > > This Only works on a Variable User Defined ListBox, but there is
nothing
> > > that
> > > > *Can't* be done using it, except employ the MultiSelect when you use
> > > > Expressions for Lookups.
> > > >
> > > > In other words, just use a Declare Cursor and the ListItemsADD
Property
> > to
> > > > populate the ListBox or do a Select to a file on disk, and use the
> > > > Load_From_File property to populate it.
> > > >
> > > > Then MultiSelect works perfectly.
> > > >
> > > >
> > > > >
> > > > > Regards,
> > > > > Alastair.
> > > >
> > >
> >
>

Reply via email to