Help With DCCOMBOBOX

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Help With DCCOMBOBOX

#1 Post by GeneB »

I am trying to make an array used in DCCOMBOBOX dependant on a DCGET selection.
I have tried the code below as well as adding code blocks, but can't make it work.
I figure it is simple but I could use a hint.
Thanks in advance.
GeneB in Albuquerque

Code: Select all

cLetter := cItem := " "
aItems := {" "}

@ 1,1 DCGET cLetter  PICTURE "!"                          ;
                     VALID {|| FillItems(cLetter,@aItems) ;
                             , DC_GetRefresh() ;
                             , .T. }

@ 2,1 DCCOMBOBOX cItem LIST aItems


FUNCTION FillItems(cLetter,aItems)
IF cLetter=="A"
   aItems := {"apple","arrow"}
ELSE
   aItems := {"banana","bugle"}
ENDIF
RETURN nil

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: Help With DCCOMBOBOX

#2 Post by RDalzell »

Hi Gene,

Try...

Code: Select all


#include "DcDialog.Ch"
#include "DcPick.Ch"

FUNCTION Main()

  LOCAL GetList := {}

  cLetter := cItem := " "
  aItems  := {" "}

  @  1, 1 DCGET cLetter  PICTURE "!"  VALID {|| FillItems(cLetter,@aItems,GetList) }

  @  2, 1 DCCOMBOBOX cItem LIST aItems SIZE 15,10  OBJECT oComboBox

  DCGETOPTIONS ;
		   NOCONFIRM ;
			NOMAXBUTTON ;
			HILITEGETS GRA_CLR_RED

  DCREAD GUI ;
         FIT ;
			OPTIONS GetOptions ;
			TITLE 'DCCOMBOBOX'

RETURN Nil

FUNCTION AppSys

RETURN Nil

STATIC FUNCTION FillItems(cLetter,aItems,GetList)

  IF cLetter=="A"
     aItems := {"Apple","Arrow"}
  ELSE
     aItems := {"Banana","Bugle"}
  ENDIF

  DC_VarToListBox(oComboBox, aItems)

  cItem := aItems[1]

  DC_GetRefresh(GetList)

RETURN Nil

Rick

User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Re: Help With DCCOMBOBOX

#3 Post by GeneB »

Thanks, Rick
I had not discovered DC_VarToListBox()
Thanks for the help and your time
GeneB

Post Reply