Which variable contains the entered data in combobox?

Which variable contains the entered data in combobox?

Postby Marc Vanzegbroeck » Mon Feb 13, 2006 9:16 am

Hello,

Can anyone tell me the variable with the entered data in combobox?
If I use something like this:
Code: Select all  Expand view  RUN
REDEFINE COMBOBOX vGetlist[16] VAR vpara[ 1] ITEMS vparameters ID 201 OF oDlg picture '@!' STYLE CBS_DROPDOWN ON EDIT CHANGE tpsgpar(vGetlist[16]:oGet:ctext)

func tpsgpar(vpara)
   msginfo(vpara)
return nil

I allways see the previous entered data and NOT the last entered character

Thanks,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Which variable contains the entered data in combobox?

Postby Enrico Maria Giordano » Mon Feb 13, 2006 9:33 am

Marc Vanzegbroeck wrote:Hello,

Can anyone tell me the variable with the entered data in combobox?
If I use something like this:
Code: Select all  Expand view  RUN
REDEFINE COMBOBOX vGetlist[16] VAR vpara[ 1] ITEMS vparameters ID 201 OF oDlg picture '@!' STYLE CBS_DROPDOWN ON EDIT CHANGE tpsgpar(vGetlist[16]:oGet:ctext)

func tpsgpar(vpara)
   msginfo(vpara)
return nil

I allways see the previous entered data and NOT the last entered character

Thanks,
Marc


Try

Code: Select all  Expand view  RUN
ON EDIT CHANGE ( vGetlist[16]:oGet:Assign(), tpsgpar(vGetlist[16]:oGet:ctext) )


If this doesn't help then please post a reduced and self-contained sample showing the problem.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Marc Vanzegbroeck » Mon Feb 13, 2006 10:20 am

Enrico,

Here is an example.

http://www.vms.be/FWTest/combotst.zip
As you can see, the previous entered data is displayed.. :cry:

Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Enrico Maria Giordano » Mon Feb 13, 2006 1:11 pm

This is a sample. But you have to handle control keys:

Code: Select all  Expand view  RUN
#INCLUDE "fivewin.CH"
FUNCTION test()
   local oDlg, oFld
   local vgetlist:=array(79)
   local vparameters := haalallpar()
   local vpara := array(10)
   vpara[1] = space(10)

   DEFINE DIALOG oDlg RESOURCE "TPSQUERY"

   REDEFINE COMBOBOX vGetlist[16] VAR vpara[ 1];
            ITEMS vparameters;
            ID 201 OF oDlg;
            picture '@!';
            STYLE CBS_DROPDOWN

   vGetlist[16]:oGet:bChange = { | nKey | tpsgpar( RTrim( vGetlist[16]:VarGet() ) + CHR( nKey ) ) }

   ACTIVATE DIALOG oDlg CENTERED ON RIGHT CLICK oDlg:end()
RETURN nil

FUNCTION haalallpar()
   local ret_val := {}
   aadd(ret_val,'NAME'   )
   aadd(ret_val,'PTDESC' )
   aadd(ret_val,'KEYWORD')
   aadd(ret_val,'EUDESC' )
   aadd(ret_val,'UNIT'   )
   aadd(ret_val,'NODENUM')
   aadd(ret_val,'MODNUM' )
RETURN ret_val


func tpsgpar(vpara)
   msginfo(vpara)
return nil


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Marc Vanzegbroeck » Mon Feb 13, 2006 1:44 pm

Thanks Enrico,

This is what I want.

Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 4 guests