ComboBax vs Multi dimension array

ComboBax vs Multi dimension array

Postby Gilbert Vaillancourt » Wed Oct 12, 2005 3:11 am

Hi All,

Ihave a multi denmension array which have 4 elements and 5 fields.
I want to display and select any of the 4 elements but only on field 2.

How can I achive this ? :?

Regards,

Gilbert
Gilbert Vaillancourt
 

Postby Antonio Linares » Wed Oct 12, 2005 4:51 am

Gilbert,

You may review samples\TestArr2.prg.

Please register on this forum, thanks.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

ComboBox vs Multi dimension Array

Postby Gilbert Vaillancourt » Thu Oct 13, 2005 1:45 pm

Hi Antonio,


Thanks for your answer, but I think you didn`t understand my question.

Browsing an array is not causing me any problem for now.

What I want to do is use a COMBOBOX and combine two fields for selection in the drop down list. TestArr2.prg demonstrated how to browse multi dimension array. 8)

Regards,

Gilbert
Gilbert Vaillancourt
 

Postby Detlef Hoefner » Sat Oct 15, 2005 11:41 am

Gilbert,

may be this could help you.

Best regards,
Detlef

Code: Select all  Expand view  RUN
#include  "fivewin.ch"

///////////////
FUNCTION Main()
///////////////
LOCAL oDlg, oCbx
LOCAL aSmall := {}
LOCAL cVar   := ""
LOCAL aBig   := {;
                  { "Element 1, 1", "Element 1, 2", "Element 1, 3", "Element 1, 4", "Element 1, 5" },;
                  { "Element 2, 1", "Element 2, 2", "Element 2, 3", "Element 2, 4", "Element 2, 5" },;
                  { "Element 3, 1", "Element 3, 2", "Element 3, 3", "Element 3, 4", "Element 3, 5" },;
                  { "Element 4, 1", "Element 4, 2", "Element 4, 3", "Element 4, 4", "Element 4, 5" } ;
                }



   aEval( aBig, { |a| aadd( aSmall, a[ 2 ] ) } )
   cVar := aSmall[ 1 ]
   
   DEFINE DIALOG oDlg

   @ 10, 10 COMBOBOX oCbx;
     VAR cVar;
     ITEMS aSmall;
     SIZE 60, 150;
     PIXEL;
     OF oDlg
   
   ACTIVATE DIALOG oDlg

RETURN( NIL )
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby Gilbert » Thu Oct 20, 2005 4:45 pm

Hi Detlef,

Thanks for your suggestion. That`s exactly the technique I`m using right now, but I don`t like it. I was thinking of eliminate the second array and work with the original array instead.

The original multi dimension array content has to change according to two other Get fields. Working with two array makes the code much more complex because I will need to update the orignal array wich in turn will be used to update the second array. :(

Regards,
Gilbert Vaillancourt
turbolog@videotron.ca
Gilbert
 
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Postby Maurilio Viana » Tue Nov 22, 2005 10:53 am

Gilbert, I think you must do changes in TComboBox class to let this feature...

Regards,
Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby Taiwan » Tue Nov 22, 2005 11:31 am

Hello

This function you want?

Image
Image

Regards,

Richard
Fivetech.net Taiwan
User avatar
Taiwan
 
Posts: 218
Joined: Fri Oct 07, 2005 1:55 am
Location: Taipei, Taiwan


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 1 guest