Thanks, for the examples.

Is there a property command that will move entries up and down in a
listbox?

I found by inserting into a temp table during the process of copying
from one listbox to another and then having a push button with the
following code that I can move an item up a spot but can a property
command do it in one shot?
 
  GetProperty lbOther ItemIndex .vchk
  GetProperty lbOther selection vitem

  SELECT (lbIndex) +
   INTO vlbIndex +
   INDICATOR vilbIndex +
   FROM ttIndex +
   WHERE lbValue = .vItem

  SELECT MAX(lbIndex) +
   INTO v2lbIndex +
   INDICATOR vi2lbIndex +
   FROM ttIndex +
   WHERE lbIndex < .vlbIndex

  SELECT (lbValue) +
   INTO vReplace +
   INDICATOR viReplace +
   FROM ttIndex +
   WHERE lbIndex = .v2lbIndex

  UPDATE ttIndex SET lbValue = .vItem WHERE lbIndex = .v2lbIndex
  UPDATE ttIndex SET lbValue = .vReplace WHERE lbIndex = .vlbIndex

  SET VAR vtid INTEGER
  SET VAR vcol TEXT
  SET VAR vColumns TEXT
  PROPERTY lbOther LISTITEMSCLEAR 'TRUE'
  PROPERTY lbOther MULTISELECT 'TRUE'

  SET ERROR MESSAGES 705 OFF
  DROP CUR c2
  SET ERROR MESSAGES 705 ON

  DECLARE c2 CUR +
   FOR SELECT lbValue, lbIndex +
   FROM ttIndex

  OPEN c2
  FETCH c2 INTO vColumns IND viColumns, vtid IND vin0
  WHILE SQLCODE = 0 THEN
    RECALC VARIABLES
    PROPERTY lbOther listitemsadd .vColumns
    FETCH c2 INTO vColumns IND viColumns, vtid IND vin0
  ENDWHILE --SQLCODE = 0

Close C2

  PROPERTY lbOther LISTITEMSREFRESH 'TRUE'
  RETURN




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of MikeB
Posted At: Wednesday, December 01, 2004 1:46 PM
Posted To: RB7-L
Conversation: [RBG7-L] - Re: ListBox Properties
Subject: [RBG7-L] - Re: ListBox Properties


Ok... I have quickly put up a listbox demo form with code to manipulate
the items in every way I can think of for now.  The code isn't commented
yet, but by trying it, you will see the functionality and the code there
will help you for now.

The data to fill the listbox is based on the Company table in ConComp,
so you will have to put the form in one of your ConComp dbs.

www.byerley.net/listboxdemo.zip


----- Original Message -----
From: "Charles Parks" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, December 01, 2004 12:27 PM
Subject: [RBG7-L] - ListBox Properties


How do I select the text at a certain index in a ListBox

I am using these commands:
PROPERTY <ComponentID> CHECKINDEX .vchk
GETPROPERTY <ComponentID> SELECTEDSTATE 'vsel'
GETPROPERTY <ComponentID> SELECTION 'vitem'

The SelectedState comes back with the correct value but Selection comes
up with the item that I last clicked on.

Reply via email to