Combobox and multiarray

Combobox and multiarray

Postby Marco Turco » Sun Jan 20, 2013 3:22 pm

Hi all,
another question about combobox.
Is there a way to use a combobox to display only the second element of a multiarray ?

For example, I have a multi array like this:

aItems:={}
aadd(aItems,{"01","Marc"})
aadd(aItems,{"02","Frank"})
aadd(aItems,{"03","Paul"})

and I would like to display into the combo just the second element, so "Marc","Frank","Paul".
At the moment I solved making a new class but I would like to make this using the standard combobox class if possibile.

Any ideas ? Thanks in advance.
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Combobox and multiarray

Postby nageswaragunupudi » Sun Jan 20, 2013 3:38 pm

@ r, c COMBOBOX oCbx ........ ITEMS ArrTranspose( aItems )[ 2 ] .......
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10259
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Combobox and multiarray

Postby Marco Turco » Sun Jan 20, 2013 5:20 pm

Hi nageswaragunupudi,
thanks for the suggest. It runs well used as command line, but I'm unable to create a command "COMBOLIST" that automatically use this function with multidimensional array taking always the 2nd element.

Where I'm wrong ?

#xcommand REDEFINE COMBOLIST [ <oCbx> VAR ] <cVar> ;
[ <items: PROMPTS, ITEMS> <aItems> ] ;
[ ID <nId> ] ;
[ <dlg:OF,WINDOW,DIALOG> <oWnd> ] ;
[ <help:HELPID, HELP ID> <nHelpId> ] ;
[ ON CHANGE <uChange> ] ;
[ VALID <uValid> ] ;
[ <color: COLOR,COLORS> <nClrText> [,<nClrBack>] ] ;
[ <update: UPDATE> ] ;
[ MESSAGE <cMsg> ] ;
[ WHEN <uWhen> ] ;
[ BITMAPS <acBitmaps> ] ;
[ ON DRAWITEM <uBmpSelect> ] ;
[ STYLE <nStyle> ] ;
[ <pict: PICT, PICTURE> <cPicture> ];
[ ON EDIT CHANGE <uEChange> ] ;
=> ;
[ <oCbx> := ] TComboBox():ReDefine( <nId>, bSETGET(<cVar>),;
ArrTranspose(<aItems>)[2], <oWnd>, <nHelpId>, <{uValid}>, [{|Self|<uChange>}],;
<nClrText>, <nClrBack>, <cMsg>, <.update.>, <{uWhen}>,;
<acBitmaps>, [{|nItem|<uBmpSelect>}], <nStyle>, <cPicture>,;
[<{uEChange}>] )

Thanks in advance
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Combobox and multiarray

Postby nageswaragunupudi » Sun Jan 20, 2013 10:55 pm

ArrTranspose(<aItems>)\[2\]
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10259
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Combobox and multiarray

Postby Marco Turco » Mon Jan 21, 2013 8:32 am

Thank you.
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Carles, Google [Bot], Rick Lipkin and 17 guests